From f8fe4e3920f24c074a08c9e32c3bf240c16c39bb Mon Sep 17 00:00:00 2001 From: Anthony <bouillant.anthony@gmail.com> Date: Fri, 4 Apr 2025 11:09:48 +0200 Subject: [PATCH] Small adjustments --- puissance4.c | 2 +- src/board/board.c | 3 --- src/board/test_board.h | 5 +++++ src/computer/test_computer.h | 5 +++++ src/game/game.h | 4 ++-- src/game/test_game.h | 5 +++++ 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/puissance4.c b/puissance4.c index 78e3ce1..45b15bb 100644 --- a/puissance4.c +++ b/puissance4.c @@ -24,7 +24,7 @@ bool validate_arguments(char const* argv[], int* game_mode, int* row_count, int* int main(int argc, char const* argv[]) { if (argc != 4) { print_usage(argv[0]); - return false; + return EXIT_FAILURE; } int game_mode, row_count, col_count; diff --git a/src/board/board.c b/src/board/board.c index 8abebe6..18e751e 100644 --- a/src/board/board.c +++ b/src/board/board.c @@ -19,13 +19,10 @@ int destroy_board(int rows, int** board) { void print_board(int rows, int cols, int** board) { for (int row = -1; row <= rows; row++) { if (row == -1) { - // Top border of the board printf("\nā"); } else if (row == rows) { - // Bottom border of the board printf("ā"); } else { - // Print left vertical border printf("ā"); } diff --git a/src/board/test_board.h b/src/board/test_board.h index 4e2d839..542c4d5 100644 --- a/src/board/test_board.h +++ b/src/board/test_board.h @@ -1,6 +1,11 @@ #ifndef _TEST_BOARD_H_ #define _TEST_BOARD_H_ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <string.h> + #include "board.h" #include "../test_puissance4.h" diff --git a/src/computer/test_computer.h b/src/computer/test_computer.h index 75997aa..a56c483 100644 --- a/src/computer/test_computer.h +++ b/src/computer/test_computer.h @@ -1,6 +1,11 @@ #ifndef _TEST_COMPUTER_H_ #define _TEST_COMPUTER_H_ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <string.h> + #include "computer.h" #include "../game/game.h" #include "../test_puissance4.h" diff --git a/src/game/game.h b/src/game/game.h index f550bf2..efe0c76 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -1,5 +1,5 @@ -#ifndef _GAME_H -#define _GAME_H +#ifndef _GAME_H_ +#define _GAME_H_ #include <stdbool.h> #include <stdio.h> diff --git a/src/game/test_game.h b/src/game/test_game.h index 2e775af..b2ba51c 100644 --- a/src/game/test_game.h +++ b/src/game/test_game.h @@ -1,6 +1,11 @@ #ifndef _TEST_GAME_H_ #define _TEST_GAME_H_ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <string.h> + #include "game.h" #include "../computer/computer.h" #include "../test_puissance4.h" -- GitLab