In this chapter's project, you will use the knowledge you gain of functions to develop the Hangman game. Figures 8.1 to 8.7 show examples from the Hangman game, demonstrating its functionality and overall execution flow.
Figure 8.1: When the game is started, it displays a graphic showing an empty hangman's gallows and a series of underscore characters representing the secret word.
Figure 8.2: As the game progresses, each correct guess is displayed at the top of the window, and a visual record of every letter guessed is displayed at the bottom of the window.
Figure 8.3: The game prevents the player from making the same letter guess more than once.
Figure 8.4: The game permits the player to enter only one letter at a time.
Figure 8.5: The game prevents the player from entering numeric input.
Figure 8.6: The game congratulates the player when he correctly guesses the secret word.
Figure 8.7: If the player fails to guess the secret word within six guesses, he loses the game, and the picture of the hangman's gallows is updated to show a full hangman image.
By the time you have finished developing this application, you will have gained a good understanding of how to create custom functions and how to use them to improve the overall organization and maintenance of your Visual C++ applications.