Cartório Simulator

A daily browser game about Brazilian bureaucracy: get one stamp before lunch. Every day's chain is generated from a seed, solvable by construction, and checked by a solver over 10,000 days in the test suite.

The cartório hall: five windows, their lines and the ticket board
Overview

Cartório Simulator is a free daily browser game, in English and Portuguese, on desktop and phone: get one document stamped at a Brazilian cartório before the windows close for lunch. Window 3 says you need Form 27-B, Form 27-B needs a copy, the copy must be authenticated at Window 4, and Window 4 goes to lunch in 40 seconds. You take a ticket, queue, fill in forms where every form has a trap, get sent back and try again, then paste your result: time, forms, send-backs and your path through the windows. The game is a pure function of a seed and the player's inputs. A seeded generator builds a dependency graph of documents backwards from the day's goal, so every chain is solvable by construction. A discovery solver that plays like a careful first-time player runs over 10,000 consecutive days plus 500 random seeds on every test run and checks that each one finishes within a 6-minute fairness bound; the seed report puts the median at 1:18. Windows, queues, lunch breaks and the 30× cartório clock are state machines advanced in fixed ticks, so the run saved in localStorage is just a list of ticks and actions, and replaying it rebuilds the exact state: a bug report is a date plus that log. The hall is drawn on a canvas, and the paper (forms, ticket, folder, stamps) is real HTML form controls, playable with a keyboard and a screen reader and readable on a phone. Pure game logic lives in its own folder with no DOM, the bundle is held under 200 KB by the check script, and GitHub Actions runs the checks and a Playwright smoke test on every push and deploys to GitHub Pages.

Highlights
The whole game is a pure function of a seed and the player's inputs: a run is replayed exactly from an input log
Seeded generator that builds a document dependency graph backwards from the goal, solvable by construction
Property tests run a solver over 10,000 consecutive days plus 500 random seeds and enforce a 6-minute fairness bound
Windows, queues, lunch breaks and a 30× clock as state machines advanced in fixed ticks
Forms are real HTML form controls, playable by keyboard and screen reader, in English and Portuguese
Bundle held under 200 KB, Playwright smoke test and deploy to GitHub Pages on every push
Technologies
TypeScriptCanvasViteVitestProperty-based testingPlaywrightGitHub Actions

Hiring a senior full-stack engineer? Let's talk.