Primary objectives:
- Read word-hint pairs from the file "data.csv" (right-click, Save Link As...), and randomly select one each iteration of the game. For testing, I recommend you keep the file as-is for ease of testing game features. You can directly edit this in Sublime Text or any reasonable text editor. Use at least 10 word-hint pairs in the finished game (but no more than 20), and also attach your edited data file to your team's submission.
- Use the provided starter function to display the gallows (please do not alter it or handcraft your own ASCII art, it's a huge waste of time).
- Display the blanks as underscore characters ('_'), one for each character in the hidden word, with spaces inserted in between for easy readability. Note that when you print underscores, they form a continuous line. HINT: Write a void function to output these blanks without changing the internal string representation.
- Display the used, already-guessed characters. You will build this string one guess at a time through concatenation. Represent the guesses in uppercase. You can check the user's input guess by seeing if it is present in the guessed character string. Provide a friendly message if they have already guessed that character, but do not increment the counter.
- Reveal the word (e.g., cout << "The word was: " << hiddenWord << endl;) if the player loses.
- Prompt the player if they would like to play again, or break out of the outer game state loop.
- You are highly enouraged to practice using pointers and create void functions that pass pointers instead of return types, where appropriate.
BONUS:
On submission, please indicate which of these features that you have attempted (in a code comment at the beginning of the file with author information) to help speed up the grading.
- Replace the wordlist array with a dynamically-allocated singly-linked list. Choosing a random item just involves choosing a random number (0 to size-1) and advancing the current pointer that many times. Be careful not to advance past the ending nullptr value. Another method is to set the last node's next pointer to the first node, closing the loop and creating a circular queue. Hint: always keep a pointer to the first node as in the nodeSum and nodeAvg examples.
- Modify the struct to prevent repetition of words on subsequent "play again" iterations. If you run out of novel words to present, tell the user so, and the game is over.
- Allow the user to guess the whole word and not just a single character (i.e., "Pat, I'd like to solve the puzzle" on Wheel of Fortune). Incorrect guesses should increment the counter as usual.
- Selectable variable difficulty levels that decrease the number of available guesses.
- 2-player version (alternate which is the active player taking turns, and keep score, playing until best-of-5 or best-of-7).
- Interactive 2-player version, where the inactive player may specify what the word and hint are for the active player to guess. You will want to immediately force the window to scroll this information past the top of the frame by outputting multiple newline characters, such as looping (around 80 times): cout << endl; or clearing the screen with outputting a "magical" string (I'll let you research what that is).
- Add the capability of reading and displaying existing, and appending new word-hint pairs to the data file. This should be in the form of a callable function that can be a mode of the game itself in a menu at the initial greeting, or a separate utility program (your choice).