for (File f = FILE_A; f <= FILE_H; ++f)
Zobrist::enpassant[f] = rk.rand<Key>();
- for (int cr = CASTLES_NONE; cr <= ALL_CASTLES; cr++)
+ for (int cr = CASTLES_NONE; cr <= ALL_CASTLES; ++cr)
{
Bitboard b = cr;
while (b)
int emptyCnt = 1;
for ( ; file < FILE_H && empty(++sq); ++file)
- emptyCnt++;
+ ++emptyCnt;
ss << emptyCnt;
}
assert(is_ok(m));
assert(&newSt != st);
- nodes++;
+ ++nodes;
Key k = st->key;
// Copy some fields of old state to our new StateInfo object except the ones
// Increment ply counters.In particular rule50 will be later reset it to zero
// in case of a capture or a pawn move.
- gamePly++;
- st->rule50++;
- st->pliesFromNull++;
+ ++gamePly;
+ ++st->rule50;
+ ++st->pliesFromNull;
Color us = sideToMove;
Color them = ~us;
// Finally point our state pointer back to the previous state
st = st->previous;
- gamePly--;
+ --gamePly;
assert(pos_is_ok());
}
st->key ^= Zobrist::side;
prefetch((char*)TT.first_entry(st->key));
- st->rule50++;
+ ++st->rule50;
st->pliesFromNull = 0;
sideToMove = ~sideToMove;
from = from_sq(m);
to = to_sq(m);
- swapList[0] = PieceValue[MG][type_of(piece_on(to))];
+ swapList[0] = PieceValue[MG][piece_on(to)];
stm = color_of(piece_on(from));
occupied = pieces() ^ from;
// Add the new entry to the swap list
swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured];
- slIndex++;
+ ++slIndex;
// Locate and remove the next least valuable attacker
captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
// Having built the swap list, we negamax through it to find the best
// achievable score from the point of view of the side to move.
while (--slIndex)
- swapList[slIndex-1] = std::min(-swapList[slIndex], swapList[slIndex-1]);
+ swapList[slIndex - 1] = std::min(-swapList[slIndex], swapList[slIndex - 1]);
return swapList[0];
}
st = &startState;
for (int i = 0; i < PIECE_TYPE_NB; ++i)
- for (int j = 0; j < 16; j++)
+ for (int j = 0; j < 16; ++j)
pieceList[WHITE][i][j] = pieceList[BLACK][i][j] = SQ_NONE;
}
for (Square s = SQ_A1; s <= SQ_H8; ++s)
if (type_of(piece_on(s)) == KING)
- kingCount[color_of(piece_on(s))]++;
+ ++kingCount[color_of(piece_on(s))];
if (kingCount[0] != 1 || kingCount[1] != 1)
return false;