summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--beescroll.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/beescroll.lua b/beescroll.lua
index aca7916..8257081 100644
--- a/beescroll.lua
+++ b/beescroll.lua
@@ -69,13 +69,28 @@ local function slow_write(m,s)
end
end
+local function slow_write_f(m, t)
+ for _,val in ipairs(t) do
+ if type(val) == "string" then
+ slow_write(m,val)
+ else
+ m.setTextColor(val)
+ end
+ end
+end
+
+local norm_color = colors.gray
+
while true do
local x = math.random(0,99999)
m.scroll(1)
m.setCursorPos(1,H)
- slow_write(m, ("%5d bees have been %s in %s."):format(
- x, choice(verbs), choice(cities)
- ))
+ slow_write_f(mon, {
+ colors.white, string.format("%5d",math.random(0,99999)),
+ norm_color, " bees ", choice{"have been ","were "},
+ colors.lime, choice(verbs),
+ norm_color, " in ", colors.lightBlue, choice(cities),
+ norm_color, "."})
os.sleep(1)
end