Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local args = {...}
- function left()
- robot.turnLeft()
- end
- function right()
- robot.turnRight()
- end
- function forward()
- robot.forward()
- end
- function up()
- robot.up()
- end
- function down()
- robot.down()
- end
- function dig()
- robot.swing()
- end
- function digUp()
- robot.swingUp()
- end
- function refuel()
- end
- local reptimes = tonumber(args[1])
- function loop()
- digUp()
- left()
- dig()
- up()
- dig()
- right()
- right()
- dig()
- down()
- dig()
- left()
- end
- while (reptimes > 1) do
- loop()
- dig()
- forward()
- os.sleep(0.1)
- reptimes = reptimes-1
- end
- loop()
Advertisement
Add Comment
Please, Sign In to add comment