hevohevo

CC: tofu7

Mar 3rd, 2016
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. -- tofu7
  2. --  surround four directions with walls
  3.  
  4. -- ####### Define a function ########
  5. function place4Blocks()
  6.   for i=1,4 do
  7.     turtle.forward()  -- move to next position
  8.     turtle.placeDown()  -- put a block in the ground
  9.   end
  10. end
  11.  
  12.  
  13. -- ###### Main ########
  14. turtle.select(1) -- the usual phrase
  15.  
  16. turtle.up()  -- move up
  17.  
  18. -- stack six squares
  19. for ronoji=1,6 do
  20.   -- 1st stage is made with slot 1, 2nd stage is slot 2, ...
  21.   turtle.select(ronoji)
  22.  
  23.   -- make 4 sides of a square
  24.   for hen=1,4 do
  25.    place4Blocks()  -- put 4 blocks in the ground
  26.     turtle.turnRight()  -- turn 90 degrees to the right
  27.   end
  28.  
  29.   turtle.up()  -- move up
  30. end
Add Comment
Please, Sign In to add comment