Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input = {...}
- -- x, y, and then z
- width = input[1]
- depth = input[2]
- height = input[3]
- startdir = 0
- dir = 0
- function turnright()
- turtle.turnRight()
- dir = dir + 1
- if dir > 4 then
- dir = 0
- end
- end
- function turnleft()
- turtle.turnLeft()
- dir = dir - 1
- if dir < 0 then
- dir = 4
- end
- end
- for i = 1, height do
- for i = 1, width do
- for i = 1, depth - 1 do
- turtle.dig()
- turtle.forward()
- end
- turnright()
- turnright()
- for i = 1, depth - 1 do
- turtle.forward()
- end
- if i ~= tonumber(width) then
- turnleft()
- turtle.dig()
- turtle.forward()
- turnleft()
- end
- end
- --Height loop kicks in here.
- turnright()
- turnright()
- turnleft() -- Does a little dance, I like it so I'm leaving it.
- for i = 1, width do
- turtle.forward()
- end
- turnright()
- if i ~= tonumber(height) then
- turtle.digUp()
- turtle.up()
- else
- for i = 1, height do
- turtle.down()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment