src/chess/pawn.c

changeset 170
bde99d803caf
parent 169
9962f5d98764
equal deleted inserted replaced
169:9962f5d98764 170:bde99d803caf
76 return piece_at(gamestate, mdst(move)) || 76 return piece_at(gamestate, mdst(move)) ||
77 gamestate->board[(move->fromrow+move->torow)/2][move->tofile]; 77 gamestate->board[(move->fromrow+move->torow)/2][move->tofile];
78 } 78 }
79 } 79 }
80 80
81 size_t pawn_moves(GameState *gamestate, Color c, Row r, File f, Move *moves) { 81 size_t pawn_moves(const GameState *gamestate,
82 Color c, Row r, File f, Move *moves) {
82 size_t count = 0; 83 size_t count = 0;
83 int rowdelta = c == WHITE ? 1 : -1; 84 int rowdelta = c == WHITE ? 1 : -1;
84 int promotionrow = c == WHITE ? 7 : 0; 85 int promotionrow = c == WHITE ? 7 : 0;
85 int startrow = c == WHITE ? 1 : 6; 86 int startrow = c == WHITE ? 1 : 6;
86 const int targets[4][3] = { 87 const int targets[4][3] = {

mercurial