Platon777

Untitled

Aug 31st, 2024
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- 0 - air
  2. -- 1 - black
  3. -- 2 - red
  4.  
  5. --
  6.  
  7.  
  8. function buildLine(line)
  9.     for element = 1,#line do
  10.         slot = line[element]
  11.         if slot ~= 0 then
  12.         turtle.select(slot)
  13.         turtle.placeDown()
  14.        end
  15.         turtle.forward()
  16.     end
  17.  
  18.     for w = 1,#line do
  19.         turtle.back()
  20.     end
  21. end
  22.  
  23. function buildImage(image)
  24.     for stroka = 1,#image do
  25.         buildLine(image[stroka])
  26.         turtle.turnRight()
  27.         turtle.forward()
  28.         turtle.turnLeft()
  29.     end
  30.     turtle.turnLeft()
  31.     for stroka = 1,#image do
  32.         turtle.forward()
  33.        end
  34.     turtle.turnRight()
  35.     turtle.up()
  36. end
  37. art = {
  38.      {1,2,2,1},
  39.      {2,0,0,2},
  40.      {2,0,0,2},
  41.      {1,2,2,1},
  42. }
  43.  
  44. buildImage(art)
  45. art2 = {
  46.      {2,0,0,2},
  47.      {0,0,0,0},
  48.      {0,0,0,0},
  49.      {2,0,0,2},
  50. }
  51. buildImage(art2)
  52. art2 = {
  53.      {2,0,0,2},
  54.      {0,0,0,0},
  55.      {0,0,0,0},
  56.      {2,0,0,2},
  57. }
  58. buildImage(art2)
  59. art = {
  60.      {1,2,2,1},
  61.      {2,0,0,2},
  62.      {2,0,0,2},
  63.      {1,2,2,1},
  64. }
  65. buildImage(art)
  66.  
  67. buildImage(art)
  68. buildImage(art2)
  69. buildImage(art2)
  70. buildImage(art)
  71.  
  72. buildImage(art)
  73. buildImage(art2)
  74. buildImage(art2)
  75. buildImage(art)
Advertisement
Add Comment
Please, Sign In to add comment