Posted 26 September 2012 - 09:55 PM
hi
I'm trying to write a program the mines a 7x13 area and it's not working and i can't see what i'm doing wrong. Please Help.
y=7
repeat
x=13
repeat // moves forward 13
turtle.dig()
turtle.forward()
x=x-1
until x<1
rol=y
if math.mod(rol, 2) == 0 then rol=l //test if left or right turn
else
rol=r
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
turtle.forward()
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
y=y-1
until y<1
end
the error message I get is:
bios:206:[string "mine"] :21:
'end' expected (to close 'if' at
line 17)
Please Help
EDIT:above fixed but a new problem has occurred
y=7
repeat
x=13
repeat // moves forward 13
turtle.dig()
turtle.forward()
x=x-1
until x<1
rol=y
if math.mod(rol, 2) == 0 then rol=l //test if left or right turn
else
rol=r
end
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
end
turtle.forward()
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
end
y=y-1
until y<1
end
bios:206 [string "mine"]:25:
'<eof>' expected
again please help, I am sorry for my stupidity
I'm trying to write a program the mines a 7x13 area and it's not working and i can't see what i'm doing wrong. Please Help.
y=7
repeat
x=13
repeat // moves forward 13
turtle.dig()
turtle.forward()
x=x-1
until x<1
rol=y
if math.mod(rol, 2) == 0 then rol=l //test if left or right turn
else
rol=r
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
turtle.forward()
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
y=y-1
until y<1
end
the error message I get is:
bios:206:[string "mine"] :21:
'end' expected (to close 'if' at
line 17)
Please Help
EDIT:above fixed but a new problem has occurred
y=7
repeat
x=13
repeat // moves forward 13
turtle.dig()
turtle.forward()
x=x-1
until x<1
rol=y
if math.mod(rol, 2) == 0 then rol=l //test if left or right turn
else
rol=r
end
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
end
turtle.forward()
if rol==r then turtle.turnRight()
else
turtle.turnLeft()
end
y=y-1
until y<1
end
bios:206 [string "mine"]:25:
'<eof>' expected
again please help, I am sorry for my stupidity