Programming Lesson 8:
Starting Hangman
Starting Hangman
Hangman is a large project so you may have trouble deciding where to begin. Below is a suggested order to completing the project.
- Design The Form: You should fully design the form before beginning the code. Decide if you are going to use a single picture for the hangman or multiple pictures.
- words and letterLabels Arrays: Fill the words array with your words and the letterLabels array with the letter label names. Fill both arrays using the Form and Game class constructors. If you are using the Game class you will have to create your own constructor.
- NewWord Method: Generate a random word and store the word and its length.
- SetArray Method: Finish this method so it stores *s in the stars array.
- Accessors (OOP Only): Create the rest of the get accessors for all variables in the Game class.
- Word Button: Program the word button so it calls the NewWord and SetArray methods, displays the *s in a form component, disables itself, enables the Guess Word and Guess Letter buttons, and hides the letter labels.
- CheckLetter Methods: Program the CheckLetter methods to test for user error.
- Win and Lose Methods: Program these methods to end the game.
- Reset Method: Program this method to reset the game to its initial state.
- ComboBox: Program the ComboBox to determine if the user wants to play again. You need to use an if statement and the Text Property of the ComboBox. Use the Items Property to add items to the ComboBox.
- AddToHangman Method: Program this method to determine which part of the hangman to add, and determine if the game has been lost.
- IsLetterCorrect Function: Use an if statement within a for loop to determine if the letter guessed is in the word.
- Guess Letter Button: You will need to use a number of if statements as well as a for loop to finish the program. This button will make use of the ConvertToNumber method, both CheckLetter methods, the IsLetterCorrect method, and the AddToHangman method.

