Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- !/bin/lua
- -- -*- coding: UTF-8 -*-
- local r = require("robot")
- local s = require("sides")
- local io = require("io")
- local size
- io.write("Please enter the size of your hole")
- io.flush()
- size = io.read()
- -- Main loop
- for j=1,size do
- for i=1,size do
- mine()
- end
- end
- function mine()
- turnLeft(1)
- r.swing()
- turnRight(2)
- r.swing()
- r.swingUp()
- r.swingDown()
- turnLeft(1)
- r.swing()
- r.forward
- end
- function turnLeft(x)
- for i=1, x do
- r.turnLeft()
- end
- function turnRight(x)
- for i=1, x do
- r.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement