Examining the " Petals Around the Rose " Game

Examining the "Petals Around the Rose" Game

The Petals Around the Rose game, featured in Figure 3.1 illustrates all the new skills you will learn in this chapter.

Click To expand
Figure 3.1: This is a new twist on an old dice puzzle.

The premise of the Petals game is very simple. The computer rolls a set of five dice and asks the user to guess the number of "petals around the rose." The user enters a number and presses the button. The computer then indicates whether this value was correct, and provides a new set of dice. Once the user understands the secret, it's a very easy game, but it can take a long time to figure out how it works. When you look at the code towards the end of this chapter, you'll learn the secret, but for now you should try the game yourself before you know how it's done.