Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --stairs
- function moveLeft(blocks)
- turtle.turnLeft()
- for i=1,blocks do
- turtle.forward()
- end
- turtle.turnRight()
- end
- function moveRight(blocks)
- turtle.turnRight()
- for i=1,blocks do
- turtle.forward()
- end
- turtle.turnLeft()
- end
- function moveUp(blocks)
- for i=1,blocks do
- turtle.up()
- end
- end
- function moveForward(blocks)
- for i=1,blocks do
- turtle.forward()
- end
- end
- function buildSide(height, amount)
- for i=1,height do
- for j=1,amount do
- turtle.place()
- moveLeft(1)
- end
- moveRight(amount)
- moveUp(1)
- moveForward(1)
- end
- end
- function ready(amount)
- turtle.forward()
- turtle.turnLeft()
- for i=1,amount-1 do
- turtle.forward()
- end
- end
- function main(amount, width, length, height)
- for i=1,height,2 do
- buildSide(width, amount)
- ready(amount)
- buildSide(length, amount)
- ready(amount)
- end
- end
- print("amount")
- local amount = tonumber(read())
- print("width")
- local width = tonumber(read())
- print("length")
- local length = tonumber(read())
- print("height")
- local height = tonumber(read())
- print("amount="..amount)
- print("width="..width)
- print("length="..length)
- print("height="..height)
- main(amount, width, length, height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement