Posted 20 November 2012 - 07:26 AM
I used a program on this website called 'streetbuilder' and have edited it.
I am trying to make the turtle return to where it started at the end of the program using the last bit of this code below.
This generates the error
what I would like to know is where i am going wrong or is there a better way to do it?
I am trying to make the turtle return to where it started at the end of the program using the last bit of this code below.
Spoiler
lua
=
print("How many times?")
a=tonumber(read())
x=1
while x<=a do
turtle.digDown()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.digDown()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.digDown()
turtle.placeDown()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight()
x=x+1
end
when x==a do
turtle.turnRight()
turtle.turnRight()
turtle.forward(a)
end
bios:338: [string "platform"] :24: '=' expected.
line 24 is "when x==a do"what I would like to know is where i am going wrong or is there a better way to do it?