src/chess/rules.c

changeset 133
c58ae152733e
parent 131
c33567d61ba7
child 135
114e764fbae5
equal deleted inserted replaced
132:5762f2b5f87a 133:c58ae152733e
74 simulation.moves[0] = last_move(gamestate); 74 simulation.moves[0] = last_move(gamestate);
75 simulation.movecount++; 75 simulation.movecount++;
76 } 76 }
77 77
78 return simulation; 78 return simulation;
79 }
80
81 uint8_t current_color(GameState *gamestate) {
82 return (gamestate->movecount % 2 == 0) ? WHITE : BLACK;
79 } 83 }
80 84
81 /* MUST be called BETWEEN validating AND applying a move to work correctly */ 85 /* MUST be called BETWEEN validating AND applying a move to work correctly */
82 static void format_move(GameState *gamestate, Move *move) { 86 static void format_move(GameState *gamestate, Move *move) {
83 char *string = &(move->string[0]); 87 char *string = &(move->string[0]);

mercurial