src/rules/pawn.c

changeset 12
84880c7e1ea6
parent 10
1347e4dabac0
child 14
970748b9a73b
equal deleted inserted replaced
11:08d7a6e3ec31 12:84880c7e1ea6
40 } 40 }
41 41
42 _Bool pawn_getlocation(Board board, Move *move) { 42 _Bool pawn_getlocation(Board board, Move *move) {
43 int8_t d = ((move->piece & COLOR_MASK) == WHITE ? -1 : 1); 43 int8_t d = ((move->piece & COLOR_MASK) == WHITE ? -1 : 1);
44 44
45 // TODO: battle moves
46
45 move->fromfile = move->tofile; 47 move->fromfile = move->tofile;
46 move->fromrow = move->torow + d; 48 move->fromrow = move->torow + d;
47 if (move->fromrow > 6) { 49 if (move->fromrow > 6) {
48 return FALSE; 50 return FALSE;
49 } else { 51 } else {

mercurial