Changes

Jump to: navigation, search

Perft

15 bytes removed, 04:50, 25 April 2020
Bulk-counting
==Bulk-counting==
Instead Assuming the above code used a legal move generator, it could improve speed significantly: instead of counting nodes at "depth 0", legal move generators can take advantage of the fact that the number of moves generated at "depth 1" represents the accurate perft value for that branch. Therefore they can skip the last [[Make Move|makemove]]/[[Unmake Move|undomove]], which gives much faster results and is a better indicator of the raw move generator speed (versus move generator + make/unmake). However, this can cause some confusion when comparing perft values. Assuming the above code used a legal move generator, it would only need the following modification.
<pre>
n_moves = GenerateLegalMoves(move_list);
for (i = 0; i < n_moves; i++) {
'''if (depth == 1) nodes++;'''
else {
MakeMove(move_list[i]);

Navigation menu