Advertisement
Guest User

home

a guest
Jul 24th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. local robot = require("robot")
  2. local comp = require("computer")
  3.  
  4. function certus()
  5. robot.select(1)
  6. if  robot.count(1)==0 then return "false"
  7. end
  8. end
  9.  
  10. function glass()
  11.   for i=2,8 do
  12.   robot.select(i)
  13.     if robot.count(i) ~= 0 then break
  14.     elseif i == 8 then return "false"
  15.     end
  16.   end
  17. end
  18.  
  19. function gran()
  20. for i=9,16 do
  21. robot.select(i)
  22.     if robot.count(i) ~= 0 then break
  23.     elseif i == 16 then return "false"
  24.     end
  25.   end
  26. end
  27.  
  28. function zone()
  29.  for i=1,4 do
  30.   for i=1,31 do
  31.    gran()
  32.    robot.placeDown()
  33.    robot.forward()
  34.   end
  35.   robot.turnRight()
  36.  end
  37. end
  38.  
  39. function wall()
  40. for i=1,4 do
  41.  
  42. for i=1,2 do
  43. glass()
  44. robot.placeDown()
  45. robot.forward()
  46. end
  47.  
  48. gran()
  49. robot.placeDown()
  50. robot.forward()
  51. certus()
  52. robot.placeDown()
  53. robot.forward()
  54. gran()
  55. robot.placeDown()
  56. robot.forward()
  57.  
  58. for i=1,5 do
  59. for i=1,2 do
  60. glass()
  61. robot.placeDown()
  62. robot.forward()
  63. end
  64. for i=1,2 do
  65. gran()
  66. robot.placeDown()
  67. robot.forward()
  68. end
  69. end
  70.  
  71. for i=1,2 do
  72. glass()
  73. robot.placeDown()
  74. robot.forward()
  75. end
  76.  
  77. gran()
  78. robot.placeDown()
  79. robot.forward()
  80. certus()
  81. robot.placeDown()
  82. robot.forward()
  83. gran()
  84. robot.placeDown()
  85. robot.forward()
  86.  
  87. glass()
  88. robot.placeDown()
  89. robot.forward()
  90. robot.turnRight()
  91. end
  92. end
  93.  
  94. for i=1,4 do
  95. robot.up()
  96. wall()
  97. end
  98. robot.up()
  99. zone()
  100. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement