Class representing the Word Scrambler game.
More...
#include <wordScrambler.h>
Class representing the Word Scrambler game.
◆ displayHint()
void WordScrambler::displayHint |
( |
const std::string & |
word | ) |
|
Displays a hint with the first, middle, and last characters of the word.
- Parameters
-
word | The word for which the hint is generated. |
◆ getRandomWord()
std::string WordScrambler::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.
◆ playWordScrambler()
void WordScrambler::playWordScrambler |
( |
const std::string & |
difficulty | ) |
|
Main gameplay loop for the Word Scrambler game.
- Parameters
-
difficulty | The difficulty level selected by the player. |
◆ scrambleWord()
std::string WordScrambler::scrambleWord |
( |
const std::string & |
word | ) |
|
Scrambles the characters in a given word.
- Parameters
-
word | The word to be scrambled. |
- Returns
- A scrambled version of the word.
◆ toLowerCase()
std::string WordScrambler::toLowerCase |
( |
const std::string & |
str | ) |
|
Converts a string to lowercase.
- Parameters
-
str | The string to be converted. |
- Returns
- The lowercase version of the string.
The documentation for this class was generated from the following files: