Guest User

f

a guest
Aug 29th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. mon.setBackgroundColor(colors.black)
  3. mon.clear()
  4.  
  5. function BoxL (xmin,xmax,ymin,ymax,rows,color1,color2)
  6.   local currColor = color1
  7.   for k = 0,rows do
  8.     if currColor == color1 then
  9.       currColor = color2
  10.       mon.setBackgroundColor(currColor)
  11.     else
  12.       currColor = color1
  13.       mon.setBackgroundColor(currColor)
  14.     end
  15.     for i = xmin,xmax do
  16.       for j = ymin,ymax do
  17.         mon.setCursorPos(i,j)
  18.         mon.write(" ")
  19.       end
  20.       i = i + 1
  21.     end
  22.     k = k + 1
  23.     mon.setBackgroundColor(colors.black)
  24.   end
  25. end
  26.  
  27. BoxL(1,20,1,2,2,colors.red,colors.blue)
Advertisement
Add Comment
Please, Sign In to add comment