-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Hangman #15
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
base: master
Are you sure you want to change the base?
[WIP] Hangman #15
Conversation
Do the "is it solved?" check earlier in the process, so we can also finish earlier. To be more precise, we're now need to go one level less deep than before (except for trivial cases, where we're still just as good).
Also added a helper FileReader class
80db9ef to
3cbdf5d
Compare
| using namespace Hangman; | ||
|
|
||
| char AlphaOrderPlayerSession::guess() { | ||
| auto letters = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', |
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.
how about non-ASCII letters?
|
|
||
| for (const auto &word : repository.words()) { | ||
| for (auto letter : word) { | ||
| assert(letter >= 'A' && letter <= 'Z'); |
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 might break for non-ASCII characters
| using namespace Puzzles; | ||
|
|
||
| std::vector<std::string> WordRepository::words() { | ||
| if (_words.empty()) { |
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.
how about changing it to an early return?
Add a Hangman game + players! Still a WIP, though.