Closed 06davber closed 9 months ago
NOTE: Python version used is CPython 3.10.6 on Windows 10.0.19044. python-chess version 1.10.0.
@06davber This line is incorrect in the perft script:
if depth == 0 or board.outcome() != None:
End-of-game nodes are not counted. The correct line is
if depth == 0:
This results in correct counts. See the first paragraph in the description of the perft test.
Apologies, my mistake.
Hi,
I wrote a short program that runs
perft()
using the move-gen of python-chess. The code can be found below.The Chessprogramming wiki has several positions available with perft results. Running
perft(4)
for Kiwipete (https://www.chessprogramming.org/Perft_Results#Position_2) incorrectly returns4085604
, when4085603
is expected.Here is the code for
perft.py
:Here is the program command line:
python perft.py 4 r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -
And here is the complete output of the program: