This assignment asks you to design and implement a GUI front-end to the Tic-Tac-Toe game. As a starting point, you may use your solution to homework #4, or you may download my solution (solution_hw4.zip). This program should have the same functionality as homework #4. The same Tic Tac Toe specifications apply and are given below.
I encourage you to look at past programs (e.g., MemoPad, CannonGame, etc.) as examples of how the GUI components work. Your best reference might be to read chapter 13 on the AWT API.
The game of Tic-Tac-Toe consists of two players, usually known as X and O, placing their marks in a 3x3 grid of squares. X goes first, and the players alternate moves. A player wins the game if she marks three squares in a row horizontally, vertically, or diagonally.
Your program should allow the user to play a number of games of Tic-Tac-Toe against the computer, displaying results of the play to the user.
Your initial implementation provide only a few simple behaviors:
Play a game between the program and the user.
Allow the user to choose her mark (X or O) and to specify which player goes first.
When it is the user's turn to play, the program accepts a move typed by the user at standard input. The program requires the user to make a legal move, that is, choose an empty space in the grid.
When it is the program's turn to play, the program chooses an empty space in the grid.
After each move by both players, the program displays the the current grid to standard output along with whose move it is.
When the game is over, the program displays a message that announces the winner, or a tie if the board is full with no winner.
Allow the user to determine whether to play another game.
Your computer player can choose its move in any way you wish, even randomly. You may implement a "smarter" program if you like!