Skip to content

feat(tui): a slot machine for anyone who cannot decide - #9

Merged
klNuno merged 5 commits into
mainfrom
feat/slots-easter-egg
Aug 21, 2026
Merged

klNuno merged 5 commits into
mainfrom
feat/slots-easter-egg

Conversation

@klNuno

@klNuno klNuno commented Aug 21, 2026

Copy link
Copy Markdown
Member

src/slots.rs is a three reel slot machine reached from a feeling lucky line at the bottom of the menu, in src/tui.rs. it rolls harness, then provider, then model, and lands on a picked launch: enter fires it, space re-rolls, esc leaves with nothing spent. it is an easter egg and it is deliberately undocumented.

nothing turns until the handle is pulled, with space or a click on it. the provider reel is refilled from the harness that just landed, and the model reel keeps turning until load_models answers, bounded by the same twenty second ceiling the command line path uses.

Geo::fit measures the cabinet against the drawing rect every frame rather than holding a fixed size, so a long model id is shown instead of a stump and the handle margin is the first thing dropped on a narrow terminal, where the space bar replaces it. the dice are a splitmix64 seeded off SystemTime, so no new dependency.

cargo fmt, cargo clippy --all-targets --all-features -- -D warnings and cargo test pass on the new head, 118 tests.

klNuno added 5 commits August 22, 2026 01:40
…ecide

The three questions the picker asks are three reels of a slot machine, stopping
left to right because that is the order they depend on each other in: the
provider reel is filled from the harness that just landed, and the model reel
turns on placeholders until the catalogue lookup for that provider answers. The
wait for the network became the animation rather than a spinner in front of it.

The lucky line is a button, so the menu now enables mouse capture, and the
draw records where the line ended up: the footer sits under a body whose height
is only known once the frame is laid out, and a click knows a row and a column
and nothing else. Ctrl+L pulls the same lever, because a plain letter is typed
into the model filter.

Nothing launches on its own: the payout screen shows the three answers and
waits for enter, esc puts the rolls back in the menu.
slots.rs sized every column from a 22-wide const, which stumped a long model id on a
wide screen and overflowed a narrow one. every size now comes from Geo::fit(area):
wider terminal, wider reels up to MAX_CELL; taller terminal, deeper drums. under the
width that keeps a reel legible the handle margin goes rather than the reels, and the
banner names the space bar instead.
…fills the screen

one row per frame read as a list being replaced. slots.rs now owns the spin: a
fractional offset winding up to TOP_SPEED, blurring into symbols past BLUR_SPEED,
easing onto its row through settle(), a back-out curve overshooting under a row. all
three drums go on the pull and stop left to right, the provider reel refilled mid-spin
without losing its motion. the cabinet lights from the payline outwards (View::boot),
the handle is a knob on a rod in a track with a sprung return (View::lever), Geo::fit
takes the whole terminal.
`MAX_REACH` 3 and `MAX_CELL` 30: at 140x34 the machine is nineteen rows tall and
centred, with room left around it.

`Reel::face` no longer swaps names for casino symbols at speed. the swap hid the only
thing worth watching, the answers going past. `TOP_SPEED` drops to eleven rows a
second and the payline runs cyan, white on landing.

`brake_to` now arms rather than brakes: `Spin::Arming` holds full speed until the row
is `BRAKE_ROWS` away, then `land` times the curve off `ENTRY_SLOPE` so it leaves at
the speed the drum was turning. list length no longer changes the landing, and the
brake no longer opens with a lurch.
@klNuno
klNuno merged commit b397fd9 into main Aug 21, 2026
5 checks passed
@klNuno
klNuno deleted the feat/slots-easter-egg branch August 21, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant