nodes = 0;
}
-Position::Position(const string& fen, int th) {
+Position::Position(const string& fen, bool isChess960, int th) {
- from_fen(fen);
+ from_fen(fen, isChess960);
threadID = th;
}
/// string. This function is not very robust - make sure that input FENs are
/// correct (this is assumed to be the responsibility of the GUI).
-void Position::from_fen(const string& fen) {
+void Position::from_fen(const string& fen, bool c960) {
/*
A FEN string defines a particular position using only the ASCII character set.
castleRightsMask[make_square(initialQRFile, RANK_1)] ^= WHITE_OOO;
castleRightsMask[make_square(initialQRFile, RANK_8)] ^= BLACK_OOO;
+ isChess960 = c960;
find_checkers();
st->key = compute_key();
/// Position::to_fen() returns a FEN representation of the position. In case
/// of Chess960 the Shredder-FEN notation is used. Mainly a debugging function.
-const string Position::to_fen(bool isChess960) const {
+const string Position::to_fen() const {
string fen;
Square sq;
cout << c << pieceLetters.from_piece(piece) << c << '|';
}
}
- bool chess960 = (cout.iword(0) != 0); // See set960()
- cout << dottedLine << "Fen is: " << to_fen(chess960) << "\nKey is: " << st->key << endl;
+ cout << dottedLine << "Fen is: " << to_fen() << "\nKey is: " << st->key << endl;
requestPending = false;
}
case WB: case BB: return attacks_from<BISHOP>(s);
case WR: case BR: return attacks_from<ROOK>(s);
case WQ: case BQ: return attacks_from<QUEEN>(s);
- default: return StepAttackBB[p][s];
+ default: return NonSlidingAttacksBB[p][s];
}
}
case WB: case BB: return bishop_attacks_bb(s, occ);
case WR: case BR: return rook_attacks_bb(s, occ);
case WQ: case BQ: return bishop_attacks_bb(s, occ) | rook_attacks_bb(s, occ);
- default: return StepAttackBB[p][s];
+ default: return NonSlidingAttacksBB[p][s];
}
}