![]() |
![]() Fall Semester 2002 |
Consider the following session with a program (Two
) that was
written in Java:
Essentially this is the famousfrilled.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
stone-scissors-paper
game:
scissors
is stronger than paper
.
stone
is stronger than scissors
.
paper
can wrap around the stone
, so
paper
is stronger than stone
.
What technologies can you use?
Any of the following:
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.