CMSC104, Spring 2010
Programming Project 2
Rock, Paper, Scissors!


Out: Monday, April 12, 2010
Due Date: Monday, April 26, 2010 before 11:59 p.m.

The Objective

This project is designed to give you practice with loops and switch statements. You will also get practice designing and writing your first JavaScript program from scratch.

The Task

The program you write will implement a game called earth-wind-fire-water, based on the the classic game of Rock, Paper, Scissors. If you are not familiar with the game, please read the Wikipedia page about the game. Your program should allow the user to play against the computer. You should keep a running total of the number of player wins, losses, draws (ties) and games played. When the user is finished playing, you should display the statistics for that run of games.

Screenshots

The following are set of screen shots of the game Rock-Paper-Scissors. You should produce similar messages for your game of earth-fire-water when your game is being played. Note the game of Rock-Paper-Scissors uses upper-case letters. You game of earth-fire-water should strictly use all lower-case letters for input. Messages, of course, can contain upper and lower case letters.


Welcome screen

Get ready screen

User entering incorrect input

Error message for incorrect input

Getting the input

Showing the computer's guess

Displaying the results

Asking to play again - yes

Getting another input

Showing the computer's guess

Displaying the results

Asking to play again - no

Displaying the statistics

Submitting the Program

You do not have to do anything to submit the program. It should be in your pub/www/cs104/proj2 directory.
Your program file name must be: proj2.html located in the above folder.

Extra credit

10 points extra maximum: Add two more items to the game - wind and life. You will then need to consider these combinations:

Using these seven combinations along the original three, there will be ten combinations total. Each of the five elements (earth, water, fire, wind, and life) will win in two cases and lose in two cases. Of course, the sayings above are just suggestions and you may replace them with your own.