Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function line(dlina)
- for x = 1 , dlina do
- if turtle.getItemCount() == 0 then
- turtle.select(2)
- end
- turtle.turnRight()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- end
- end
- function square(dlina)
- for b = 1, 4 do
- line(dlina)
- turtle.turnRight()
- end
- end
- function cube(length,height)
- for s = 1 , height do
- square(length)
- turtle.up()
- end
- end
- function pyramid(size)
- squareSize = size
- squareNum = math.ceil(size / 2)
- for y = 1, squareNum do
- square(squareSize)
- turtle.forward()
- turtle.turnRight()
- turtle.up()
- turtle.forward()
- turtle.turnLeft()
- squareSize = squareSize - 2
- end
- end
- function roof(size)
- turtle.select()
- pyramid(size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement