Advertisement
RTS_Dmitriy

first house

Dec 20th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function line(dlina)
  2.     for x = 1 , dlina do
  3.         if turtle.getItemCount() == 0 then
  4.             turtle.select(2)
  5.         end
  6.         turtle.turnRight()
  7.         turtle.placeDown()
  8.         turtle.turnLeft()
  9.         turtle.forward()
  10.     end
  11. end
  12.  
  13. function square(dlina)
  14.     for b = 1, 4 do
  15.         line(dlina)
  16.         turtle.turnRight()
  17.     end
  18. end
  19.  
  20. function cube(length,height)
  21.     for s = 1 , height do
  22.         square(length)
  23.         turtle.up()
  24.     end
  25. end
  26.  
  27. function pyramid(size)
  28.     squareSize = size
  29.     squareNum = math.ceil(size / 2)
  30.     for y = 1, squareNum do
  31.         square(squareSize)
  32.         turtle.forward()
  33.         turtle.turnRight()
  34.         turtle.up()
  35.         turtle.forward()
  36.         turtle.turnLeft()
  37.         squareSize = squareSize - 2
  38.     end
  39. end
  40.  
  41. function roof(size)
  42.     turtle.select()
  43.     pyramid(size)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement