Connect Four

Write a game of Connect 4 that allows a human user to play against the computer with the user being x's and the computer o's. The user should go first. Add the following features for full credit: computer moves are random, the user's inputs are validated to ensure that the position is legal and not already taken, game ends when appropriate and announces who the winner was or if the game ended in a draw. The program must display the board after each player makes his move. After each game is over, the user should be asked if he would like to play again or not. If he would like to play again, the player who did not go first in the previous game should now go first in the new game. But the computer should always remain o's.

For additional credit, the game must have a pleasant interface, perhaps with the gridlines as in

x | x | o
-----------
o | x | o
-----------
x | o | x

For additional credit, you can also add "artificial intelligence" to the computer so that it blocks the user's attempts to win and is unbeatable.

This assignment will be graded on style, efficiency, and a curve based on how much "additional credit" you receive.

Your program must follow the class Coding Standards.

Preconditions:

    • None

You must hand in the following on separate pages stapled in this specified order:

    1. The source code for the ConnectFour class.
    2. Multiple printscreens of your console window output after each the following games: human win, computer win, draw.