Advertisement
rerere284

static

Mar 16th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
  53.  
  54. function otherFastStatic()
  55. while true do
  56. term.clear()
  57.  
  58. x,y = term.getSize()
  59.  
  60.  
  61. for i=1,x do
  62. posx = i
  63.  
  64. for i=1,y do
  65. posy = i
  66. chance = math.random(0,1)
  67. if chance == 1 then
  68. term.setCursorPos(posx,posy)
  69. write("#")
  70. end
  71.  
  72. end
  73. end
  74. sleep(0.02)
  75. end
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement