Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- tofu
- -- 豆腐建築を行うプログラムです
- -- ####### Config ###########
- local haba = 9
- local okuyuki = 7
- local takasa = 3
- -- ####### Functions ########
- function placeSomeBlocks(n)
- if n<1 then
- turtle.placeDown()
- return
- end
- for i=1,n do
- turtle.forward() -- move to next position
- turtle.placeDown() -- put a block in the ground
- end
- end
- function placeSquare2(okuyuki, haba)
- for i=1,2 do
- placeSomeBlocks(okuyuki - 1)
- turtle.turnRight()
- placeSomeBlocks(haba - 1)
- turtle.turnRight()
- end
- end
- function placeSquare(nagasa)
- if nagasa < 2 then
- turtle.placeDown()
- return
- end
- for hen=1,4 do
- placeSomeBlocks(nagasa-1)
- turtle.turnRight()
- end
- end
- function goToRightForward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- end
- function selectNextSlot()
- local n = turtle.getSelectedSlot()
- if n == 16 then
- n = 1
- end
- turtle.select(n+1)
- end
- -- ###### Main ########
- turtle.select(1) -- the usual phrase
- turtle.up() -- move up
- -- stack six squares
- for ronoji=1,takasa do
- -- 1st stage is made with slot 1, 2nd stage is slot 2, ...
- turtle.select(ronoji)
- -- 四角形の形にブロック配置
- -- placeSquare(haba)
- placeSquare2(okuyuki, haba)
- turtle.up() -- move up
- end
- -- 屋根作り
- while (okuyuki > 0) or (haba > 0) do
- print(okuyuki, haba)
- placeSquare2(okuyuki, haba)
- selectNextSlot()
- goToRightForward()
- okuyuki = okuyuki - 2
- haba = haba - 2
- end
- redstone.setOutput("bottom",true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement