1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-13 12:39:16 +00:00

Fix some comments in position.cpp

No functional change.
This commit is contained in:
Marco Costalba 2013-09-08 06:28:53 -07:00
parent 490f67a3f8
commit 6ab8b9b6c6

View file

@ -1149,9 +1149,9 @@ void Position::clear() {
startState.epSquare = SQ_NONE; startState.epSquare = SQ_NONE;
st = &startState; st = &startState;
for (int i = 0; i < 8; i++) for (int i = 0; i < PIECE_TYPE_NB; i++)
for (int j = 0; j < 16; j++) for (int j = 0; j < 16; j++)
pieceList[0][i][j] = pieceList[1][i][j] = SQ_NONE; pieceList[WHITE][i][j] = pieceList[BLACK][i][j] = SQ_NONE;
} }
@ -1255,17 +1255,14 @@ Value Position::compute_non_pawn_material(Color c) const {
} }
/// Position::is_draw() tests whether the position is drawn by repetition /// Position::is_draw() tests whether the position is drawn by 50 moves rule
/// or the 50 moves rule. It does not detect stalemates, this must be done /// or by repetition. It does not detect stalemates.
/// by the search.
bool Position::is_draw() const { bool Position::is_draw() const {
// Draw by the 50 moves rule?
if (st->rule50 > 99 && (!checkers() || MoveList<LEGAL>(*this).size())) if (st->rule50 > 99 && (!checkers() || MoveList<LEGAL>(*this).size()))
return true; return true;
// Draw by repetition?
int i = 4, e = std::min(st->rule50, st->pliesFromNull); int i = 4, e = std::min(st->rule50, st->pliesFromNull);
if (i <= e) if (i <= e)
@ -1276,7 +1273,7 @@ bool Position::is_draw() const {
stp = stp->previous->previous; stp = stp->previous->previous;
if (stp->key == st->key) if (stp->key == st->key)
return true; return true; // Draw after first repetition
i += 2; i += 2;