X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Fothello.c;h=72066a0fc46cee8c17507606610f6dd38cb5e53a;hb=024eee101495f70da0c1b27fd0e29ee18acdbfd3;hp=cbc7e4f4b8f27c6baffa42552f0a9bc66d8c9b97;hpb=5ec791f6f2aef3f10c615eb4a336fc6282ebb8d9;p=Project_algorithmic_C.git diff --git a/lib/othello.c b/lib/othello.c index cbc7e4f..72066a0 100644 --- a/lib/othello.c +++ b/lib/othello.c @@ -42,7 +42,7 @@ unsigned int current_player(unsigned int round_count) { * @param current_player current round player * @return current round opponent integer */ -unsigned int current_opponent(unsigned int current_player) { +static unsigned int current_opponent(unsigned int current_player) { if (current_player == player_one) { return player_two; @@ -98,7 +98,7 @@ static bool is_valid_coordinates(int y, int x) { * @param y [description] * @param x [description] * @param type [description] - * @param [name] [description] + * @param pawn_array [description] */ void set_pawn(int y, int x, unsigned int type, unsigned int pawn_array[board_size][board_size]) { @@ -206,7 +206,7 @@ unsigned int eval_winner(unsigned int nb_white, unsigned int nb_black) { } } -static unsigned int count_pawn_to_reverse_one_direction(int y, int x, int direction, unsigned int current_player, unsigned int pawn_array[board_size][board_size]) { +static unsigned int count_pawn_to_reverse_one_direction(int y, int x, unsigned int direction, unsigned int current_player, unsigned int pawn_array[board_size][board_size]) { unsigned int nb_pawns_reversed = 0; int moving_y = y, moving_x = x; @@ -226,7 +226,7 @@ static unsigned int count_pawn_to_reverse_one_direction(int y, int x, int direct } /* revert the pawns if needed in one direction */ -static unsigned int reverse_one_direction(int y, int x, int direction, unsigned int current_player, unsigned int pawn_array[board_size][board_size], bool dry_run) { +static unsigned int reverse_one_direction(int y, int x, unsigned int direction, unsigned int current_player, unsigned int pawn_array[board_size][board_size], bool dry_run) { unsigned int nb_pawns_reversed = 0; int moving_y = y, moving_x = x; @@ -281,7 +281,7 @@ unsigned int valid_shot(int y, int x, unsigned int current_player, unsigned int return nb_pawns_reversed; } -static void add_shots_list_cell(int y, int x, unsigned int type, struct shots_list_s* shots_list) { +static void add_shots_list_cell(unsigned int y, unsigned int x, unsigned int type, struct shots_list_s* shots_list) { struct shots_list_s* list_cell = (struct shots_list_s*)malloc(sizeof(struct shots_list_s)); if (!list_cell) { exit(EXIT_FAILURE); @@ -303,7 +303,6 @@ void free_shots_list(struct shots_list_s* shots_list) { list_del(&(list_counter->list)); free(list_counter); } - } void build_playable_shots_list(unsigned int current_player, struct shots_list_s* shots_list, unsigned int pawn_array[board_size][board_size]) {