Fall Semester 2002


Midterm Exam: Stone, scissors, paper... (that's what you need for this exam)
There are two parts to this exam:
  1. (Written Exam) Read the exam, turn in a solution in 75 minutes.
  2. (Reality Check) Implement your solution by Tue Oct 29 5:30pm and show it next lab.
The grade for this exam will be: And now the problem.

Consider the following session with a program (Two) that was written in Java:

frilled.cs.indiana.edu%javac Two.java
frilled.cs.indiana.edu%java Two
Hello and welcome to the game.
*** The computer has chosen. 
Now it's your turn.
Paper, scissors, or stone...
Which will it be? Type here: paper
*** The computer's choice was: paper
***(This game's a draw.)***
The score is now: 
  Computer: 0
  You     : 0
*** The computer has chosen. 
Now it's your turn.
Paper, scissors, or stone...
Which will it be? Type here: scissors
Very good.
*** The computer's choice was: paper
***(So, you win.)***
The score is now: 
  Computer: 0
  You     : 1
*** The computer has chosen. 
Now it's your turn.
Paper, scissors, or stone...
Which will it be? Type here: stone
*** The computer's choice was: stone
***(This game's a draw.)***
The score is now: 
  Computer: 0
  You     : 1
*** The computer has chosen. 
Now it's your turn.
Paper, scissors, or stone...
Which will it be? Type here: stone
Very good.
*** The computer's choice was: scissors
***(So, you win.)***
The score is now: 
  Computer: 0
  You     : 2
*** The computer has chosen. 
Now it's your turn.
Paper, scissors, or stone...
Which will it be? Type here: paper
Too bad.
*** The computer's choice was: scissors
***(So, you lose.)***
The score is now: 
  Computer: 1
  You     : 2
*** The computer has chosen. 
Now it's your turn.
Paper, scissors, or stone...
Which will it be? Type here: frilled.cs.indiana.edu%clear
Essentially this is the famous stone-scissors-paper game:

You are to use PHP or CGI/Perl to implement a web-based version of it.

What technologies can you use?

Any of the following:

How many implementations are needed?

Answer: just one.

Choose one that you like best and implement a solution.

Good luck and do well!

Don't forget there's a second part to this exam, to be shown in lab next week.


Last updated: Oct 24, 2002 by Adrian German for A348/A548