Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. local rows, cols, height
  2.  
  3. term.clear()
  4. print("Please ensure the Turtle is located in the bottom left corner.")
  5. textutils.slowPrint(" ")
  6.  
  7. print("How many rows?")
  8. rows = tonumber(io.read())
  9. print("How many columns?")
  10. cols = tonumber(io.read())
  11. print("How tall?")
  12. height = tonumber(io.read())
  13.  
  14. turtle.refuel()
  15.  
  16. for h = 1, height do
  17. for c = 1, cols do
  18. for r =1, rows do
  19. if turtle.detectFoward() then
  20. turtle.dig()
  21. end
  22. turtle.forward()
  23. end
  24. turtle.turnLeft()
  25. if r ~= rows then
  26. if turtle.detectForward() then
  27. turtle.dig()
  28. end
  29. turtle.forward()
  30. end
  31. turtle.turnLeft()
  32. end
  33. if turtle.detectUp() then
  34. turtle.digUp()
  35. end
  36. turtle.up()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement