Word Console Game (C++)

Square
Description:

This is a console game I wrote in C++. It’s a mastermind-like game with a hidden word, which the player has to guess. When a player enters a guess, the game tells him how many letters are correct and in the right position, and how many are correct, but in the wrong position.

The player wins if he enters a correct guess, before his tries run out. At the end of the game, the player can choose to play again or not.

Started: December 2017
Finished: February 2018

Links:

Source Code

Code:

The WordGame class handles the game logic. This class determines if a player’s guess is valid or not and checks if there are any correct letters. The class also keeps track of the maximum tries that the player has left and if the game is won or lost.