Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require ("robot")
- wall = 1
- step = 0
- function robot.step()
- repeat
- if step < wall then
- robot.forward()
- step = step+1
- os.sleep(2)
- end
- until step == wall
- print("Length reached, turning right")
- robot.turnRight()
- step = 0
- repeat
- if step < wall then
- robot.forward()
- step = step + 1
- os.sleep(2)
- end
- until step == wall
- robot.turnRight()
- wall = wall+1
- end
- repeat
- robot.step()
- until false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement