Skip to content

Commit 6ab8b9b

Browse files
committed
Fix some comments in position.cpp
No functional change.
1 parent 490f67a commit 6ab8b9b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/position.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,9 +1149,9 @@ void Position::clear() {
11491149
startState.epSquare = SQ_NONE;
11501150
st = &startState;
11511151

1152-
for (int i = 0; i < 8; i++)
1152+
for (int i = 0; i < PIECE_TYPE_NB; i++)
11531153
for (int j = 0; j < 16; j++)
1154-
pieceList[0][i][j] = pieceList[1][i][j] = SQ_NONE;
1154+
pieceList[WHITE][i][j] = pieceList[BLACK][i][j] = SQ_NONE;
11551155
}
11561156

11571157

@@ -1255,17 +1255,14 @@ Value Position::compute_non_pawn_material(Color c) const {
12551255
}
12561256

12571257

1258-
/// Position::is_draw() tests whether the position is drawn by repetition
1259-
/// or the 50 moves rule. It does not detect stalemates, this must be done
1260-
/// by the search.
1258+
/// Position::is_draw() tests whether the position is drawn by 50 moves rule
1259+
/// or by repetition. It does not detect stalemates.
12611260

12621261
bool Position::is_draw() const {
12631262

1264-
// Draw by the 50 moves rule?
12651263
if (st->rule50 > 99 && (!checkers() || MoveList<LEGAL>(*this).size()))
12661264
return true;
12671265

1268-
// Draw by repetition?
12691266
int i = 4, e = std::min(st->rule50, st->pliesFromNull);
12701267

12711268
if (i <= e)
@@ -1276,7 +1273,7 @@ bool Position::is_draw() const {
12761273
stp = stp->previous->previous;
12771274

12781275
if (stp->key == st->key)
1279-
return true;
1276+
return true; // Draw after first repetition
12801277

12811278
i += 2;
12821279

0 commit comments

Comments
 (0)