Advertisement
Spirit13300

Untitled

May 21st, 2020
1,311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. function turnL()
  2.     turtle.turnLeft()
  3.     go()
  4.     go()
  5.     go()
  6.     turtle.turnLeft()
  7. end
  8.  
  9. function turnR()
  10.     turtle.turnRight()
  11.     go()
  12.     go()
  13.     go()
  14.     turtle.turnRight()
  15. end
  16.  
  17. function go()
  18.     turtle.dig()
  19.     turtle.forward()
  20.     turtle.digUp()
  21.     turtle.digDown()
  22. end
  23.  
  24. function repete(rep,rep2)
  25.     cpt = 0
  26.     while (rep2>cpt) do
  27.         for i=1,rep do
  28.             go()
  29.         end
  30.         turnL()
  31.         for i=1,rep do
  32.             go()
  33.         end
  34.         turnR()
  35.         cpt = cpt+1
  36.     end
  37. end
  38.  
  39.  
  40.  
  41. print("combien de longueur voulez vous ?")
  42. rep = read()
  43. rep = rep+0  -- mise en int
  44.  
  45. print("combien de couloir voulez vous ?")
  46. rep2 = read()
  47. rep2 = rep2+0
  48.  
  49.  
  50. repete(rep,rep2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement