Advertisement
Guest User

gpu_test.lua

a guest
Aug 17th, 2016
927
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3. local gpu = component.gpu;
  4.  
  5. local w, h = gpu.getResolution()
  6. local running = false
  7.  
  8. local function main()
  9.   for offset = 5, 1000, 5 do
  10.     for i = 0, w do
  11.       for j = 0, h do
  12.         gpu.setForeground((i * j) * offset) --dunno if that will work
  13.         gpu.set(i, j, tostring((i * j) * offset))
  14.       end
  15.     end
  16.  
  17.     gpu.setForeground(0xFFFFFF);
  18.     gpu.set(1, 1, "Mash CTRL+C to exit")
  19.  
  20.     local event = event.pull()
  21.    
  22.     if event == "interrupted" then
  23.       break
  24.     end
  25.  
  26.     os.sleep(1)
  27.   end
  28.   gpu.setForeground(0xFFFFFF)
  29. end
  30.  
  31. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement