Advertisement
JMZ10

Flash

Jan 23rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local n = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
  2.  
  3. function change(num)
  4.     c = colors.black
  5.  
  6.     if num == 1 then
  7.         c = colors.white
  8.     elseif num == 2 then
  9.         c = colors.orange
  10.     elseif num == 3 then
  11.         c = colors.yellow
  12.     elseif num == 4 then
  13.         c = colors.lime
  14.     elseif num == 5 then
  15.         c = colors.pink
  16.     elseif num == 6 then
  17.         c = colors.cyan
  18.     elseif num == 7 then
  19.         c = colors.purple
  20.     elseif num == 8 then
  21.         c = colors.blue
  22.     elseif num == 9 then
  23.         c = colors.red
  24.     elseif num == 10 then
  25.         c = colors.lightGray
  26.     end
  27.  
  28.     term.setBackgroundColor(c)
  29.     term.clear()
  30. end
  31.  
  32. while true do
  33.     change(math.random(1, #n))
  34.     sleep(0.5)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement