Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs < 1 then
- print("usage: name <size>")
- return
- end
- local size = tonumber( tArgs[1] )
- -- Digs two sides from a square, forward and to the right
- function digSides(size)
- -- Dig the first side ("left"), straight forward
- for i = 1, size do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- -- Dig the second side ("back") (to the right from the starting position)
- for i = 1, (size - 1) do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- end
- -- Dig the square, two sides at a time, reducing the size of the leftover square
- for i = 0, (size - 1) do
- digSides(size - i)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement