Skip to content

Conversation

@Kudbettin
Copy link

Adds a hard mode to the game, with the respective flag.

Restarts the level whenever an incorrect key is pressed.

usage:
wpm --hard

Copy link
Owner

@cslarsen cslarsen left a 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.

@cslarsen
Copy link
Owner

Also, the name Add files via upload? :)

@Kudbettin
Copy link
Author

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 :)

@Kudbettin Kudbettin changed the title Add files via upload Add hard mode Sep 19, 2019
if self.position == len(self.quote.text):
self.mark_finished()
elif self.hard_flag:
self.reset()
Copy link
Owner

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)

Copy link
Author

@Kudbettin Kudbettin Sep 23, 2019

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.

Copy link
Owner

@cslarsen cslarsen left a 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).

@Kudbettin
Copy link
Author

A friendly bump :)

@Kudbettin
Copy link
Author

I forgot to branch out before making another feature (redlist).

I will close this pr and open one for each.

@Kudbettin Kudbettin closed this Feb 9, 2020
@Kudbettin Kudbettin mentioned this pull request Feb 9, 2020
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.

2 participants