Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cy = 0
- ax = 2
- az = 2
- ymax = 40
- ylocs = {}
- ----- functions
- function getColour(int)
- if int <= -10 then return colors.blue end
- if int == -9 then return colors.purple end
- if int == -8 then return colors.magenta end
- if int == -7 then return colors.cyan end
- if int == -6 then return colors.lightBlue end
- if int == -5 then return colors.pink end
- if int == -4 then return colors.yellow end
- if int == -3 then return colors.lime end
- if int == -2 then return colors.green end
- if int == -1 then return colors.brown end
- if int == 0 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
- end
- end
- function doStuff(xx, zz)
- for yd = 1, ymax do
- if turtle.detectDown() then
- if ylocs[xx] == nil then
- ylocs [xx] = {}
- end
- table.insert(ylocs[xx],xx,zz)
- -- ylocs[xx] = {[zz] = cy}
- else
- moveDown()
- end
- end
- for yu = cy, 0 do
- moveUp()
- end
- end
- ----- code
- term.clear()
- term.setCursorPos(1,1)
- for zz = 1, az do
- for xx = 1, ax do
- turtle.forward()
- doStuff(xx,zz)
- -- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- for xx = 1, ax do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- print(ylocs)
- for x2 = 1, ax do
- for z2 = 1, az do
- --print("works")
- --print(x2)
- --print("-")
- --print(z2)
- --print("---")
- --print(ylocs[1][1])
- --print(ylocs[1][2])
- term.setBackgroundColor(getColour(ylocs[x2][z2]))
- term.setCursorPos(z2, x2)
- term.print(" ")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement