Metadata-Version: 2.5
Name: magmacrunch-nelikko
Version: 0.1.1
Summary: NELIKKO - Helsinki 1989. Terminal version.
Project-URL: Homepage, https://magmacrunch.com/arcade/nelikko/
Author: magmacrunch media
License-Expression: PolyForm-Noncommercial-1.0.0
License-File: LICENSE
License-File: NOTICE
Keywords: arcade,blocks,games,puzzle,terminal,tui
Requires-Python: >=3.10
Requires-Dist: magmacrunch>=0.7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# NELIKKO (terminal)

Helsinki, 1989, in a terminal. The second version of the game beside `web/`,
on the [magmacrunch](https://github.com/magmacrunch-media/magmacrunch)
engine's terminal backend: a cabinet in the magmacrunch arcade and its own
command, the same either way.

```
pipx install magmacrunch-nelikko
nelikko
```

For working on it:

```
pip install -e ".[dev]"
python -m nelikko
```

## Keys

| key | |
|---|---|
| `←` `→` (or A/D) | siirrä, slide. Hold to keep sliding |
| `↑` (or W, X) | käännä, turn clockwise |
| `↓` (or S) | pudota, down a row |
| `SPACE` | heitä, drop |
| `C` | pidä, hold |
| `P` | tauko, pause |
| `R` | restart |
| `Esc` | the title (from the title, back to the arcade) |
| `Q` | quit |

Every control is a press, so a terminal plays this the way a browser does.
Holding an arrow is the terminal repeating it, which stands in for the
browser's own auto-shift; it starts a little later than the page's 170 ms,
and that is the only difference you can feel.

## It is the browser's game

`nelikko/rules.py` is the rules from `web/game.js`, which keeps them in one
file with the canvas and the page. `tests/test_oracle.py` checks the port
anyway: `tools/js_oracle.mjs` loads `web/game.js` unmodified with the page
stubbed out, plays it through its own `update()`, and the test replays every
op through the port and requires the same well, piece, score, level and clock
after each one. Ten games, about 25,000 ops, up to level 20.

Both versions share a scoreboard, so a rule changes in `web/game.js` and here
together, and the oracle test holds the two to each other. Two oddities this
port used to copy were fixed in both on 2026-10-19: levels 2 and 3 fell slower
than level 1, and a piece swapped out of hold entered over the stack.

Scores go to the board the browser already has, which is still called
`tetris` from before the rename. That is deliberate (see `../AGENTS.md`) and
never shown.

## Characters

Every glyph is in the engine's degradation table except the Finnish `ä` in
PIDÄ and the tagline. cp1252 and cp437 both carry it, so in practice it draws
everywhere; what it lacks is an ASCII stand-in under `--ascii`. The engine's
`nordic` group (magmacrunch-media/magmacrunch#4) adds one. Once a release
carries it, raise the `magmacrunch` floor here and drop `FINNISH` from
`tests/test_app.py`.

Needs a 52x22 terminal.

## Licence

[PolyForm Noncommercial 1.0.0](LICENSE), as the rest of this repository. See
[NOTICE](NOTICE).
