COSC 231, FALL 2012 Programming Project #1

Distributed 10/8/2012     Due: 10/22/2012

Using HTML and Javascript, write a program that will test the user's ESP ability at determining the face value of a single six-sided die.

The initial page offers a button that the user clicks to start the test. On all pages, keep track of number of trials and the number of correctly determined values.

For each trial, the program first chooses a random number between 1 and 6, then starts rolling a die on the right hand side of the page. The rolling die shows each of the six die faces, one at a time, randomly chosen. The rolling die does not have to move around the screen, just the face needs to change.

On the left hand side is a list of 6 radio buttons, one for each face of the die. The user clicks one of the radio buttons to signify his "reading" of the computer's die. As soon as the user clicks, stop the rolling die on the computer's choice.

Label the radio buttons with the HTML tag (or the Javascript tag, if that works better for you, see text page 67) for the faces of the die:

If the user choice matches the computer's die, then increment the correct value counter and the trial counter. If the user choice does not match, then increment the trial counter.

Deliverables

Grade based on