X-Git-Url: https://git.piment-noir.org/?p=Project_algorithmic_C.git;a=blobdiff_plain;f=lib%2Fothello.c;h=4bbf120d6ed2da3dc6dc43e7dc720b14f9356b9a;hp=b57689483770d73f30c1203e40b77f79c8588eb9;hb=a8b5457691fcb565dd185e7a623dd53eca96127c;hpb=54f1c58cef6764fdd611eedc267e7491e777c09b diff --git a/lib/othello.c b/lib/othello.c index b576894..4bbf120 100644 --- a/lib/othello.c +++ b/lib/othello.c @@ -127,6 +127,17 @@ bool is_board_full(unsigned int pawn_array[board_size][board_size]) { return true; } +unsigned int eval_winner(unsigned int nb_white, unsigned int nb_black) { + + if (nb_white > nb_black) { + return player_two; + } else if (nb_white < nb_black) { + return player_one; + } else { + return 0; + } +} + void status_pawn(int y, int x, unsigned int pawn_array[board_size][board_size]) { }