Posted 20 July 2015 - 12:55 PM
I'm trying to see if this will work to incorporate into a few things I'm trying to make, but it doesn't seem to cooperate like it looks. It's supposed to change between turning right and left based off x being even or odd. The code look like;
While true do
local x = 1
if (x % 2 == 2) then
turtle.turnLeft()
else
turtle.turnRight()
end
x = x + 1
end
That should turn left, then turn right, then repeat, but from my experience it continues to turn right only. Any advice?
thanks in advance.
Also, sorry for the sloppy looking post, not sure how to put the code in quotes, or how to number the lines on a phone xD sorry
While true do
local x = 1
if (x % 2 == 2) then
turtle.turnLeft()
else
turtle.turnRight()
end
x = x + 1
end
That should turn left, then turn right, then repeat, but from my experience it continues to turn right only. Any advice?
thanks in advance.
Also, sorry for the sloppy looking post, not sure how to put the code in quotes, or how to number the lines on a phone xD sorry