Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local lenght = tonumber(args[1])
- local width = tonumber(args[2])
- local hight = tonumber(args[3])
- local ceil_hight = (hight - hight % 3) / 3
- local function do_line(distance)
- local pos = 0
- turtle.digUp()
- turtle.digDown()
- while pos < distance do
- turtle.dig()
- if turtle.forward() then
- pos = pos + 1
- end
- turtle.digUp()
- turtle.digDown()
- end
- end
- local function do_flat(side)
- for i=1, width do
- do_line(lenght-1)
- if i ~= width then
- if i % 2 == side then
- turtle.turnRight()
- do_line(1)
- turtle.turnRight()
- else
- turtle.turnLeft()
- do_line(1)
- turtle.turnLeft()
- end
- end
- end
- end
- local function do_volume()
- for i=1, ceil_hight do
- if width % 2 == 0 then
- if i % 2 == 0 then
- do_flat(0)
- else
- do_flat(1)
- end
- else
- do_flat(1)
- end
- turtle.turnLeft()
- turtle.turnLeft()
- if i ~= ceil_hight then
- local step_up = 1
- while step_up <= 3 do
- turtle.digUp()
- if turtle.up() then
- step_up = step_up + 1
- end
- end
- end
- end
- end
- local function come_back()
- if ceil_hight % 2 == 0 then
- print("x")
- else
- if width % 2 == 1 then
- do_line(lenght-1)
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- do_line(width-1)
- turtle.turnRight()
- end
- local step_down = 1
- while step_down < ceil_hight*3 -2 do
- turtle.digDown()
- if turtle.down() then
- step_down = step_down + 1
- end
- end
- end
- do_volume()
- come_back()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement