ArneVogel / listudy

Listudy - chess training server
https://listudy.org
GNU Affero General Public License v3.0
292 stars 45 forks source link

"Embed your own tactic" not working for tactics ending in promotion #113

Closed cshancock closed 2 years ago

cshancock commented 2 years ago

I've been creating my own embedded tactics and they have worked well so far. Except I have since noticed that when a tactic involves promotion, it scores the promotion move as incorrect.

Here is an example: https://listudy.org/en/iframe/custom-tactic#JHsyYjUvUTcvMnA1LzFrNi8xUDYvNVAyLzNwMlBLLzNyNCBiIC0gLSAwIDUxfTske1JoMSsgS3hoMSBkMT1RK307JHtmN2E3fQ==

Here is another: https://listudy.org/en/iframe/custom-tactic#JHtSNy9QNWtwLzRwcHAxLzRiMy84LzNLNC82cjEvOCB3IC0gLSAwIDM4fTske1JnOCsgS3hnOCBhOD1RK307JHthMmcyfQ==

I am not sure if this is a problem only in tactics that end with a promotion, or if it would occur in tactics that involved a promotion but had subsequent moves before completing the tactic.

sampma309 commented 2 years ago

This is occurring in all tactics that include promotion and I think I figured out why. It's an issue with a regular expression that is removing the equals sign from the move. I submitted a pull request for it.