Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- codes = {}
- function randGreen()
- local a = math.random(1,2)
- if a == 1 then
- return colors.lime
- elseif a == 2 then
- return colors.green
- end
- end
- function newCode()
- local template = {
- x = math.random(1,51),
- size = math.random(1,4),
- y = 0,
- color = randGreen()
- }
- template.y = 1 - template.size
- table.insert(codes,template)
- end
- function increment(one,two)
- if one > two then
- return -1
- elseif one < two then
- return 1
- end
- end
- function drawLine(sX,sY,eX,eY,tColor,bColor)
- paintutils.drawLine(sX,sY,eX,eY,bColor)
- term.setCursorPos(sX,sY)
- for i=sY,eY,increment(sY,eY) do
- term.setCursorPos(sX,i)
- term.setTextColor(tColor)
- term.write(string.char(math.random(33,126)))
- end
- end
- function redraw()
- term.setBackgroundColor(colors.black)
- term.clear()
- for i,v in pairs(codes) do
- v.y = v.y + 1
- drawLine(v.x,v.y,v.x,v.y+v.size,colors.black,v.color)
- if v.y > 19 then
- table.remove(codes,i)
- end
- end
- end
- while true do
- for i=1,3 do
- newCode()
- end
- redraw()
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement