New feature: sudden death#111
Merged
max-niederman merged 4 commits intomax-niederman:mainfrom Feb 2, 2024
Merged
Conversation
max-niederman
requested changes
Feb 2, 2024
max-niederman
approved these changes
Feb 2, 2024
Owner
max-niederman
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the contribution.
8514989 to
dba4873
Compare
- 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.
dba4873 to
cb4fb14
Compare
Contributor
|
What a brutal option name! 💀 |
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.
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
ttyperwith the flag--sudden-death, e.g.:ttyper --sudden-deathAddresses #108