return from == SQ_E1 ? "e1c1" : "e8c8";
if (move_is_promotion(m))
- promotion = char(tolower(piece_type_to_char(move_promotion_piece(m))));
+ promotion = char(tolower(piece_type_to_char(promotion_piece_type(m))));
return square_to_string(from) + square_to_string(to) + promotion;
}
Move move_from_uci(const Position& pos, const string& str) {
- MoveStack mlist[MAX_MOVES];
- MoveStack* last = generate<MV_LEGAL>(pos, mlist);
-
- for (MoveStack* cur = mlist; cur != last; cur++)
- if (str == move_to_uci(cur->move, pos.is_chess960()))
- return cur->move;
+ for (MoveList<MV_LEGAL> ml(pos); !ml.end(); ++ml)
+ if (str == move_to_uci(ml.move(), pos.is_chess960()))
+ return ml.move();
return MOVE_NONE;
}
bool ambiguousMove, ambiguousFile, ambiguousRank;
Square sq, from = move_from(m);
Square to = move_to(m);
- PieceType pt = pos.type_of_piece_on(from);
+ PieceType pt = piece_type(pos.piece_on(from));
string san;
if (m == MOVE_NONE)
if (move_is_promotion(m))
{
san += '=';
- san += piece_type_to_char(move_promotion_piece(m));
+ san += piece_type_to_char(promotion_piece_type(m));
}
}