Advertisement
Guest User

static

a guest
Mar 16th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. function static()
  2. term.clear()
  3.  
  4. x,y = term.getSize()
  5.  
  6.  
  7. for i=1,x do
  8. posx = i
  9.  
  10. for i=1,y do
  11. posy = i
  12. chance = math.random(0,1)
  13. if chance == 1 then
  14. term.setCursorPos(posx,posy)
  15. write("#")
  16. end
  17.  
  18. end
  19. end
  20.  
  21. end
  22.  
  23.  
  24.  
  25. function slowStatic()
  26. while true do
  27. static()
  28. sleep(0.75)
  29. end
  30. end
  31.  
  32. function fastStatic()
  33. while true do
  34. static()
  35. sleep(0.02)
  36. end
  37. end
  38.  
  39.  
  40.  
  41. term.clear()
  42. print("slow or fast?")
  43. answer = read()
  44.  
  45.  
  46. if answer == "slow" then
  47. slowStatic()
  48.  
  49.  
  50. elseif answer == "fast" then
  51. fastStatic()
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement