Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: sudden death #111

Merged

Conversation

PappasBrent
Copy link
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
src/main.rs Outdated Show resolved Hide resolved
src/test/mod.rs Outdated Show resolved Hide resolved
Copy link
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.

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 merged commit d6128df into max-niederman:main Feb 2, 2024
3 checks passed
@orhun
Copy link
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