Chapter 5. Hangman

Table of Contents

The Visit Object
The Home Page
The Guess Page
Limitations

So far, these examples have been a little bit cut-and-dried. Lets do a meatier example that uses a few more interesting components. Let's play Hangman!

Our Hangman application consists of four pages. The Home page allows a new game to be started, which includes selecting the difficulty of the game (how many wrong guesses you are allowed).

Figure 5.1. Hangman Home Page

Hangman Home Page

The main page is the Guess page, where the partially filled out word is displayed, and the user can make guesses (from a shrinking list of possible letters):

Figure 5.2. Hangman Guess Page

Hangman Guess Page

After you give up, or when you make too many mistakes, you end up on the the Failed page:

Figure 5.3. Hangman Failed Page

Hangman Failed Page

But, if you guess all the letters, you are sent to the Success page:

Figure 5.4. Hangman Success Page

Hangman Success Page