Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Really simple quarry program
- --Written by Civilwargeeky
- function dig()
- while not robot.forward() do
- robot.swing()
- end
- end
- function down()
- while not robot.down() do
- robot.swingDown()
- end
- end
- io.write("Length? ")
- x = tonumber(io.read()) or 3
- io.write("\nWidth? ")
- z = tonumber(io.read()) or 3
- io.write("\nHeight? ")
- y = tonumber(io.read()) or 3
- turnRight = true
- facing = 0
- for i=1, y do
- for i=1, z do
- for i=1, x do
- dig()
- end
- if turnRight then
- func = robot.turnRight
- else
- func = robot.turnLeft
- end
- turnRight = not turnRight
- func()
- dig()
- func()
- end
- down()
- func()
- func()
- if z%2 == 0 then rowCheck = left end
- end
- for i=1, y do robot.up() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement