kervinck / chessmoves

Python C extension for chess move and position generation (SAN/FEN/UCI)
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

A call to chessmoves.moves(...) is loosing counts for both `Halfmove clock` and `Fullmove number` #1

Closed lu4 closed 4 years ago

lu4 commented 6 years ago

Hi, I'm trying to use your chessmoves project to create a chess AI, unfortunately the library is loosing counts for for Halfmove clock and Fullmove number (names picked according to wiki article https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) that are used to guarantee 50/75 move rule. Which means that such an AI will not be limited by that rule and will expect a play after 50 inactive moves. I'm able to identify a pawn move or a capture externally but it seems that it would be more reasonable to perform a fix in a lib. So is there a way that you could point out where to look for a problem in the project in order to fix it. I would be glad to provide PR with a fix.

Thank you in advance

kervinck commented 6 years ago

Yes, it emits 4-field EPD without support for operations, and not 6-field FEN. https://chessprogramming.wikispaces.com/Extended+Position+Description

This is in fact the first open issue in TODO before calling it "v1.0", but I never needed it and nobody asked. My idea was to detect and accept the 2 extra fields as optional, and in that case also emit them (but otherwise don't emit).

I work on other projects now but I still use this module for continuous opening book preparation at https://marcelk.net/bookie/live.html There is some commented code around the 'lastZeroing' variable. That is not finished, but it is a start.

lu4 commented 6 years ago

Ok, I see, thank you! Looking into it...

kervinck commented 6 years ago

I'm afraid I won't be able to pay close attention or even test anything soon. But I will be happy to merge once it looks both good and simple, and preserves compatibility (by making these fields optional as I mentioned). Good luck!

kervinck commented 4 years ago

No follow-up received, closing issue.