Connect Four Game
Due: April 16
Objective
To create a complete client/server application, and design a protocol from scratch.
Task
For this project you will create a networked version of the Connect 4 game. This will involve writing a client and a server. When using the client, a user will be able to play a game of Connect 4 against the computer. You don't need to match up multiple human players, just play against an AI.
Overview
Connect 4 is a popular game consisting of a grid of spaces. The grid has 7 columns and 6 rows. Players take turns placing colored pieces into a column of their choice. When a player puts a piece into a column, the piece will fall down until it lands on another piece in that column. The game is over when one player has four of their colored pieces in a row (horizontally, vertically or diagonally).

The game Connect 4
Requirements
Your networked version of this game should do the following things:
- The server should wait for a client to connect when it is started.
- The client should connect to the server, and begin a game.
- The client should show the current state of the board to the user, and wait for them to choose a column.
- The client should send this choice to the server which will make the computer's choice.
- The AI does not have to be very smart - it can simply choose any open column.
- The above process (steps 3 and 4) should repeat until one side has 4 in a row (horizontally, vertically or diagonally).
- At that point, the client should print the winner and disconnect.
- The server should go back to waiting for a client to connect.
Extra Credit
There are a few opportunities for extra credit:
- Make it so multiple players can connect to the server at the same time. This will involve using threads to handle the connections.
- Make the AI better than random. If you do this, explain how the AI works when you submit the assignment.
- Extra credit will also be given for especially nice user interfaces.
General Requirements
When writing your program, also be sure to:
- Put a comment at the top of your program with your name(s), the name of the program, the purpose of the program and the honor pledge.
- Put descriptive comments in your code to explain how it is working.
- Test your program thoroughly before turning it in.
Partners
For this project, you can work with a partner. You are free to choose your partner yourself. If you would like a partner but don't have one, email me and I will match you up with someone else who wants a partner.
You are also free to work alone if you prefer.
Submitting
To submit your program, email the program file to ifinlay@umw.edu.