question
typequestion is one fixed trivia entry.
Value
v0.question
round
typeround holds the mutable state of the currently open question.
Value
v0.round
questions
[]v0.question- OID
- 065c29…687f:4
questions details
current
*v0.round- OID
- 065c29…687f:35
current details
scores
*v0.Tree// addr(string) -> \*int, points across all rounds
- OID
- 065c29…687f:23
scores details
totalCorrect
int// lifetime count of correctly-answered questions
Value
0
init.6
func()- OID
- 065c29…687f:26
init.6 details
newRound
func(number int, height int64) *v0.roundnewRound builds a fresh round. The question index cycles through the fixed list, offset by a height-derived starting point so consecutive deploys don't all open on the same question.
- OID
- 065c29…687f:28
newRound details
questionIndex
func(number int, height int64) intquestionIndex maps a round number and a height (entropy source for the starting offset) to a slot in the questions slice. Deterministic and pure so it's easy to unit test.
- OID
- 065c29…687f:29
questionIndex details
Answer
func(choiceIdx int) stringAnswer submits a choice (0..3) for the current question. Crossing function: caller invokes as Answer(cross(cur), choiceIdx).
- OID
- 065c29…687f:30
Answer details
addScore
func(addr string)addScore bumps addr's lifetime point count.
- OID
- 065c29…687f:31
addScore details
scoreOf
func(addr string) int- OID
- 065c29…687f:32
scoreOf details
leaderboardEntry
typeleaderboardEntry is a snapshot row used only for rendering, sorted by score descending.
Value
v0.leaderboardEntry
leaderboard
func() []v0.leaderboardEntry- OID
- 065c29…687f:33
leaderboard details
Render
func(path string) stringRender produces the gnoweb Markdown view of the quiz.
- OID
- 065c29…687f:34