| EIW Fall 2003 HW3: Perl Tic-Tac-Toe Game |
| EIW Home | HW3 FAQ |
You may work with a single partner on HW#3. You may not share code in any form with anyone other than your partner! Feel free to get ideas from sample Perl you can find on the WWW, but DO NOT submit code that you did not write. Submitting code you find on the web is a violation of the course policy on academic integrity and will result in (at a minimum) a zero for HW3 and a 2 letter grade drop for the course.
You need to create an Perl CGI program that will play tic-tac-toe against a user (who is using a browser). Your system does not need to win, but it must meet the following requirements:
The human user always goes first and is 'X'.
The user must be able to start a new game at any time.
You system must support multiple, simultaneous games.
Your system must not allow the user to cheat, the rules of the game must always be enforced (can't use a cell that is already taken, only one move at a time, etc).
Your system must always make a legal move (unless the game has ended in a tie after the user's move - in which case your system can't make a move).
Recognize when someone has won and send back a message indicating that the game is over (and announce who the winner is).
Do not allow moves once the game is over (unless the user starts a new game).
This is a Perl homework! Feel free to use JavaScript to make a fancy user interface, but the Perl program is the one that makes moves, validates moves, etc.
You need to establish a session to make this work! You can use hidden fields or cookies - whatever works for you. Make sure that your program can play more than one game at a time (each corresponds to a different session).
If you want to make a program that can't lose please do - but make sure your progam meets the above requirements before worrying about winning! The requirements will determine your grade, creating a winning program does not...
| EIW Fall 2003 |