src/chess/rules.c

changeset 133
c58ae152733e
parent 131
c33567d61ba7
child 135
114e764fbae5
--- a/src/chess/rules.c	Sun Jun 07 16:56:22 2026 +0200
+++ b/src/chess/rules.c	Fri Jun 12 13:34:35 2026 +0200
@@ -78,6 +78,10 @@
     return simulation;
 }
 
+uint8_t current_color(GameState *gamestate) {
+    return (gamestate->movecount % 2 == 0) ? WHITE : BLACK;
+}
+
 /* MUST be called BETWEEN validating AND applying a move to work correctly */
 static void format_move(GameState *gamestate, Move *move) {
     char *string = &(move->string[0]);

mercurial