[Tutor] Rock, Paper, Scissors

Christopher Spears cspears2002 at yahoo.com
Tue Aug 8 07:42:46 CEST 2006


I have been looking for a new project to tackle when I
came across this link:
http://www.ibiblio.org/obp/pyBiblio/practice/wilson/rockpaperscissors.php.

Here is some sample output that was provided at the
webpage:

Welcome to Rock, Paper, Scissors!

How many points are required for a win? 3

Choose (R)ock, (P)aper, or (S)cissors? r
Human: rock    Computer: paper        Computer wins!

Score: Human 0   Computer 1
Choose (R)ock, (P)aper, or (S)cissors? r

Human: rock    Computer: scissors     Human wins!

Score: Human 1   Computer 1
Choose (R)ock, (P)aper, or (S)cissors? p

Human: paper   Computer: paper        A draw

Score: Human 1   Computer 1
Choose (R)ock, (P)aper, or (S)cissors? s

Human: scissors  Computer: paper      Human wins!

Score: Human 2   Computer 1
Choose (R)ock, (P)aper, or (S)cissors? r

Human: rock      Computer: scissors   Human wins!

Final Score: Human 3   Computer 1

This looks like a fun project to work on.  From
reading the description, I feel this would be pretty
straight forward game to program.  However, I have no
idea how the computer would decide if it wanted a
rock, paper, or a pair of scissors.  Any hints?


More information about the Tutor mailing list