Treppen


SUBMITTED BY: Guest

DATE: Nov. 23, 2013, 4:59 p.m.

FORMAT: Text only

SIZE: 839 Bytes

HITS: 804

  1. http://cur.lv/4x9e0 (Earn Bitcoins)
  2. i = 0
  3. write "How many levels? : "
  4. a = read()
  5. a = tonumber(a)
  6. while i < a do
  7. turtle.digDown()
  8. turtle.down()
  9. while not turtle.forward() do
  10. turtle.dig()
  11. end
  12. turtle.digUp()
  13. while turtle.detectUp() do
  14. turtle.digUp()
  15. end
  16. while turtle.up()==false do
  17. turtle.digUp()
  18. end
  19. turtle.digUp()
  20. turtle.down()
  21. i = i+1
  22. end
  23. if not turtle.back() then
  24. turtle.turnLeft()
  25. turtle.turnLeft()
  26. turtle.dig()
  27. turtle.forward()
  28. else
  29. turtle.turnLeft()
  30. turtle.turnLeft()
  31. turtle.forward()
  32. end
  33. while i>0 do
  34. turtle.up()
  35. while not turtle.forward() do
  36. turtle.dig()
  37. end
  38. i = i-1
  39. end
  40. turtle.turnLeft()
  41. turtle.turnLeft()

comments powered by Disqus