sshivaji / polyglot

Polyglot chess opening book program
GNU General Public License v2.0
22 stars 16 forks source link

Fix zero byte book produced by "polyglot make-book" #3

Open selliott512 opened 3 years ago

selliott512 commented 3 years ago

I don't quite understand the intent of the commit in question, but I do know that it breaks polyglot make-book in latest master, which means that polyglot make-book is broken in at least Fedora 33.

To reproduce:

polyglot make-book -pgn fools-mate.pgn -bin fools-mate.bin -min-game 1

which produces a 80 byte file with this fix, and zero byte otherwise. The problem has to do with entries incorrectly being filtered. Consider these two output lines in the 80 byte fixed case:

filtering entries ...
5 entries.

and in the zero byte broken case:

filtering entries ...
0 entries.

This merge request probably isn't suitable as is, but it's at least a starting point for people trying to figure out polyglot make-book on Linux.

Also, I included a .gitignore - all of the *.o files show up as untracked files otherwise.

The fools-mate.pgn mentioned above:

[Event "Black wins"]
[Site "cube"]
[Date "2020.12.15"]
[Round "-"]
[White "-"]
[Black "-"]
[Result "0-1"]

1. f3 e6 2. g4 Qh4# 0-1

[Event "White wins"]
[Site "cube"]
[Date "2020.12.15"]
[Round "-"]
[White "-"]
[Black "-"]
[Result "1-0"]

1. e4 f6 2. d4 g5 3. Qh5# 1-0