repositories
/
Project_algorithmic_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code cleanup and fix the logic behind the player constants number
[Project_algorithmic_C.git]
/
lib
/
othello.c
diff --git
a/lib/othello.c
b/lib/othello.c
index b57689483770d73f30c1203e40b77f79c8588eb9..4bbf120d6ed2da3dc6dc43e7dc720b14f9356b9a 100644
(file)
--- 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;
}
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]) {
}
void status_pawn(int y, int x, unsigned int pawn_array[board_size][board_size]) {
}