Class representing the Hangman game.
More...
#include <hangman.h>
Class representing the Hangman game.
◆ displayHangman()
void Hangman::displayHangman |
( |
int |
wrongGuesses | ) |
|
Displays the hangman figure based on the number of wrong guesses.
- Parameters
-
wrongGuesses | The number of wrong guesses made by the player. |
◆ getRandomWord()
std::string Hangman::getRandomWord |
( |
const std::string & |
filename | ) |
|
Retrieves a random word from a specified text file.
- Parameters
-
filename | The name of the file containing the words. |
- Returns
- A randomly selected word from the file.
◆ isNo()
bool Hangman::isNo |
( |
const std::string & |
response | ) |
|
Checks if the response is a "no".
- Parameters
-
response | The response string to check. |
- Returns
- True if the response is "no", false otherwise.
◆ isYes()
bool Hangman::isYes |
( |
const std::string & |
response | ) |
|
Checks if the response is a "yes".
- Parameters
-
response | The response string to check. |
- Returns
- True if the response is "yes", false otherwise.
◆ playHangman()
void Hangman::playHangman |
( |
const std::string & |
difficulty | ) |
|
Main gameplay loop for the Hangman game.
- Parameters
-
difficulty | The difficulty level selected by the player. |
The documentation for this class was generated from the following files: