wave.lua (456B)
1 #!/usr/bin/env lua 2 -- 3 -- Copy me if you can. 4 -- by parazyd 5 -- 6 7 local clock = os.clock 8 9 function sleep(n) -- seconds 10 local t0 = clock() 11 while clock() - t0 <= n do end 12 end 13 14 wave = 0 15 t = {"*","*","*","*","*"," ","+","+","+"," "} 16 17 while true do 18 print("") 19 for j = 1, math.floor(math.sin(wave)*50+50) do 20 io.write(" ") 21 end 22 for i = 1, 10 do 23 io.write(t[i]) 24 end 25 temp = t[1] 26 table.remove(t, 1) 27 table.insert(t, temp) 28 wave = wave + 0.1 29 sleep(0.025) 30 end