Skip to content

New feature: sudden death#111

Merged
max-niederman merged 4 commits intomax-niederman:mainfrom
PappasBrent:new-feature-sudden-death
Feb 2, 2024
Merged

New feature: sudden death#111
max-niederman merged 4 commits intomax-niederman:mainfrom
PappasBrent:new-feature-sudden-death

Conversation

@PappasBrent
Copy link
Copy Markdown
Contributor

@PappasBrent PappasBrent commented Jan 22, 2024

Adds an optional "sudden death mode" to ttyper, so that it will restart the current test as soon as the user makes a mistake.
To enable sudden death mode, start ttyper with the flag --sudden-death, e.g.:

ttyper --sudden-death

Addresses #108

@max-niederman max-niederman linked an issue Feb 2, 2024 that may be closed by this pull request
Copy link
Copy Markdown
Owner

@max-niederman max-niederman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution.

@max-niederman max-niederman force-pushed the new-feature-sudden-death branch from 8514989 to dba4873 Compare February 2, 2024 22:20
PappasBrent and others added 4 commits February 2, 2024 14:24
- Add the field sudden_death_enabled to the TestEvent struct to
  represent whether suddean death mode is turned on.
- Extract the is_missed_word_event() lambda in the calc_missed_words()
  test into a function for use in other parts of the program.
- Add command line option --sudden-death to enabel sudden death mode
- Add logic for restarting the test as soon as an error is made if
  sudden death mode is enabled
Co-authored-by: Max Niederman <maxniederman@gmail.com>
- Move logic for checking if a user makes a mistake during sudden death
  mode out of `src/main.rs` and into `src/test/mod.rs`. Note that this
  changes how sudden death mode works: previously, if a user made a
  mistake in sudden death mode, they would immediately begin a new test;
  now, they restart the current test.
@max-niederman max-niederman force-pushed the new-feature-sudden-death branch from dba4873 to cb4fb14 Compare February 2, 2024 22:24
@max-niederman max-niederman merged commit d6128df into max-niederman:main Feb 2, 2024
@orhun
Copy link
Copy Markdown
Contributor

orhun commented Apr 19, 2024

What a brutal option name! 💀

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.

[Feature Request] Sudden death mode

3 participants