feat: death mode (-d) — end the test on the first mistake#28
Open
hindriix wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
upstream-pr/death-mode
branch
from
July 25, 2026 06:07
3f010bf to
828b0b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
death_modeflag onThok;has_finished()returns early as soon as any input isIncorrectwhen it's set — checked ahead of the length/timer rules so it beats even a running timer.-dflag wired throughApp::new/reset.--helpentry.Verification
cargo test/clippy/fmt --checkclean; 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).