Topic: Connect 4
Turn In: Printed Copy of Source File “Connect 4.cpp” and Summit it on EASE
The goal of this assignment is to get you, the student, back in the programming grove. If you feel that this assignment is too simple, just wait, I promise to challenge you in the future. If you feel that this assignment is too difficult please come to talk to me about your programming background. I want to make sure you are enrolled in the proper level programming course.
The game is played on a 7 column by 6 row board. Two players play by alternately dropping a chip down one of the columns. The chip drops to the lowest unoccupied spot in that column. The first player to get four chips in a row, vertical, horizontal, or diagonal, wins. The game ends in a stalemate when the board is filled with chips and nether player has 4 chips in a row.
You are expected to write a C++ console application. I will be grading your project in Windows XP using the Microsoft .NET 7.0 IDE. Be sure to test your program in this environment before submitting it. If you do not have the same environment and or platform on your personal computer please be sure it works in the Alltel lab before submitting it.
There are two players. The players should be named ‘A’ and ‘B’. An ‘A’ should be used to represent player A’s chips and a ‘B’ should be used to represent player B’s chips. Player A should be allowed to play first then player B.
Empty slots should be represented by a capital letter ‘O’.
When the board is empty it should be displayed as follows.
When the board has one chip added to each of the first two columns it should be displayed as follows.
After displaying the game board, skip 1 line then prompt the player as follows.
Player A’s turn. Select a column.
Player B’s turn. Select a column.
The player should then be required to enter a valid column and hit enter.
If the player selects a valid column that is not full:
The proper chip should be added to that row.
The board should be displayed.
The next player should be prompted for their move.
If the player selects an invalid column or one that is full:
The user should receive the error message as follows:
Invalid or full column
The user should then be prompted again for a move.
The game should detect when a player has won then display the message:
Congratulations, A wins!
Congratulations, B wins!
The game should detect if a stalemate occurs then display the message:
The game should not ask the user to play again.
No other functionality should be added to the game.