operator[]('B') = WB; operator[]('b') = BB;
operator[]('N') = WN; operator[]('n') = BN;
operator[]('P') = WP; operator[]('p') = BP;
operator[]('B') = WB; operator[]('b') = BB;
operator[]('N') = WN; operator[]('n') = BN;
operator[]('P') = WP; operator[]('p') = BP;
/// Position::print() prints an ASCII representation of the position to
/// the standard output. If a move is given then also the san is print.
/// Position::print() prints an ASCII representation of the position to
/// the standard output. If a move is given then also the san is print.
// Check for reentrancy, as example when called from inside
// MovePicker that is used also here in move_to_san()
// Check for reentrancy, as example when called from inside
// MovePicker that is used also here in move_to_san()
- string col = (color_of_piece_on(move_from(m)) == BLACK ? ".." : "");
- cout << "Move is: " << col << move_to_san(p, m) << endl;
+ string dd = (color_of_piece_on(move_from(move)) == BLACK ? ".." : "");
+ cout << "\nMove is: " << dd << move_to_san(p, move);
for (File file = FILE_A; file <= FILE_H; file++)
{
Square sq = make_square(file, rank);
for (File file = FILE_A; file <= FILE_H; file++)
{
Square sq = make_square(file, rank);
- char col = (color_of_piece_on(sq) == BLACK ? '=' : ' ');
- cout << '|' << col << pieceLetters[piece] << col;
+ if (piece == NO_PIECE && square_color(sq) == DARK)
+ piece = NO_PIECE_DARK_SQ;
+
+ cout << c << pieceLetters.from_piece(piece) << c << '|';
- cout << "+---+---+---+---+---+---+---+---+" << endl
- << "Fen is: " << to_fen() << endl
- << "Key is: " << st->key << endl;
-
- RequestPending = false;
+ cout << dottedLine << "Fen is: " << to_fen() << "\nKey is: " << st->key << endl;
+ requestPending = false;
assert(to == ep_square());
assert(piece_on(from) == piece_of_color_and_type(us, PAWN));
assert(piece_on(capsq) == piece_of_color_and_type(them, PAWN));
assert(to == ep_square());
assert(piece_on(from) == piece_of_color_and_type(us, PAWN));
assert(piece_on(capsq) == piece_of_color_and_type(them, PAWN));
// Update piece lists, note that index[from] is not updated and
// becomes stale. This works as long as index[] is accessed just
// Update piece lists, note that index[from] is not updated and
// becomes stale. This works as long as index[] is accessed just
assert(to == st->epSquare);
assert(relative_rank(opposite_color(them), to) == RANK_6);
assert(to == st->epSquare);
assert(relative_rank(opposite_color(them), to) == RANK_6);
// Update board array
Piece king = piece_of_color_and_type(us, KING);
Piece rook = piece_of_color_and_type(us, ROOK);
// Update board array
Piece king = piece_of_color_and_type(us, KING);
Piece rook = piece_of_color_and_type(us, ROOK);
do_move_bb(&(byTypeBB[0]), move_bb); // HACK: byTypeBB[0] == occupied squares
board[from] = piece_of_color_and_type(us, pt);
do_move_bb(&(byTypeBB[0]), move_bb); // HACK: byTypeBB[0] == occupied squares
board[from] = piece_of_color_and_type(us, pt);
board[rfrom] = piece_of_color_and_type(us, ROOK);
board[kfrom] = piece_of_color_and_type(us, KING);
board[rfrom] = piece_of_color_and_type(us, ROOK);
board[kfrom] = piece_of_color_and_type(us, KING);
Square capQq = (side_to_move() == WHITE)? (to - DELTA_N) : (to - DELTA_S);
capture = piece_on(capQq);
Square capQq = (side_to_move() == WHITE)? (to - DELTA_N) : (to - DELTA_S);
capture = piece_on(capQq);
memset(byColorBB, 0, sizeof(Bitboard) * 2);
memset(byTypeBB, 0, sizeof(Bitboard) * 8);
memset(byColorBB, 0, sizeof(Bitboard) * 2);
memset(byTypeBB, 0, sizeof(Bitboard) * 8);
memset(index, 0, sizeof(int) * 64);
for (int i = 0; i < 64; i++)
memset(index, 0, sizeof(int) * 64);
for (int i = 0; i < 64; i++)
/// Position::put_piece() puts a piece on the given square of the board,
/// updating the board array, bitboards, and piece counts.
/// Position::put_piece() puts a piece on the given square of the board,
/// updating the board array, bitboards, and piece counts.