Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cy = 0
- ax = 3
- az = 3
- ymax = 4
- ylocs = {}
- ----- functions
- function getColour(int)
- if int <= -5 then return colors.blue end
- if int == -4 then return colors.purple end
- if int == -3 then return colors.magenta end
- if int == -2 then return colors.cyan end
- if int == -1 then return colors.lightBlue end
- if int == 0 then return colors.pink end
- if int == 1 then return colors.yellow end
- if int == 2 then return colors.lime end
- if int == 3 then return colors.green end
- if int == 4 then return colors.brown end
- if int >= 5 then return colors.red end
- return colors.green
- end
- function moveUp()
- if cy ~= 0 then
- turtle.up()
- cy = cy + 1
- end
- end
- function moveDown()
- if not turtle.detectDown() then
- turtle.down()
- cy = cy - 1
- print(cy)
- end
- end
- function doStuff(xx)
- for yd = 1, ymax do
- if turtle.detectDown() then
- ylocs[xx] = cy
- else
- moveDown()
- end
- end
- for yu = cy, 0 do
- print(cy)
- moveUp()
- end
- end
- ----- code
- term.clear()
- term.setCursorPos(0,0)
- for xm = 1, ax do
- doStuff(xx)
- end
- for xp = 1, ax do
- term.setBackgroundColor(getColour(ylocs[xp]))
- term.setCursorPos(xp,0)
- print (" ")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement