src/chess/pawn.c

changeset 193
d1420f5c5704
parent 170
bde99d803caf
child 194
619f07c95894
equal deleted inserted replaced
192:e57e2874fb2a 193:d1420f5c5704
78 } 78 }
79 } 79 }
80 80
81 size_t pawn_moves(const GameState *gamestate, 81 size_t pawn_moves(const GameState *gamestate,
82 Color c, Row r, File f, Move *moves) { 82 Color c, Row r, File f, Move *moves) {
83 (void) gamestate; /* no (theoretical) move depends on the game state */
83 size_t count = 0; 84 size_t count = 0;
84 int rowdelta = c == WHITE ? 1 : -1; 85 int rowdelta = c == WHITE ? 1 : -1;
85 int promotionrow = c == WHITE ? 7 : 0; 86 int promotionrow = c == WHITE ? 7 : 0;
86 int startrow = c == WHITE ? 1 : 6; 87 int startrow = c == WHITE ? 1 : 6;
87 const int targets[4][3] = { 88 const int targets[4][3] = {

mercurial