-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement guess processing logic (#5)
## Why Checking if the guesses correspond to the hidden word is essential for the gameplay. ## How By implementing the `tryGuess` function that accepts a word, increments one attempt and then checks if the word correspond to the hidden word, or parts of it, updating hitmaps according. - adds a 4th state to the hitmap, corresponding to discarded letters (don't exist at all); - implements `findIndex` to facilitate alphabet state manipulation; - implements `findAllOccurances` to ensure all occurences of a letter have their intermediate state updated on the hidden word hitmap; - declares the `ATTEMPTS` which will limit number of attempts; - includes tests for the new functions;
- Loading branch information
Showing
5 changed files
with
153 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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