This commit is contained in:
Ray Elliott 2026-10-28 20:04:29 +00:00
commit 948de94e95
3 changed files with 147 additions and 13 deletions

View file

@ -14,10 +14,18 @@ name question answer
- `question` is displayed on shell startup.
- `answer` is displayed by running `answerpls` in that terminal.
Run `refreshpls` to advance to another question before the next calendar day.
`answerpls` then displays the answer to the newly shown question. Refreshing is
persisted under `$XDG_STATE_HOME/bash` (or `~/.local/state/bash` when that
variable is unset), so new terminals show the refreshed question for the rest
of that calendar day. The normal daily selection takes over again the following
day.
The file has no header or comments. Empty fields, duplicate names and malformed
rows are errors.
Bash selects one entry deterministically from the local calendar date. Every
terminal opened on the same day therefore shows the same question without
requiring a state file. Editing the bank may change which question maps to a
given date.
Bash works through a persisted, randomly shuffled deck. Each question appears
once before the deck is shuffled again, and a new deck does not begin with the
question that ended the previous one. The deck advances on a new calendar day
or when `refreshpls` is run, while every terminal opened on the same day shows
the current persisted question. Editing the bank starts a newly shuffled deck.