Skip to main content

15 PUZZLE (terminal)

The classic sliding tile puzzle in a terminal, from the 8 puzzle on 3x3 to the 35 puzzle on 6x6. The third version beside web/ and wii/, on the magmacrunch engine's terminal backend: a cabinet in the magmacrunch arcade and its own command, the same either way.

pip install -e ".[dev]"
fifteen-puzzle                 # or python -m fifteen
fifteen-puzzle --size 3 --play

Keys

key
arrows (or WASD, hjkl) slide the tile beside the gap that way
left / right on the title choose the size, 3x3 to 6x6
R reshuffle
Esc the title (from the title, back to the arcade)
Q quit

Put the tiles in order, 1 to N row by row, with the gap bottom right. The score is the move count, so fewer is better; the time is kept beside it.

It is the browser's game

fifteen/rules.py is web/js/game.js plus the part of adenosine-puzzle's createGame it relies on: a move is the left slide with the board rotated round it, and only a move that changed something counts. tests/test_oracle.py checks it: tools/js_oracle.mjs loads the website's adenosine-puzzle.js and web/js/game.js unmodified with Math.random seeded, shuffles and plays a hundred and thirty games through the game's own handleMove(), every size mashed and thirty 3x3s solved outright by a breadth-first search, and the test replays every move through the port and requires the same board, move count and result after each one. So the shuffle is the browser's too, draw for draw.

The oracle needs the website, for the bundle. It finds it the way tools/link-shared.mjs does: ../shared, $WEBSITE, ../../website, ../../../web/website. CI checks the website out beside the game.

Scores are filed the browser's way: one board, fifteen-puzzle, with the size and the time beside each score, and a top ten per size, fewest moves first. A run is filed only if it makes its size's ten, as the browser files only what it asked a name for.

Fewer is better, which the engine has to be told. The cabinet declares lower_is_better, and needs magmacrunch 0.13.0 or later for it: an older engine would keep the worst runs and show the longest solve on the arcade floor as BEST.

Needs a 68x21 terminal, which is what the 6x6 takes; the smaller boards draw in less.

Licence

PolyForm Noncommercial 1.0.0, as the rest of this repository. See NOTICE.

Metadata

Release files for magmacrunch-fifteen-puzzle 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magmacrunch-fifteen-puzzle 0.1.2
File Size Uploaded Provenance Actions
magmacrunch_fifteen_puzzle-0.1.2.tar.gz 24.0 kB With provenance Details for magmacrunch_fifteen_puzzle-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for magmacrunch-fifteen-puzzle 0.1.2
File Interpreter ABI Platform Actions
magmacrunch_fifteen_puzzle-0.1.2-py3-none-any.whl Python 3 none any Details for magmacrunch_fifteen_puzzle-0.1.2-py3-none-any.whl

Total release size: 46.4 kB

Release files / magmacrunch_fifteen_puzzle-0.1.2.tar.gz

Download URL magmacrunch_fifteen_puzzle-0.1.2.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
188e2b7273b4a483eeecb1dadc2554e82f6fc73c2729accdd2c49f0aefdffba6
BLAKE2b-256 checksum
How to use checksums
5eb47a60606fba5e654f75ec049fc99cd8fc0028b4b6b799eb9f2a5fb95f530d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / magmacrunch_fifteen_puzzle-0.1.2-py3-none-any.whl

Download URL magmacrunch_fifteen_puzzle-0.1.2-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7e497c3704b1a1b509cc32658da00644e7f30c631fe40f9e9a2ad8b2e67198f
BLAKE2b-256 checksum
How to use checksums
0e9ee1b97d9a91abe49ba0093a9d3a1904a41d73881fabbb9c8034bee49e73d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for magmacrunch-fifteen-puzzle 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for magmacrunch_fifteen_puzzle-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page