summaryrefslogtreecommitdiff
path: root/beescroll.lua
diff options
context:
space:
mode:
Diffstat (limited to 'beescroll.lua')
-rw-r--r--beescroll.lua33
1 files changed, 25 insertions, 8 deletions
diff --git a/beescroll.lua b/beescroll.lua
index 547aa11..674288c 100644
--- a/beescroll.lua
+++ b/beescroll.lua
@@ -79,13 +79,20 @@ local function slow_write_f(m, t)
end
end
-local norm_color = colors.gray
+local function write_f(m,t)
+ for _,val in ipairs(t) do
+ if type(val) == "string" then
+ m.write(val)
+ else
+ m.setTextColor(val)
+ end
+ end
+end
-while true do
- local x = math.random(0,99999)
- m.scroll(1)
- m.setCursorPos(1,H)
- slow_write_f(m, {
+
+local norm_color = colors.gray
+local function make_entry()
+ return {
choice{colors.yellow, colors.red, colors.cyan},
string.format("%5d",math.random(0,99999)),
norm_color, " bees ", choice{"have been ","were "},
@@ -94,7 +101,17 @@ while true do
norm_color, " in ",
choice{colors.orange, colors.yellow, colors.purple},
choice(cities),
- norm_color, "."})
- os.sleep(1)
+ norm_color, "."}
+end
+for _ = 1,H do
+ m.scroll(1)
+ m.setCursorPos(1,H)
+ write_f(m,make_entry())
+end
+while true do
+ m.scroll(1)
+ m.setCursorPos(1,H)
+ slow_write_f(m, make_entry())
+ os.sleep(math.random(5,100)/10)
end