The itch
For my last birthday, my lovely girlfriend made a full trivia game for my birthday. She did such a great job balancing making it unique to me, without making anyone who doesn't know me too well feel like an outsider. I hope for this project to emulate the gift she made for me. It is one of the better gifts I've ever gotten, and I wanted to share it with others.
How a game works
- The TV shows the board and a QR code. Each team scans it with one phone and names itself.
- The host's phone picks clues, sees the answers, and judges. The host doesn't play.
- Team phones get the clue and an answer box. It isn't a race: teams talk it over and lock in an answer before the timer runs out, or the host stops the clock and lets them argue.
- Every correct team scores, wrong answers cost nothing, and a final round lets teams wager.
Making a board
Building. An agent interviews you about the guest of honor, following threads until it finds six categories with real trivia behind them (not "running," but which races). Then seven writers run in parallel, one per category plus the final, each checking every fact with web search and citing a source. You can re-roll any clue or edit it by hand. The agent is written; it's waiting on an AWS sign-up so it can run.
Until then, there's a board editor for writing one by hand, and a sample board to play.
How it works
The game rules are one pure function: give it the game and an action ("open this clue," "team B answered"), and it returns the new game. The same function runs in the tests, on my laptop, and in the Lambda, so the rules are written once.
Rooms run on an API Gateway WebSocket API. Each message wakes a Lambda that loads the room from DynamoDB, applies the action, and pushes each device its own view. The TV and teams never receive an answer before the reveal, even in the page data. Two teams answering in the same instant can't overwrite each other: every save checks the room's version first and retries if someone beat it.