Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("how Long?")
- a=tonumber(read())
- term.setCursorPos(1,3)
- term.clearLine()
- print("how Wide?")
- b=tonumber(read())
- term.setCursorPos(1,5)
- term.clearLine()
- print("how Deep?")
- c=tonumber(read())
- right = true
- goForward = 6
- goSideward = 6
- goDown = 6
- function move(direction) --turtle moving
- if direction == "up" then
- while not turtle.up() do
- if not turtle.digUp() then
- turtle.attackUp()
- end
- end
- elseif direction == "down" then
- while not turtle.down() do
- if not turtle.digDown() then
- turtle.attackDown()
- end
- end
- else
- while not turtle.forward() do
- if not turtle.dig() then
- turtle.attack()
- end
- end
- end
- end
- function row()
- x = 1
- turtle.placeDown()
- turtle.digDown()
- while a-x >= goForward do
- for _=1, goForward do
- move()
- x = x + 1
- end
- turtle.placeDown()
- turtle.digDown()
- end
- if a-x ~= 0 then
- for _=1, a-x do
- move()
- x = x + 1
- end
- turtle.placeDown()
- turtle.digDown()
- end
- end
- function layer()
- y = 1
- while b-y >= goSideward do
- row()
- if right == true then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- for _=1, goSideward do
- move()
- y = y + 1
- end
- if right == true then
- turtle.turnRight()
- right = false
- else
- turtle.turnLeft()
- right = true
- end
- end
- if b-y ~= 0 then
- row()
- if right == true then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- for _=1, b-y do
- move()
- y = y + 1
- end
- if right == true then
- turtle.turnRight()
- right = false
- else
- turtle.turnLeft()
- right = true
- end
- end
- row()
- end
- function cube()
- z = 1
- layer()
- while c-z >= goDown do
- for _=1, goDown do
- move("down")
- z = z + 1
- end
- turtle.turnRight()
- turtle.turnRight()
- layer()
- end
- if c-z ~= 0 then
- for _=1, c-z do
- move("down")
- z = z + 1
- end
- turtle.turnRight()
- turtle.turnRight()
- layer()
- end
- end
- cube()
- term.clear()
- term.setCursorPos(1,1)
- print("done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement