Assignment #4

Due Midnight, Wednesday Oct. 30, 1996

Implement the following program:

NAME

TTT - Tic Tac Toe game for two persons

SYNOPSIS

TTT [host port]

DESCRIPTION

If a person invokes the program without any arguments, the program behaves as a server and displays the following message to the standard output:

"let the other player type: TTT host port"

where host is the IP address of the machine and port is the server port number.

When the other player types: TTT host port the program behaves as a client and establishes a TCP connection with the TTT server.

Upon the establishment of the TCP connection a Tic-Tac-Toe board of 3x3 push buttons 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 it is not a user's turn, the whole board becomes insensitive. When it is a user's turn, only the unchecked buttons becomes sensitive.

When the game is over, the program displays a dialogue widget 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 clicks 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.


Back to Assignments Page
Back to CS476/576 Home Page