Advertisement
Guest User

Untitled

a guest
May 29th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. cy = 0
  2. ax = 3
  3. az = 3
  4. ymax = 4
  5.  
  6. ylocs = {}
  7. ----- functions
  8. function getColour(int)
  9. if int <= -5 then return colors.blue end
  10. if int == -4 then return colors.purple end
  11. if int == -3 then return colors.magenta end
  12. if int == -2 then return colors.cyan end
  13. if int == -1 then return colors.lightBlue end
  14. if int == 0 then return colors.pink end
  15. if int == 1 then return colors.yellow end
  16. if int == 2 then return colors.lime end
  17. if int == 3 then return colors.green end
  18. if int == 4 then return colors.brown end
  19. if int >= 5 then return colors.red end
  20. return colors.green
  21. end
  22.  
  23. function moveUp()
  24. if cy ~= 0 then
  25. turtle.up()
  26. cy = cy + 1
  27. end
  28. end
  29.  
  30. function moveDown()
  31. if not turtle.detectDown() then
  32. turtle.down()
  33. cy = cy - 1
  34. print(cy)
  35. end
  36. end
  37.  
  38. function doStuff(xx)
  39. for yd = 1, ymax do
  40. if turtle.detectDown() then
  41. ylocs[xx] = cy
  42. else
  43. moveDown()
  44. end
  45. end
  46. for yu = cy, 0 do
  47. print(cy)
  48. moveUp()
  49. end
  50. end
  51. ----- code
  52. term.clear()
  53. term.setCursorPos(0,0)
  54. for xm = 1, ax do
  55. doStuff(xx)
  56. end
  57. for xp = 1, ax do
  58. term.setBackgroundColor(getColour(ylocs[xp]))
  59. term.setCursorPos(xp,0)
  60. print (" ")
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement