Project 2. Tic Tac Toe
CS202, Summer 2004

Due: Thursday, August 12

Please upload your files using the online turnin server. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please make sure to turn in your solutions in time. For all homework assignments and projects, failing to comply with the required code conventions (see Review of Language Basics, slide #7) will incur a credit penalty up to 10% of the total credit for the assignment.

[Reading]  Read the following sections of SUN's Java Tutorial
[Problem Description] Tic Tac Toe is a game played on a 3 by 3 grid by two players, Player 1 and Player 2. Player 1 starts by placing an red circle at an unoccupied grid position. Then Player 2 places a blue cross at an unoccupied grid position. Play alternates between Player 1 and 2 until one player's symbols occupy an entire line (vertical, horizontal, or diagonal), in which case that player wins; or the grid is filled, in which case the game is tied.

For this project you are going to implement the Tic Tac Toe game with a Java GUI application. In particular, your GUI should include at least the following components:
TTT Image
Note that your GUI interface should automatically adjust to the size of the window. For example, when the window is resized, the board should be enlarged or shrinked accordingly.

[AI Player] For extra credit, add another game mode where a human player can play with an AI player. The AI player follows a simple strategy:
[Grading] The total points for this project is 100, with 40 extra credit if you choose to implement an AI player.