Ledger Nano X - The secure hardware wallet
SHARE
TWEET

CC Turtle Tree Farm

a guest Mar 29th, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function start()
  2.     moveFw(3);
  3.    
  4.     turtle.turnRight()
  5.     moveFw(1);
  6.    
  7.     for i=2, 4 do
  8.         if(i%2 == 0) do
  9.             turtle.turnLeft()
  10.             moveFw(4);
  11.             turtle.turnLeft();
  12.     end
  13.         else
  14.             turtle.turnRight()
  15.             moveFw(4);
  16.             turtle.turnRight();
  17.         end
  18.         plantRow()
  19.     end
  20. end
  21.  
  22. function plantRow()
  23.     placeTree()
  24.  
  25.     for i=1, 3 do
  26.         moveFw(3);
  27.         placeTree()
  28.     end
  29.     moveFw(1);
  30. end
  31.  
  32. function moveFw(distance)
  33.     if distance ~= nil then
  34.         distance = tonumber (distance) -- make it a number
  35.         for i = 1, distance do
  36.             turtle.forward()
  37.         end
  38.     else
  39.         print ("Did not specify distance.")
  40.     end
  41. end
  42. function placeTree()
  43.     turtle.forward()
  44.     turtle.select(3)
  45.     turtle.place(Sapling)
  46.     turtle.forward()
  47.     turtle.select(4)
  48.     turtle.place(Torch)
  49. end
  50.  
  51.  
  52. function refuel()
  53.     turtle.select(16)
  54.     turtle.refuel(20)
  55. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top