Advertisement
CaptainSpaceCat

CC Screensaver

May 16th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. w, h = term.getSize()
  2. term.clear()
  3. count = 0
  4. colors = {}
  5.  
  6. --initialize colors--
  7. for i = 0, 15 do
  8.   colors[i] = 2 ^ i
  9. end
  10.  
  11. --==PROGRAM START==--
  12. while true do
  13.   x = math.random(1, w)
  14.   y = math.random(1, h)
  15.   color = colors[math.random(0, 15)]
  16.   paintutils.drawPixel(x, y, color)
  17.   count = count + 1
  18.   if count > 100 then
  19.     count = 0
  20.     sleep(.1)
  21.   end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement