results announce

This commit is contained in:
Odweta
2026-02-17 17:15:08 +01:00
parent b61453e266
commit 0816eaae24
3 changed files with 33 additions and 5 deletions
+31 -3
View File
@@ -71,8 +71,36 @@ bool get_move(move_t *move) {
return is_move_in_bounds(*move);
}
bool perform_move(player_e player, move_t move);
bool perform_move(player_e player, move_t move) {
end_condition_e check_edge_cases(board_t board);
}
void announce_results(player_e player);
end_condition_e check_edge_cases(board_t board) {
}
void announce_results(end_condition_e end_condition, player_e player) {
printf("The game has ended because of a ");
switch (end_condition) {
case CHECKMATE:
printf("CHECKMATE");
break;
case STALEMATE:
printf("STALEMATE");
break;
}
printf("\nand the player who has won is");
switch (player) {
case WHITE:
printf(" WHITE");
break;
case BLACK:
printf(" BLACK");
break;
}
printf("! Congratulations.\n");
}