WebSys Spring 2008 HW3


HW3 - PHP Tic-TacToe

Due Date: March 19th by 11:59PM

O    
X
O X

You may work with a single partner on this project. You must both submit, and your game should include both of your names (displayed when we load your game in our browser).




TicTacToe:

You need to create a smart TicTacToe game using PHP. Your program will play against a human, and must be somewhat smart :

  • Your program must always make a winning move if it is possible.
  • Your program must always block an opponent from winning if it is possible.
  • Your program must recognize when the game is over.

Your program does not need to incorporate any fancy strategy, but should just be able to recognize that there is a winning move, or that it needs to make a move to block an imediate win by an opponent.

It must be possible for many people to be playing tictactoe at the same time (your progam must be able to keep track of multiple sessions).

Feel free to use JavaScript to make the game easy to play, or to provide visual effects - but all the game logic must be coded in PHP.

Requirements:

Your game must be written in PHP

The user must be able to start a new game whenever they want.

There must be some recognition that the game is over (the page should tell the user they have won, lost or tied).

It must be possible to win (the game must work correctly).

You must control the appearance (use CSS!)


Feel free to borrow Javascript code you find on the web for special effects or extra functionality - but you must write all of the PHP (game functionality) code yourself. Any code that you borrow must be documented in your HTML document, for example:

<!-- 
// This code flashes an image - code swipped from www.imageflasher.com/javascript
-->
Grading:

If you work with a partner, we expect more!

Part of your grade will depend on a brief meeting with Dave or Sujing. We will ask you to go over your code with us, and will ask you to make some minor changes. If we don't think you understand your own code, you won't get a good grade...