Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. shell.run("clear")
  2. print("How many blocks forward?")
  3. front = tonumber(read()) - 1
  4.  
  5. shell.run("clear")
  6. print("How many blocks to the right?")
  7. right = tonumber(read()) - 1
  8.  
  9. shell.run("clear")
  10. print("Making platform please wait...")
  11.  
  12. turtle.select(1)
  13. turtle.forward()
  14. turtle.placeDown()
  15.  
  16. function line()
  17. for i=1,front do
  18. turtle.forward()
  19. turtle.placeDown()
  20. end
  21. end
  22.  
  23. function square()
  24. line()
  25. LR = 1
  26. for i=1,right do
  27. if LR == 1 then
  28. turtle.turnRight()
  29. turtle.forward()
  30. turtle.placeDown()
  31. turtle.turnRight()
  32. elseif LR == 2 then
  33. turtle.turnLeft()
  34. turtle.forward()
  35. turtle.placeDown()
  36. turtle.turnLeft()
  37. LR = 0
  38. end
  39. LR = LR + 1
  40. line()
  41. end
  42. end
  43.  
  44. square()
  45.  
  46. if LR == 1 then
  47. turtle.turnRight()
  48. turtle.turnRight()
  49.  
  50. for i=1,front do
  51. turtle.forward()
  52. end
  53. end
  54.  
  55. turtle.turnRight()
  56.  
  57. for i=1,right do
  58. turtle.forward()
  59. end
  60.  
  61. turtle.turnRight()
  62. turtle.back()
  63.  
  64. shell.run("clear")
  65. print("Done making the platform!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement