-
Notifications
You must be signed in to change notification settings - Fork 48
Add hard mode #45
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
Add hard mode #45
Conversation
Add hard mode.
cslarsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long wait. Thanks for the PR. If you fix the above, I will reconsider pulling this PR.
|
Also, the name |
|
Hello! I agree that changes were quite selfish and ugly. I believe I have fixed them. This PR might had been my first time hence the name :) |
| if self.position == len(self.quote.text): | ||
| self.mark_finished() | ||
| elif self.hard_flag: | ||
| self.reset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work properly with backspace and ESC? I just see that the incorrect counter is updated below in the other IF block. Perhaps that's where it should be? (I haven't tried your PR, so you may be right, I'm just asking if everything else works)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested both with hard flag and without the hard flag once more to see ESC and backspace behavior.
both versions have:
- ESC resets the level if playing, exits the program if not playing.
- Backspace allows deleting the current word but won't go past (or before) the current word.
- Meta-backspace resets the level.
during the hard mode the second elif statement is never reached.
- the if block accepts the correct keystrokes
- elif hard.flag accepts everything else
during the regular mode
- the if block accepts the correct keystrokes
- elif hard.flag is always false so the next elif block is run.
I would like to think everything else works with it.
I will resolve the conflicts soon.
cslarsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better!
You need to resolve conflicts with recent changes. I'll definitely merge this PR if you fix the conflicts and also look into the comment I have on the placement (testing, basically).
|
A friendly bump :) |
update README and add the treshold to .wpmrc
|
I forgot to branch out before making another feature (redlist). I will close this pr and open one for each. |
Adds a hard mode to the game, with the respective flag.
Restarts the level whenever an incorrect key is pressed.
usage:
wpm --hard