CS 107, Introduction to Computer Science

Rock, Paper, Scissors

Assigned on Friday, 10/25.
Due on Wednesday, 10/30 by 9 PM.

Overview

Computerized Rock, Paper, Scissors! Here is how the game is normally played:

Two players, opposite each other, tap their fist in their open palm three times (saying Rock, Paper, Scissors) and then show one of three possible gestures.

               Rock, Paper, Scissors Hand Positions

Your Project

Write a program to play RPS (Rock, Paper, Scissors) against a user. The user should indicate rock, paper, or scissors via radio buttons or a select box (your choice). In the PHP script, the computer will secretly randomly pick Rock, Paper, or Scissors, and announce who has won as well as the basis for determining the winner. For example:

Computer wins! Rock crushes scissors.
Player wins! Paper wraps rock.
Player wins! Scissors cut paper.
Tie game! No one wins.
Feel free to use images. If you do so, appropriately cite where you got them from.

Your HTML should be in a file called rps.html, and your PHP should be in a file called rps.php.

You should have a button that provides the user with the opportunity to play again. This button should link back to the rps.html page.

Parting Words:

Start early, and have fun!
(Graphic and some descriptions borrowed from http://www.rialto.k12.ca.us/frisbie/math/rps.html).