Tanner235

build

Jan 22nd, 2022 (edited)
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. x = 10
  2. y = 10
  3. i = 0
  4. ii = 0
  5.  
  6. function build()
  7.     while(i < x) do
  8.         while(ii < y) do
  9.             ii = ii + 1
  10.             forward()
  11.         end
  12.         i = i + 1
  13.         if (i % 2 == 0) then
  14.             turnLeft()
  15.         else
  16.             turnRight()
  17.         end
  18.         ii = 0
  19.     end
  20. end
  21.  
  22.  
  23. function forward()
  24.     turtle.forward()
  25.     turtle.placeDown()
  26. end
  27.  
  28. function turnRight()
  29.     turtle.turnRight()
  30.     turtle.forward()
  31.     turtle.turnRight()
  32. end
  33.  
  34. function turnLeft()
  35.     turtle.turnLeft()
  36.     turtle.forward()
  37.     turtle.turnLeft()
  38. end
  39.  
  40.  
  41.  
  42. build()
Add Comment
Please, Sign In to add comment