Tic Tac Toe - game for two persons
Note: Submission deadline is December 24, 2003. Submit the whole JBuilder project as one compressed zip file via Digital Drop Box of Blackboard.
Develop a Java application for a Tic Tac Toe game. If a person (the first player) invokes the program with only one arguemnet (PortNumber), the program behaves as a server. When another person (the second player) invokes the program with two arguements (HostName and PortNumber), the program behaves as a client and establishes a TCP connection with the first player.
Upon the establishment of the TCP connection a Tic-Tac-Toe board of 3x3 entries appears on each of the two displays. The program lets the client play first then it strictly alternates between the client and server until the game is over with either a winner or a tie.
When the game is over, the program displays a dialogue box to each user with a message area containing:
"You are the winner (loser)" Or "No winner, it is a tie"
"Would you like to play another game?"
and two buttons labeled "YES" and "NO".
If both users click on YES, another game is played. In this case, the person who played first last game will play second. If any user clicks on NO, the program terminates.
The following is an example how the interface should look like (the game is over with a tie):
Tic Tac Toe server
Tic Tac Toe client
