Advertisement
Guest User

matrica

a guest
Feb 23rd, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. local event = require("event")
  2. local gpu = require("component").gpu
  3.  
  4. ------------------------------------------------------------------------------------------------------------
  5.  
  6. local maximumLines = 60
  7. local minimumLineLength = 5
  8. local maximumLineLength = 55
  9.  
  10. local chars = { "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ", "カ", "ガ", "キ", "ギ", "ク", "グ", "ケ", "ゲ", "コ", "ゴ", "サ", "ザ", "シ", "ジ", "ス", "ズ", "セ", "ゼ", "ソ", "ゾ", "タ", "ダ", "チ", "ヂ", "ッ", "ツ", "ヅ", "テ", "デ", "ト", "ド", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "バ", "パ", "ヒ", "ビ", "ピ", "フ", "ブ", "プ", "ヘ", "ベ", "ペ", "ホ", "ボ", "ポ", "マ", "ミ", "ム", "メ", "モ", "ャ", "ヤ", "ュ", "ユ", "ョ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ヮ", "ワ", "ヰ", "ヱ", "ヲ", "ン", "ヴ", "ヵ", "ヶ", "・", "ー", "ヽ", "ヾ" }
  11. local lineColorsForeground = { 0xFFFFFF, 0xBBFFBB, 0x88FF88, 0x33FF33, 0x00FF00, 0x00EE00, 0x00DD00, 0x00CC00, 0x00BB00, 0x00AA00, 0x009900, 0x008800, 0x007700, 0x006600, 0x005500, 0x004400, 0x003300, 0x002200, 0x001100 }
  12. local lineColorsBackground = { 0x004400, 0x004400, 0x003300, 0x003300, 0x002200, 0x001100 }
  13.  
  14. local charsSize = #chars
  15. local lineColorsForegroundSize = #lineColorsForeground
  16.  
  17. ------------------------------------------------------------------------------------------------------------
  18.  
  19. local screenWidth, screenHeight = gpu.getResolution()
  20. local lines = {}
  21. local currentBackground, currentForeground
  22.  
  23. ------------------------------------------------------------------------------------------------------------
  24.  
  25. local function setBackground(color)
  26. if currentBackground ~= color then
  27. gpu.setBackground(color)
  28. currentBackground = color
  29. end
  30. end
  31.  
  32. local function setForeground(color)
  33. if currentForeground ~= color then
  34. gpu.setForeground(color)
  35. currentForeground = color
  36. end
  37. end
  38.  
  39. local function clearScreen()
  40. setBackground(0x000000)
  41. setForeground(0xFFFFFF)
  42. gpu.fill(1, 1, screenWidth, screenHeight, " ")
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement