Skip to content

Instantly share code, notes, and snippets.

@BakermanLP
Created May 19, 2014 09:47
Show Gist options
  • Save BakermanLP/ff265e7f1050cdb4278a to your computer and use it in GitHub Desktop.
Save BakermanLP/ff265e7f1050cdb4278a to your computer and use it in GitHub Desktop.
-- 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