Batponney

CC/Tunnel

Apr 13th, 2021 (edited)
456
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. square=arg[1]
  2. lenght=arg[2]
  3.  
  4. up=true
  5.  
  6. function checkPair(chiffre)
  7.     if chiffre%2 == 0 then
  8.         return true
  9.     else
  10.         return false
  11.     end
  12. end
  13.  
  14. function Launch()
  15.     while not turtle.forward() do
  16.         turtle.dig()
  17.     end
  18.     turtle.turnRight()
  19. end
  20.  
  21. function mine_line(travel)
  22.     for j=1,travel-1 do
  23.         turtle.dig()
  24.         turtle.forward()
  25.     end
  26. end
  27.  
  28. function LeftOrRight(Side)
  29.     if Side then
  30.         if Side == "Left" then
  31.             turtle.turnLeft()
  32.             turtle.dig()
  33.             turtle.forward()
  34.             turtle.turnLeft()
  35.         elseif Side == "Right" then
  36.             turtle.turnRight()
  37.             turtle.dig()
  38.             turtle.forward()
  39.             turtle.turnRight()
  40.         end
  41.     end
  42. end
  43.  
  44. function UpOrDown(upordown)
  45.     if upordown then
  46.         if upordown == "Up" then
  47.             turtle.turnRight()
  48.             turtle.digUp()
  49.             turtle.turnRight()
  50.             turtle.up()
  51.         elseif upordown == "Down" then
  52.             turtle.turnLeft()
  53.             turtle.digDown()
  54.             turtle.down()
  55.             turtle.turnLeft()
  56.         end
  57.     end
  58. end
  59.  
  60. function destroy1Layer(SizeS)
  61.     for k=1,SizeS-1 do
  62.         mine_line(SizeS)
  63.         if up then
  64.             UpOrDown("Up")
  65.         else
  66.             UpOrDown("Down")
  67.         end
  68.     end
  69.     mine_line(SizeS)
  70. end
  71.  
  72. function destroyAllLayer(xy,h)
  73.     for i=1,h-1 do
  74.             destroy1Layer(xy)
  75.             if checkPair(xy) then
  76.                 if up then
  77.                     LeftOrRight("Right")
  78.                     up=false
  79.                 else
  80.                     LeftOrRight("Left")
  81.                     up=true
  82.                 end
  83.             else
  84.                 if up then
  85.                     LeftOrRight("Left")
  86.                     up=false
  87.                 else
  88.                     LeftOrRight("Right")
  89.                     up=true
  90.                 end
  91.             end
  92.     end
  93.     destroy1Layer(xy)
  94. end
  95.  
  96. Launch()
  97. destroyAllLayer(square,lenght)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×