CSC 533: Organization of Programming Languages
Spring 2007

HW5: Interactive Web Pages via JavaScript

For this assignment, you are to design an implement an interactive Web page that integrates JavaScript code with HTML elements. The page should enable the user to play the game Rock-Paper-Scissors against the computer. The user should be able to enter his/her selection (rock, paper, or scissors) by clicking on a button, and then see images that portray his/her choice and the computer's choice. The result of comparing the choices should be displayed, and a running score included in the page.

For example, the page might look something like the following:

Rock-Paper-Scissors screen shot

For full credit, the computer's pick may be selected at random, with either of the three options equally likely. For extra credit, you may implement a more effective strategy for the computer that involves keeping track of past rounds and using the user's history to guide the computer's pick.