There is an issue with determining winner of match, iteration up to 200 moves makes winner 'disappear', as game state gets corrupted during blank moves.
from pystockfish import *
import re
score_regex = "score \w+ -?\d+"
e1 = Engine(depth=3)
e2 = Engine(depth=12)
m = Match(engines = {"e1": e1, "e2": e2})
info = []
inc = 0
while(m.move()):
_info = e1.bestmove()["info"]
res = re.search(pattern = score_regex, string = _info)
info.append("move " + str(inc) + " " + _info[res.start():res.end()])
inc = inc + 1
for line in info:
print(line)
There is an issue with determining winner of match, iteration up to 200 moves makes winner 'disappear', as game state gets corrupted during blank moves.
part of output:
move 46 score cp -616 move 47 score cp -656 move 48 score cp -656 move 49 score cp -751 move 50 score cp -751 move 51 score mate -3 move 52 score mate -3 move 53 score mate -2 move 54 score mate -2 move 55 score mate -1 move 56 score mate -1 move 57 score mate 0 move 58 score mate 0 ...
I'll attempt to fix it sometime soon and issue a pull request