# Tentai Show — every deduction happens twice Tentai Show (Spiral Galaxies, 天体ショー) in the browser, with the solver's four rule sets built in. Divide the grid into regions, one per dot, so that every region **contains its dot, is connected, and maps onto itself under a 180° turn about that dot**. Dots sit on cell centres, edge midpoints, or lattice points. The whole puzzle is one map. Track dots in doubled coordinates — cell (r, c) has its centre at (2r+1, 2c+1) — and the twin of a cell through dot (cy, cx) is `(cy − r − 1, cx − c − 1)`, always a whole cell, whatever the dot type. Every rule in the solver is a sentence about a cell and its twin under that map, and the candidate sets stay perfectly 180°-symmetric about their dots through the entire rule ladder: prune a cell on one side of a dot and its twin falls in the same round. Deductions here happen twice or not at all. ## Rule sets | level | rule | |---|---| | `mirror` | a cell and its twin through a dot stand or fall together — in both directions: a dead twin kills the cell, a pinned cell pins its twin | | `reach` | a region is connected and contains its dot, so a galaxy dies at every cell that cannot walk back to its dot through surviving territory | | `bridge` | a cell pinned to a galaxy must stay connected to its dot; a cell sitting on the only remaining corridor is taken | | `probe` | assume one pairing, run the rules below to a fixpoint, and drop the pairing if that alone is a contradiction | Measured on 300 raw generator boards per size — unfiltered, so the numbers are not shaped by the property they measure (fraction finished by the fixpoint alone, no guessing): | board | mirror | +reach | +bridge | +probe | unique answers in the raw stream | |---|---|---|---|---|---| | 5×5 | 94.3% | 97.7% | 98.0% | 98.0% | 98.0% | | 7×7 | 63.3% | 93.3% | 95.3% | 95.3% | 95.3% | | 10×10 | 2.7% | 87.3% | 92.3% | 93.0% | 93.0% | Two things worth noticing. The mirror rule falls off a cliff as boards grow — it never asks whether a cell can still *walk home*, and connectivity is the rule that pays. And the solve rate at `probe` equals the unique-answer rate exactly: a sound fixpoint can never finish a board with two answers, so "solved by rules" is capped by uniqueness, and the ladder reaches that cap. ## Checking it Two independent counters must agree on the number of solutions of every board: a propagating search run at each of the four rule levels, and a brute force that shares no code with any of them — it walks cells in row-major order assigning twin pairs, ignores connectivity entirely until a leaf, and at the leaf hands the finished division to a standalone validator that flood-fills each region. The shipped bank is graded by the weakest rule set that finishes each board without guessing. 27 tests. ## Run it ```sh npm install npm run dev # local dev server npm test # vitest: 27 tests npm run generate # regenerate src/puzzles.json (fixed seeds) npm run stats # the measurements behind the README npm run build # production build in dist/ ``` ## License MIT ## Links - 🌐 Demo: https://sen.ltd/portfolio/tentai-show/ - 📝 記事: https://qiita.com/sen-ltd/items/9f78750665f2cb60369d - 📝 dev.to: https://dev.to/sendotltd/tentai-show-one-mirror-map-is-the-whole-puzzle-and-every-deduction-happens-twice-or-not-at-all-29ml