X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbook.cpp;h=fbbc3fee3998c5723574743348faf68201187912;hp=e523bf4a18419f4bd9a1da9b2e6ec8293b84c174;hb=86c20416c85ac93ab982dda404fc268a92636fa6;hpb=13a73f67c018e58b2fd46f886c45ef2b75188c8e diff --git a/src/book.cpp b/src/book.cpp index e523bf4a..fbbc3fee 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2013 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2008-2014 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,8 +35,8 @@ using namespace std; namespace { // A Polyglot book is a series of "entries" of 16 bytes. All integers are - // stored in big-endian format, with highest byte first (regardless of size). - // The entries are ordered according to the key in ascending order. + // stored in big-endian format, with the highest byte first (regardless of + // size). The entries are ordered according to the key in ascending order. struct Entry { uint64_t key; uint16_t move; @@ -326,10 +326,10 @@ namespace { while (b) { Square s = pop_lsb(&b); - Piece p = pos.piece_on(s); + Piece pc = pos.piece_on(s); // PolyGlot pieces are: BP = 0, WP = 1, BN = 2, ... BK = 10, WK = 11 - key ^= PG.Zobrist.psq[2 * (type_of(p) - 1) + (color_of(p) == WHITE)][s]; + key ^= PG.Zobrist.psq[2 * (type_of(pc) - 1) + (color_of(pc) == WHITE)][s]; } b = pos.can_castle(ANY_CASTLING); @@ -372,7 +372,7 @@ template<> PolyglotBook& PolyglotBook::operator>>(Entry& e) { /// open() tries to open a book file with the given name after closing any -/// exsisting one. +/// existing one. bool PolyglotBook::open(const char* fName) { @@ -410,9 +410,9 @@ Move PolyglotBook::probe(const Position& pos, const string& fName, bool pickBest best = max(best, e.count); sum += e.count; - // Choose book move according to its score. If a move has a very - // high score it has higher probability to be choosen than a move - // with lower score. Note that first entry is always chosen. + // Choose book move according to its score. If a move has a very high + // score it has a higher probability of being choosen than a move with + // a lower score. Note that first entry is always chosen. if ( (!pickBest && sum && rkiss.rand() % sum < e.count) || (pickBest && e.count == best)) move = Move(e.move);