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.1

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.1
File Size Uploaded Provenance
magmacrunch_fifteen_puzzle-0.1.1.tar.gz 23.9 kB With provenance Details

Built distribution (wheel)

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

Total release size: 46.3 kB

Release files / magmacrunch_fifteen_puzzle-0.1.1.tar.gz

Download URL magmacrunch_fifteen_puzzle-0.1.1.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d1e028a8c118d8653ce8d65474b25b16d9dd17fd5b70d171ba7a2fe1eeab8042
BLAKE2b-256 checksum
How to use checksums
ed709448526abe5b6dee2de684071593e1b43edbba2bcd8d7b90860efbd34c17
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 22, 2026.

Transparency log

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

Download URL magmacrunch_fifteen_puzzle-0.1.1-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d6e3e1a5d9e6320d9ec4932e3d502a91dcd0b22b1daf1d62b1f4de74da3f730
BLAKE2b-256 checksum
How to use checksums
84d3962a02f14737f6e7cf6c78ea27f7daf6deafa6606d9187f9249e62d35786
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 22, 2026.

Transparency log

Security for magmacrunch-fifteen-puzzle 0.1.1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for magmacrunch_fifteen_puzzle-0.1.1.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 22, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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