From 6a9badff9bfbbdd7f54f018d3117c1778ecaa74e Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Wed, 5 Jan 2022 22:53:00 -0500 Subject: Added comment --- src/board.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/board.c b/src/board.c index 6d4a35c..62171ff 100644 --- a/src/board.c +++ b/src/board.c @@ -54,6 +54,9 @@ enum player_color get_winner() { int white_score = 0, black_score = 0; for (int row = 0; row < 8; row++) { for (int col = 0; col < 8; col++) { + // This takes advantage of the fact that the 1 is the same thing as a true, + // and 0 is the same thing as a false. This will count the number of white + // and black spaces. white_score += (int)(board[row][col] == WHITE); black_score += (int)(board[row][col] == BLACK); } -- cgit v1.2.3