The problem asks me to create a c++ version of the Connect4 game. This game must:
- Include a readme.txt file in the directory with the cpp
- CLI args will be used to determine [players] [x len] [y len]
- Will print the grid with numbers across the top
- 1 or 2 player functionality
More requirements (credit: Justin Goins, Canvas):
- Your program must display the updated game grid after each move.
- If a winner exists, the program must immediately declare the winner and ask if the player(s) want to play again.
- If no more moves are possible and no winner exists (i.e. the entire grid is full of tokens), the program must declare the game a tie and then prompt the player(s) to start a new game.
- Print an error message and recover when the player supplies an invalid column. This could be a column that doesn’t exist (“Cat”, -4, 142, etc) or it could be a column that is already full of tokens.
- For this program you must validate the incoming command line arguments and ensure that each of the three values is a non-negative number. If an invalid value is provided (negative number, floating point number, text string, etc) then the program must halt execution and display a message to indicate the problem.
- Play the game correctly based on rules and number of players.
- Continue to play until the user selects no.
- You must not have any global variables
- You must use a dynamic 2-dimensional array to represent the grid of tokens.
- The computer player must follow the rules of the game and can only drop tokens in columns that have at least one open space.
- Your functions need to focus on performing a particular task. In other words, you need to use good modular design. If your function uses more than about 20 lines of code, this may be an indication that the code should be split into multiple functions. If the TA notices that your code is not sufficiently modular, you will lose points.
- You must not have memory leaks.
- Segmentation faults are not allowed (e.g. your program crashes).