Created
May 19, 2014 09:47
-
-
Save BakermanLP/ff265e7f1050cdb4278a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- mplayer.lua | |
-- Player for ascii art animations | |
local BUFSIZE = 2^13 -- 8K | |
local f = io.input("/mnt/ef5/don-quijote") -- open input file | |
term = require("term") | |
term.clear() | |
local count = 1 | |
local frame = 1 | |
while true do | |
local line = io.read() | |
if line == nil then break end | |
if tonumber(line) == nil then | |
term.setCursor(1,count) | |
term.write(line) | |
else | |
tosleep=line * 0.055 | |
os.sleep(tosleep) | |
frame=frame+1 | |
count=0 | |
term.clear() | |
end | |
count = count + 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment