Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ####--------------------------------####
- #--# Author: by uriid1 #--#
- #--# License: GNU GPLv3 #--#
- #--# Telegram: @main_moderator #--#
- #--# E-mail: appdurov@gmail.com #--#
- ####--------------------------------####
- --]]
- local function printl(...)
- io.stdout:write(...)
- end
- local function sleep(t)
- local sec = tonumber(os.clock() + t)
- while os.clock() < sec do
- end
- end
- local function clear()
- io.stdout:write('\027\091\072\027\091\050\074\027\091\051\074')
- end
- local term = {
- w = 64;
- h = 25;
- }
- local sin_map = {}
- for y = 1, term.h do
- sin_map[y] = {}
- for x = 1, term.w do
- sin_map[y][x] = 0
- end
- end
- local new_x = 0
- while true do
- local sin_step = 0
- for y = 1, #sin_map do
- for x = 1, #sin_map[1] do
- sin_step = sin_step + (math.pi/8)
- local sin_wave = math.sin(sin_step + new_x) + #sin_map/2
- if sin_map[math.ceil(sin_wave)] then
- sin_map[math.ceil(sin_wave)][x] = 1
- end
- end
- end
- new_x = new_x + 1
- for y = 1, #sin_map do
- for x = 1, #sin_map[1] do
- if sin_map[y][x] == 1 then
- printl('+')
- else
- printl(' ')
- end
- end
- printl('\n')
- end
- for y = 1, #sin_map do
- for x = 1, #sin_map[1] do
- sin_map[y][x] = 0
- end
- end
- clear()
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement