X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsan.cpp;h=0e9b531003cb9c69595b84ee6540aec4d0689532;hp=0429830c37c7baa6fca2429511fda84749fbf5a7;hb=18cd83a38042a3993678e88bc8163ceb1cbd62b4;hpb=e1ed67aacbe7fb4b462b9141d3137bed0a3ea70b diff --git a/src/san.cpp b/src/san.cpp index 0429830c..0e9b5310 100644 --- a/src/san.cpp +++ b/src/san.cpp @@ -28,6 +28,7 @@ #include #include +#include "history.h" #include "movepick.h" #include "san.h" @@ -39,8 +40,6 @@ using std::string; namespace { - /// Types - enum Ambiguity { AMBIGUITY_NONE, AMBIGUITY_FILE, @@ -48,8 +47,7 @@ namespace { AMBIGUITY_BOTH }; - - /// Functions + const History H; // used as dummy argument for MovePicker c'tor Ambiguity move_ambiguity(const Position& pos, Move m); const string time_string(int milliseconds); @@ -115,10 +113,10 @@ const string move_to_san(const Position& pos, Move m) { san += "x"; } san += square_to_string(move_to(m)); - if (move_promotion(m)) + if (move_is_promotion(m)) { san += '='; - san += piece_type_to_char(move_promotion(m), true); + san += piece_type_to_char(move_promotion_piece(m), true); } } // Is the move check? We don't use pos.move_is_check(m) here, because @@ -143,7 +141,7 @@ Move move_from_san(const Position& pos, const string& movestr) { assert(pos.is_ok()); - MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly); + MovePicker mp = MovePicker(pos, MOVE_NONE, OnePly, H); // Castling moves if (movestr == "O-O-O" || movestr == "O-O-O+") @@ -275,7 +273,7 @@ Move move_from_san(const Position& pos, const string& movestr) { while ((m = mp.get_next_move()) != MOVE_NONE) if ( pos.type_of_piece_on(move_from(m)) == pt && move_to(m) == to - && move_promotion(m) == promotion + && move_promotion_piece(m) == promotion && (fromFile == FILE_NONE || fromFile == square_file(move_from(m))) && (fromRank == RANK_NONE || fromRank == square_rank(move_from(m)))) { @@ -327,14 +325,15 @@ const string line_to_san(const Position& pos, Move line[], int startColumn, bool /// when the UCI parameter "Use Search Log" is "true"). const string pretty_pv(const Position& pos, int time, int depth, - uint64_t nodes, Value score, Move pv[]) { + uint64_t nodes, Value score, ValueType type, Move pv[]) { std::stringstream s; // Depth s << std::setw(2) << depth << " "; // Score - s << std::setw(8) << score_string(score); + s << ((type == VALUE_TYPE_LOWER)? ">" : ((type == VALUE_TYPE_UPPER)? "<" : " ")); + s << std::setw(7) << score_string(score); // Time s << std::setw(8) << time_string(time) << " "; @@ -367,7 +366,7 @@ namespace { if (type_of_piece(pc) == KING) return AMBIGUITY_NONE; - MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly); + MovePicker mp = MovePicker(pos, MOVE_NONE, OnePly, H); Move mv, moveList[8]; int n = 0;