Advertisement
Guest User

test

a guest
May 28th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. ypos = {}
  2. maxY = 3
  3. cy = 0
  4.  
  5. function doStuff(xx)
  6.   for ymax = 1, maxY do
  7.     if turtle.detectDown() then
  8.       ypos[xx] = {cy, cy, cy}
  9.       for cy = cy, 0 do
  10.         turtle.up()
  11.         cy = cy +1
  12.         if cy == 0 then
  13.           turtle.forward()
  14.           cy = cy -1
  15.         end
  16.       end
  17.     else
  18.       turtle.down()
  19.       cy = cy -1
  20.     end
  21.   end
  22. end
  23.  
  24. function getColour(int)
  25.   if int <= -5 then return colors.blue end
  26.   if int == -4 then return colors.purple end
  27.   if int == -3 then return colors.magenta end
  28.   if int == -2 then return colors.cyan end
  29.   if int == -1 then return colors.lightBlue end
  30.   if int == 0  then return colors.pink end
  31.   if int == 1  then return colors.yellow end
  32.   if int == 2  then return colors.lime end
  33.   if int == 3  then return colors.green end
  34.   if int == 4  then return colors.brown end
  35.   if int >= 5  then return colors.red end
  36.   return colors.green
  37. end
  38.  
  39. term.clear()
  40. term.setCursorPos(0,0)
  41. for xx = 1, 3 do
  42.   doStuff(xx)
  43. end
  44. for xx = 1, 3 do
  45.   for zz = 1, 3 do
  46.     term.setBackgroundColor(getColour(ypos[xx][zz]))
  47.     term.setCursorPos(xx,zz)
  48.     print (" ")
  49.   end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement