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:
Julia Lange 2024-07-15 18:57:53 -07:00
parent 28a3188ea3
commit b3b369a076
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
7 changed files with 142 additions and 20 deletions

9
main.c
View file

@ -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;
}