## Requirement 1

Repeat the mat_add problem from homework 3. Write a program called mat_add.c that asks the user for 2 matrices A, and B, and displays their sum, C.

1. Name your executable mat_add.out
2. All numbers entered will be integers
3. All matrices will be valid
4. Changes
There is now no max size for each matrix.
You must dynamically allocate space for all arrays used.
This means you must use malloc to create your arrays.
int A[rows][cols] will not be accepted
5. Each row of the matrix will be entered 1 line at a time
6. The formula for calculating C[i][j] is C[i][j]=A[i][j]+B[i][j]
7. Examples:

## Requirement 2

Write a program to implement the game connect-n. Connect-n is like Connect-4 except instead of having the board be a constant 6 X 7 we will allow the user to enter the size of the board they would like to play on. In addition we will also allow the user to choose how many pieces in a row are necessary to win. The game is played as follows. Two players take turns dropping their pieces into a column until either player gets N of their pieces in a row either horizontally, vertically, or diagonally, or until their or no more spaces to play.

1. Your program must accept 3 command line parameters in this order: number of rows, number of columns, number of pieces in a row to win
If the user does not enter enough arguments or enters too many arguments your program should tell them the proper usage of your program and terminate.
You may find the exit function helpful.
The user should be allowed to create an unwinable game.
For example a board that is 3 X 3 but requires 4 pieces in a row to win.
2. Your program should not allow the user to make an impossible play but should continue to ask the user for a play until a valid play is entered
Invalid plays consist of plays made outside the board or in to columns that are already full.
3. The token used to represent Player 1 is X
4. The token used to represent Player 2 is O, a capitol oh and not a zero
5. After the game is over the winner should be declared or if there is no winner a tie should be declared
6. You must split your code up into at least 2 files.
I personally had 4 separate c files
7. You must submit a make file named Makefile that when run compiles your program
8. The executable created by your make file should be named connectn.out
9. Hints
This is your first “large” program. It took me around 300 lines of code to complete. You will want to break your problem down into many small manageable functions to make the problem easier to deal with.
I also recommend testing each function your write as you go along to help you locate your errors early
I had the following functions defined in my solution and they give a pretty good ordering of how you should write you should solve this problem
read_args
create_board, print_board, destroy board
play_game, get_play, play_is_valid
game_over, game_won, row_win, col_win, diag_win, right_diag_win, left_diag_win.
10. Examples