|
TheCOSCGameProject
1.0
|
Implements the CodeGuesser mini-game. More...
#include <minigames.h>


Public Member Functions | |
| CodeGuesser () | |
| Constructor for the CodeGuesser game. More... | |
| bool | start () override |
| Starts the CodeGuesser game. More... | |
| bool | addGuess () |
| Adds a guess to the list of guesses. More... | |
| void | printGuesses () |
| Prints all the player's guesses. More... | |
| void | printWords () |
| Prints all possible words. More... | |
| int | getWordLength () const |
| Gets the length of the secret word. More... | |
| int | getGuessCount () const |
| Gets the number of guesses made by the player. More... | |
| std::string | getLastGuess () const |
| Gets the last guess made by the player. More... | |
| std::string | getGameName () override |
| Gets the name of the game. More... | |
Public Member Functions inherited from Game | |
| virtual | ~Game () |
| Virtual destructor for proper cleanup of derived classes. More... | |
Implements the CodeGuesser mini-game.
The CodeGuesser class challenges the player to guess a secret code, which is a randomly selected word.
| CodeGuesser::CodeGuesser | ( | ) |
Constructor for the CodeGuesser game.
Constructor for the CodeGuesser class.
Initializes the list of possible words and sets up the game.
Initializes the word list and randomly selects one word for the game.
| bool CodeGuesser::addGuess | ( | ) |
Adds a guess to the list of guesses.
Add a guess and check it against the secret passcode.
Colors the guess based on correctness (green for correct letters in the correct position, yellow for correct letters in the wrong position).
|
overridevirtual |
Gets the name of the game.
CodeGuesser game.
Get the name of the CodeGuesser game.
Implements Game.
| int CodeGuesser::getGuessCount | ( | ) | const |
Gets the number of guesses made by the player.
Get the number of guesses made by the player.
| std::string CodeGuesser::getLastGuess | ( | ) | const |
Gets the last guess made by the player.
Get the last guess made by the player.
| int CodeGuesser::getWordLength | ( | ) | const |
Gets the length of the secret word.
Get the length of the word (always 5 in this game).
| void CodeGuesser::printGuesses | ( | ) |
Prints all the player's guesses.
Print all the guesses made by the player so far.
| void CodeGuesser::printWords | ( | ) |
Prints all possible words.
Print all the possible words (for debugging or testing).
|
overridevirtual |
Starts the CodeGuesser game.
Start the CodeGuesser game.
The player has five attempts to guess a five-letter passcode.
Implements Game.
1.8.13