- if (move_is_long_castle(m))
- san = "O-O-O";
- else if (move_is_short_castle(m))
- san = "O-O";
- else
- {
- if (pt != PAWN)
- {
- san += piece_type_to_char(pt);
-
- switch (move_ambiguity(pos, m)) {
- case AMBIGUITY_NONE:
- break;
- case AMBIGUITY_FILE:
- san += file_to_char(square_file(from));
- break;
- case AMBIGUITY_RANK:
- san += rank_to_char(square_rank(from));
- break;
- case AMBIGUITY_BOTH:
- san += square_to_string(from);
- break;
- default:
- assert(false);
- }
- }
-
- if (pos.move_is_capture(m))
- {
- if (pt == PAWN)
- san += file_to_char(square_file(from));
-
- san += 'x';
- }
- san += square_to_string(to);
-
- if (move_is_promotion(m))
- {
- san += '=';
- san += piece_type_to_char(move_promotion_piece(m));
- }
- }
-
- // The move gives check ? We don't use pos.move_is_check() here
- // because we need to test for mate after the move is done.
- StateInfo st;
- pos.do_move(m, st);
- if (pos.is_check())
- san += pos.is_mate() ? "#" : "+";
- pos.undo_move(m);
-
- return san;
-}
-
-
-/// pretty_pv() creates a human-readable string from a position and a PV.
-/// It is used to write search information to the log file (which is created
-/// when the UCI parameter "Use Search Log" is "true").
-
-const string pretty_pv(Position& pos, int time, int depth,
- Value score, ValueType type, Move pv[]) {