test
function that contains examples of the use of many of the objects of the library. You can find another small example hereThis is an individual assignment. You may discuss high-level concepts with other students but all submitted materials should be your own. Please keep the Academic Integrity Policy in mind---do not show your code to anyone outside of the professors and do not look at anyone else's code for this lab.
The main goal of this lab is to gain practice top-down design while implementing a game of Connect Four.
First, you should make a plan of what the main
function should do, assume that each big step is going to be a function call, then recursively make your plans for each functions until you get to functions that can be implemented without any big steps.
Remember that each function should be kept short, and all the 'thinking' in each function should be on the same level. Do not hesitate to push some of the work down into calls to other functions. Read the list of specifications carefully, points will be taken off if you do not respect all directives.
You need to implement a game of Connect Four. When run, program should play one game of Connect Four, and at the end of each game, ask the user(s) if they want to play another game. The user should be able to play the entire game using mouse clicks only.
Once per turn, the game invite the player to select one of the column in which to insert their token. The graphic of the game should make it clear where the user should click to place their token in the correct column. After placing the token on the board, the game should scan the board to determine if the game is over, and if not, move to the next turn.
At the end of the game, the program should print a message congratulating the victor if someone won, or announce a draw if no one won, then ask the players if they want to play another game.
Your code should respect the following rules:
You should hand in a written plan that describes the steps you will execute in each of your functions at a high level, together with a sketch (tree structure) that shows the dependencies between the functions.
The implementation of the game should be submitted on onCourse before 11:59pm, Monday February 10.