Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- function up()
- local can, type = robot.detectUp()
- if (can)
- then
- robot.swingUp()
- end
- robot.up()
- end
- function forward()
- local can, type = robot.detect()
- if (can)
- then
- robot.swing()
- end
- robot.forward()
- end
- function placeDown()
- local can, type = robot.detectDown()
- if (can)
- then
- robot.swingDown()
- end
- robot.placeDown()
- end
- for slot = 1,16,1
- do
- robot.select(slot)
- for i = 1,robot.count(slot),1
- do
- -- robot.up()
- forward()
- placeDown()
- end
- forward()
- robot.turnRight()
- up()
- robot.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement