Skip to content

death mode - #18

Open
jeniasaigak wants to merge 3 commits into
jrnxf:mainfrom
jeniasaigak:jeniasaigak/feature-add-death-mode
Open

death mode#18
jeniasaigak wants to merge 3 commits into
jrnxf:mainfrom
jeniasaigak:jeniasaigak/feature-add-death-mode

Conversation

@jeniasaigak

Copy link
Copy Markdown

What:
Added death mode, which can be enabled via -d flag. When the death mode is enabled, the round will be finished as soon as the user will type an incorrect symbol

Why:
If you want to become a good typist, you need to learn to type with no mistakes. This mode will enforce you to think twice on each key press and strongly decrease amount of typing mistakes. This will lead to better typing speed

How:
There is a has_finished function at game related file, which validates if the round is completed. At this PR I've additionally added a check to the function to validate it there are any mistakes in the input field

Checklist:

  • Allow edits from maintainers option checked
  • Branch name is prefixed with [your_username]/ (ex. thatvegandev/featureX)
  • Documentation added
  • Tests added N/A
  • No failing actions
  • Merge ready

@jrnxf

jrnxf commented Jan 7, 2023

Copy link
Copy Markdown
Owner

this looks awesome! I made a few minor tweaks in a branch of mine that I'll add here! One thing I'd love you opinion on:

What do you think about not showing stats if the user fails in death mode? We could just throw a skull icon in the center of the terminal if they fail maybe. I kinda like the idea of making the seeing stats a rewarding experience if you're in death mode.

@jrnxf jrnxf changed the title Add death mode death mode Jan 7, 2023
@jeniasaigak

Copy link
Copy Markdown
Author

@jrnxf Your idea sounds great! I've also reviewed changes at your branch, and all of them make sense to me. I'll add it to the PR along with your proposition 👌

jrnxf and others added 2 commits January 13, 2023 15:31
- small cleanup, add death emoji to test if failed in death mode
@jeniasaigak

Copy link
Copy Markdown
Author

I've just realized that it will be better to show the word and the exact place where you made a typo, along with skull at the bottom line after loosing in the death mode. Will try to implement it

hindriix added a commit to hindriix/thokr that referenced this pull request Jul 22, 2026
Three new ways to practice, all Monkeytype-inspired:

- `-d` / `--death-mode`: end the test the instant you mistype a
  character. Checked ahead of every other finish rule, so it beats even
  a running timer. (Revives the long-open death-mode PR jrnxf#18.)
- `--punctuation`: sprinkle capitalization and punctuation into
  generated words so passages read like real sentences.
- `--numbers`: intersperse random number tokens.

Punctuation/numbers live in a new `decorate` module (`WordMods`) applied
to the initial prompt and, in continuous mode, to each refilled chunk —
so a timed test keeps its style as words stream in. All three apply only
to generated word mode; a custom prompt (`-p`) or sentences (`-f`) are
left untouched. Docs and `--help` updated; tests cover death-mode finish
timing and the decorator's capitalization, closing punctuation, number
insertion, and no-op-when-disabled behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hindriix

Copy link
Copy Markdown

Came across this while adding a death mode of my own — opened #28 with a tested implementation (-d / --death-mode, ends on the first mistake, ahead of the length/timer rules) plus README + --help docs. Fully credit the idea here; if you'd rather land this original PR instead, feel free to pull anything useful from #28 or close mine. 👍

hindriix added a commit to hindriix/thokr that referenced this pull request Jul 25, 2026
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.
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.

3 participants