Code cleanup and fix the logic behind the player constants number
[Project_algorithmic_C.git] / lib / othello.c
index b57689483770d73f30c1203e40b77f79c8588eb9..4bbf120d6ed2da3dc6dc43e7dc720b14f9356b9a 100644 (file)
@@ -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]) {
 
 }