Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This program will carve out a square room
- -- of dimensions specified.
- io.write("Height: ")
- height = io.read()
- io.write("Width: ")
- width = io.read()
- io.write("Depth: ")
- depth = io.read()
- function dig()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- end
- function wline(param)
- for i=1, param do
- dig()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for i =1, param do
- turtle.forward()
- end
- turtle.turnRight()
- end
- function tall(param1,param2)
- for i=1,param1-1 do
- wline(param2-1)
- turtle.digUp()
- turtle.up()
- turtle.turnRight()
- end
- wline(param2-1)
- for i=1, param1-1 do
- turtle.down()
- end
- end
- function deep(parama1,parama2,parama3)
- for i=1,parama1 do
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- tall(parama2,parama3)
- end
- end
- deep(depth,height,width)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement