Advertisement
MaxBerz

zufall

Oct 5th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. sleep(1)
  2. local monitor = peripheral.wrap("top")
  3. for i = .5, 5, .5 do
  4. monitor.setTextScale(i)
  5. monitor.clear()
  6. end
  7.  
  8. monitor.setTextScale(.5)
  9.  
  10. maxx, maxy = monitor.getSize()
  11.  
  12. punkt = {}
  13. for spalte = 1, maxx do
  14. punkt[spalte] = {}
  15. for zeile = 1, maxy do
  16. punkt[spalte][zeile] = 0 --0=schwarz,1=weiss
  17. monitor.setCursorPos(spalte, zeile)
  18. monitor.setBackgroundColour( colours.black )
  19. -- monitor.write(" ")
  20. end
  21. end
  22. monitor.clear()
  23.  
  24. anzahl = 50 --Anzahl der sichtbaren Pixel
  25. xkoordinate = {}
  26. ykoordinate = {}
  27. for x = 1, anzahl do
  28. xkoordinate[x] = 1
  29. ykoordinate[x] = 1
  30. end
  31.  
  32. while true do
  33.  
  34. spalte = math.floor(math.random(1,maxx))
  35. zeile = math.floor(math.random(1,maxy))
  36. monitor.setCursorPos(spalte, zeile)
  37. monitor.setBackgroundColour( colours.white )
  38. monitor.write(" ")
  39. xkoordinate[1] = spalte
  40. ykoordinate[1] = zeile
  41. for x = anzahl, 2, -1 do
  42. xkoordinate[x] = xkoordinate[x - 1]
  43. ykoordinate[x] = ykoordinate[x - 1]
  44. end
  45. monitor.setCursorPos(xkoordinate[anzahl], ykoordinate[anzahl])
  46. monitor.setBackgroundColour( colours.black )
  47. monitor.write(" ")
  48. --[[
  49. if punkt[spalte][zeile] == 0 then
  50. monitor.setBackgroundColour( colours.white )
  51. punkt[spalte][zeile] = 1
  52. else
  53. monitor.setBackgroundColour( colours.black )
  54. punkt[spalte][zeile] = 0
  55. end
  56. --]]
  57.  
  58. sleep(.1)
  59.  
  60. end
  61.  
  62. --[[
  63.  
  64. ]]sleep(1)
  65. local monitor = peripheral.wrap("top")
  66. for i = .5, 5, .5 do
  67. monitor.setTextScale(i)
  68. monitor.clear()
  69. end
  70.  
  71. monitor.setTextScale(.5)
  72.  
  73. maxx, maxy = monitor.getSize()
  74.  
  75. punkt = {}
  76. for spalte = 1, maxx do
  77. punkt[spalte] = {}
  78. for zeile = 1, maxy do
  79. punkt[spalte][zeile] = 0 --0=schwarz,1=weiss
  80. monitor.setCursorPos(spalte, zeile)
  81. monitor.setBackgroundColour( colours.black )
  82. -- monitor.write(" ")
  83. end
  84. end
  85. monitor.clear()
  86.  
  87. anzahl = 50 --Anzahl der sichtbaren Pixel
  88. xkoordinate = {}
  89. ykoordinate = {}
  90. for x = 1, anzahl do
  91. xkoordinate[x] = 1
  92. ykoordinate[x] = 1
  93. end
  94.  
  95. while true do
  96.  
  97. spalte = math.floor(math.random(1,maxx))
  98. zeile = math.floor(math.random(1,maxy))
  99. monitor.setCursorPos(spalte, zeile)
  100. monitor.setBackgroundColour( colours.white )
  101. monitor.write(" ")
  102. xkoordinate[1] = spalte
  103. ykoordinate[1] = zeile
  104. for x = anzahl, 2, -1 do
  105. xkoordinate[x] = xkoordinate[x - 1]
  106. ykoordinate[x] = ykoordinate[x - 1]
  107. end
  108. monitor.setCursorPos(xkoordinate[anzahl], ykoordinate[anzahl])
  109. monitor.setBackgroundColour( colours.black )
  110. monitor.write(" ")
  111. --[[
  112. if punkt[spalte][zeile] == 0 then
  113. monitor.setBackgroundColour( colours.white )
  114. punkt[spalte][zeile] = 1
  115. else
  116. monitor.setBackgroundColour( colours.black )
  117. punkt[spalte][zeile] = 0
  118. end
  119. --]]
  120.  
  121. sleep(.1)
  122.  
  123. end
  124.  
  125. --[[
  126.  
  127. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement