Add Horizontal and Vertical win checking
Adds horizontal and vertical win checking, as well as tests for such features. Adds valgrind to the flake.nix Adds test_connect4 option to Makefile
This commit is contained in:
parent
28a3188ea3
commit
b3b369a076
7 changed files with 142 additions and 20 deletions
9
main.c
9
main.c
|
|
@ -5,12 +5,13 @@
|
|||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct Board *my_board = make_board(6, 7);
|
||||
while (1) {
|
||||
int drop_spot = 0;
|
||||
do {
|
||||
print_board(my_board);
|
||||
int drop_spot = 0;
|
||||
printf("Where to drop? ");
|
||||
scanf("%d",&drop_spot);
|
||||
drop_tile(my_board, drop_spot-1);
|
||||
}
|
||||
} while (!drop_tile(my_board, drop_spot-1));
|
||||
print_board(my_board);
|
||||
printf("Congratulations!");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue