This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LeCanardNoir's profile picture

movIt

Started by LeCanardNoir, 08 November 2012 - 04:42 PM
LeCanardNoir #1
Posted 08 November 2012 - 05:42 PM
Very simple way to type where the turtle go.
iamFrenchBe …. :P/>/> sorry for my english.

just type :
movIt(5,TR)
——> it turn right 5 time

TR = turnRight
TL = turnLeft
BK = go back
FW = go forward


function BK()
	turtle.back()
end
function FW()
	turtle.forward()
end
function TL()
	turtle.turnLeft()
end
function TR()
	turtle.turnRight()
end
function movIt(num ,direc)
local fn01 = direc
for i = 0 , num do
	fn01()
	end
end

and iam not a programmer so if you want help go for it
LeCanardNoir #2
Posted 14 November 2012 - 12:54 PM
new one

with MAGICTURTLE 1.38

function mov (direction, step)
	local st = step
	local dr = direction
	local drLs = {'fw', 'bk', 'up', 'dn', 'lt', 'rt'}
	if dr == drLs[1] then
			mt.forward(st)
	elseif dr == drLs[2] then
			mt.back(st)
	elseif dr == drLs[3] then
			mt.up(st)
	elseif dr == drLs[4] then
			mt.down(st)
	elseif dr == drLs[5] then
			mt.turnLeft(st)
	elseif dr == drLs[6] then
			mt.tunrRight(st)
	else error("probleme de direction !!!!!")
	end
end
mov('up', 5)
bjornir90 #3
Posted 24 November 2012 - 05:50 AM
Je pense que le message d'erreur devrait être en anglais car on est sur un forum anglais. Sinon le programme m'a l'air bien fait. ;)/>/>