Add aspirinV2: fixed-cell 15-puzzle

Cells never move; each NumericSelectLabel shows the number it holds
on white and the empty cell takes the board colour via a linked
backgroundColor. Adds the V2 generator, build step (with a direct-Java
sedonac fallback), offline verifier mode (--v2) and viewer support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 19:14:16 +03:00
co-authored by Claude Opus 5.5
parent 0728acd99a
commit d1f4e87526
8 changed files with 3242 additions and 10 deletions
+12 -2
View File
@@ -7,6 +7,7 @@
|---|---|
| `aspirin.sax` / `app-ORION-aspirin.zip` | Playable game: auto-shuffle at start, tap a tile next to the gap to slide it, SHUFFLE button, move counter, SOLVED! |
| `aspirin_solver.sax` / `app-ORION-aspirin_solver.zip` | Demo: shuffles 30 moves, then an auto solver plays one move per second until SOLVED! (it records the shuffle and replays the inverse moves) |
| `aspirinV2.sax` / `app-ORION-aspirinV2.zip` | Same game with fixed cells: nothing moves, each cell shows the number it holds on white, the empty cell takes the board colour |
## Run in the simulator
@@ -17,13 +18,14 @@ The simulator is headless; to watch the screen run `viewer\run_viewer.cmd`
## Build
```bash
python build.py # gen .sax -> sedonac .sab -> launcher backup zips (both apps)
python build.py # gen .sax -> sedonac .sab -> launcher backup zips (all apps)
python verify_logic.py # offline scan-engine model test of the game
python verify_logic.py --solver
python verify_logic.py --v2
```
`gen_aspirin.py` holds layout, colours, shuffle length (`SHUFFLE_MOVES`) and solver delay
(`SOLVE_DELAY`). Paths to the Sedona install are at the top of `build.py`.
(`SOLVE_DELAY`); `gen_aspirinV2.py` generates V2. Paths to the Sedona install are at the top of `build.py`.
## How it works
@@ -33,3 +35,11 @@ python verify_logic.py --solver
by the shuffle); it latches the blank's cell and the blank follows automatically.
- Shuffle uses a logistic-map RNG made of `Reset`/`Mul2` blocks; only legal moves, so always solvable.
- Solved = blank home and the weighted sum of tile offsets is 0 (rearrangement inequality).
### V2 (fixed cells)
- 16 `NumericSelectLabel` cells; `in` = the number held (0 = empty), text list ` ;1;2;...;15;`.
- `backgroundColor` is linked from logic: white for a number, board colour for the empty cell.
- State = 16 cell values in `ADemux2` latches (boot loads the solved board). Blank position is
derived from the values; a move latches 0 into the touched cell and its value into the blank.
- Solved = sum of i * value_i over cells 1..15 is 1240 (its unique maximum).