Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screen = peripheral.wrap('back')
- local fire = {}
- local w,h = screen.getSize()
- local max = math.ceil(h*0.5)
- for i=1, w do
- table.insert(fire, math.random(max))
- end
- while true do
- screen.clear()
- for i=1, #fire do
- local n = fire[i]
- if n >= max then
- fire[i] = 1
- else
- fire[i] = n + math.random(0,2)
- end
- n = fire[i]
- for y=1, n do
- screen.setCursorPos(i, h - n + y)
- screen.write('S')
- end
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment