Skip to content

feat: death mode (-d) — end the test on the first mistake#28

Open
hindriix wants to merge 1 commit into
jrnxf:mainfrom
hindriix:upstream-pr/death-mode
Open

feat: death mode (-d) — end the test on the first mistake#28
hindriix wants to merge 1 commit into
jrnxf:mainfrom
hindriix:upstream-pr/death-mode

Conversation

@hindriix

@hindriix hindriix commented Jul 22, 2026

Copy link
Copy Markdown

What

Adds a death mode (-d / --death-mode): the test ends the instant you mistype a character.

This revives the idea from #18 (which has been open since early 2023) with a small, focused, tested implementation — happy to defer to the original author if they'd prefer to land theirs; just wanted to offer a ready-to-merge version.

Why

Practicing with zero tolerance for mistakes is a well-known way to build accuracy, which in turn builds real speed. It makes you slow down and commit to each keystroke.

How

  • thok: a death_mode flag on Thok; has_finished() returns early as soon as any input is Incorrect when it's set — checked ahead of the length/timer rules so it beats even a running timer.
  • main: -d flag wired through App::new / reset.
  • docs: README example + --help entry.

Verification

cargo test / clippy / fmt --check clean; unit tests cover: a mistake ends the test, death mode off tolerates mistakes, and death mode overrides a running timer. Also confirmed via a PTY run (one wrong key → straight to the results screen).

@hindriix hindriix mentioned this pull request Jul 22, 2026
6 tasks
Adds a `-d` / `--death-mode` flag. With it on, the test finishes the
instant an incorrect character is typed, checked ahead of the usual
length/timer rules so it beats even a running timer.

Practicing with zero tolerance for errors is a well-known way to build
accuracy (and, in turn, speed). This revives the idea from the
long-open PR jrnxf#18 with a focused implementation and tests.

- thok: `death_mode` flag on `Thok`; `has_finished` returns early on any
  incorrect input when it's set.
- main: `-d` flag wired through `App::new`/`reset`.
- docs: README example + `--help` entry.
- tests: mistake ends it, off tolerates mistakes, and it overrides a
  running timer.
@hindriix
hindriix force-pushed the upstream-pr/death-mode branch from 3f010bf to 828b0b0 Compare July 25, 2026 06:07
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