Ok here's an easy question I was wondering about
Can you do turtle.turnRights(2) instead of writing turtle.turnRight() twice ? because When I did it, the turtle only turn right once.
Easy question
Started by trillilyy, Apr 11 2013 04:35 PM
6 replies to this topic
#1
Posted 11 April 2013 - 04:35 PM
#2
Posted 11 April 2013 - 04:48 PM
No, but you can write a function to do it for you.
function right(times)
for i = 1,times do
turtle.turnRight()
end
end
#4
Posted 12 April 2013 - 07:08 AM
shorter version:
shell.run("turn","right","2")
#6
Posted 12 April 2013 - 07:15 AM
function right(times)
shell.run("turn","right",tostring(times))
end
that better?might aswell just run that single line instead of calling a function every time .-.
#7
Posted 12 April 2013 - 08:04 AM
I gotta agree with Dlcruz129 on this one.. It's not as good to use shell.run
since you can customize much more in functions..
since you can customize much more in functions..
function right(times)
for i = 1, times do
turtle.turnRight()
end
end
--Then you just call it like this
right(2)
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users












