PROJECT PREVIEW: THE ROCK, PAPER AND SCISSORS GAME


This chapter's game project is the Rock, Paper and Scissors game. The rules of the game are quite simple. Each player attempts to outguess an opponent (in this case, the computer) by consistently selecting the better of three choices. The rules for resolving each game are as follows:

  • Rock crushes scissors to win.

  • Paper covers rock to win.

  • Scissors cuts paper to win.

  • Matching choices automatically tie.

Figures 9.1 to 9.5 illustrate how the Rock, Paper and Scissors game works, outlining the application's overall functionality and execution.

image from book
Figure 9.1: The Rock, Paper and Scissors game begins by displaying the game board.

image from book
Figure 9.2: When the player clicks on the Play button, a 1.5-second countdown begins.

image from book
Figure 9.3: The player gets a half second at the end of the countdown to make a selection by choosing rock, paper, or scissors.

image from book
Figure 9.4: As soon as both the computer and the player have made their choices, the game displays graphics showing each move and determines who won.

image from book
Figure 9.5: The Rock, Paper and Scissors game also keeps a running tally of the number of wins, losses, and ties.




Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner 2006
Microsoft Visual C++ 2005 Express Edition Programming for the Absolute Beginner 2006
ISBN: 735615381
EAN: N/A
Year: 2005
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net