Starting from:
$35

$29

Programming Assignment #5 Solution

Programs are to be submitted to Gradescope by the due date. You may work alone or in groups of two. Programs submitted up to 24 hours late will still be accepted but incur a 10% grade penalty. Uploading your programs to gradescope will immediately score your submission.




Your program grade will be the score of the last submission that you have uploaded.

Programs must compile using gcc -Wall without any warnings. Each program that compiles with a warning will incur a 10% grade penalty. Each program will have 5 seconds to compile and run test cases on gradescope.







Problem 1: connectfour (100 points, 9 per test case, 10 pts for Makefile)




In this problem you will write a program that plays connect four. The program should start by asking the user for the dimensions of the board. Two players proceed by dropping coins into the columns. Coins fall to the bottom, and if a player has 4 coins in a row (horizontally, vertically, or diagonally), then that player wins the game. See http://www. connectfour.org/connect-4-online.php if you are unfamiliar with the game.




Skeleton code has been written for you, though you do not need to use it. If you use the skeleton code, you should define the body of main and the body of the functions in gameboard.c. For example output, see example*.txt.

Files to turn in:




connectfour.c



gameboard.c



gameboard.h



Makefile



We must be able to create your code on the command line using make.































1

More products