kraktus / lichess-puzzler

MIT License
3 stars 4 forks source link

Issues generating puzzle #2

Open Mansour-J opened 7 months ago

Mansour-J commented 7 months ago

Hi first, I wanted to say this is pretty cool that you tried to create a de-coupled puzzle generator that is not tied to the lichess way of generating puzze and applying so many filter(having the game already being analyzed, tier and rating system and etc)....

I failed to create a puzzle out of below game. I still see a lof refrence and if statements based on the tier/rating system that was used originally in the base repository from ornicar could that be the issue?

  1. [https://github.com/kraktus/lichess-puzzler/blob/559e39ce71cc4e1cd712f4cf29c3afa9f8d6a835/generator/generator.py#L227](example of discarding two movers based on tier)
  2. [https://github.com/kraktus/lichess-puzzler/blob/559e39ce71cc4e1cd712f4cf29c3afa9f8d6a835/generator/generator.py#L224](Discard one-mover based on tier)
[Event "Rated Blitz game"]
[Site "https://lichess.org/"]
[White "genassien"]
[Black "Freiheitskaempfer"]
[Result "1-0"]
[WhiteTitle "FM"]
[BlackTitle "FM"]
[Variant "Standard"]
[Opening "Bishop's Opening: Berlin Defense"]
[Termination "Time forfeit"]

1. e4 e5 2. Bc4 Nf6 3. d3 c6 4. Nf3 d5 5. Bb3 Bb4+ 6. c3 Bd6 7. Nbd2 Nbd7 8. O-O O-O 9. Re1 dxe4 10. dxe4 Qe7 11. Nc4 Bc7 12. Ne3 Nc5 13. Bc2 Ncxe4 14. Nc4 Qc5 15. Bxe4 Qxc4 16. Bc2 Bg4 17. Bg5 Rad8 18. Qb1 Bxf3 19. Bxf6 gxf6 20. Bxh7+ Kg7 21. gxf3 Qh4 22. Be4 Rh8 23. Kf1 Rd2 24. Re2 Rhd8 25. Rxd2 Rxd2 26. Qe1 Rxb2 27. Rb1 Qh3+ 28. Kg1 Rxb1 29. Qxb1 Bb6 30. Qf1 Qh6 31. Qg2+ Kf8 32. Qg4 Qc1+ 33. Kg2 Qd2 34. Qc8+ Ke7 35. Qxb7+ Kf8 36. Qc8+ Ke7 37. Bxc6 Qxf2+ 38. Kh3 Qf1+ 39. Kg4 Qg2+ 40. Kf5 Qg5+ 41. Ke4 Qe3+ 42. Kd5 Qc5+ 43. Ke4 Qe3+ 44. Kd5 Qc5+ 45. Ke4 f5+ 46. Kxf5 e4+ 47. Kxe4 Qe3+ 48. Kf5 Qd3+ 49. Be4 Qd6 50. Qb7+ Bc7 51. Qb4 Qxb4 52. cxb4 Bxh2 53. Kg4 Bd6 54. f4 Bxb4 55. Kf5 Bd6 56. Kg4 f6 57. f5 Bc5 58. a3 Bd6 59. a4
Mansour-J commented 7 months ago

I have been playing around with this and checking the behaviour. What is the definition of puzzle in this one?

Below I made two pgn by myself and this generator was not able to make a puzzle out of any of them.

I copied over some pgn header from other pgn so the app doesn't complain about the pgn header when parsing - ignore the pgn headers

Example of a missed tactic or opportunity: missed-tactics

[Event "Rated Blitz game"]
[Site "https://lichess.org"]
[Date "2021.06.28"]
[White "genassien"]
[Black "Freiheitskaempfer"]
[Result "1-0"]
[UTCDate "2021.06.28"]
[UTCTime "18:21:43"]
[WhiteElo "2370"]
[BlackElo "2441"]
[WhiteRatingDiff "+7"]
[BlackRatingDiff "-7"]
[WhiteTitle "FM"]
[BlackTitle "FM"]
[Variant "Standard"]
[TimeControl "300+0"]
[ECO "C24"]
[Opening "Bishop's Opening: Berlin Defense"]
[Termination "Time forfeit"]
[Annotator "lichess.org"]

1. e4 e5 2. Bc4 b6 3. Qh5 g6 4. Qf3 Nf6 5. Ne2

Example of a right move when tactical opportunity exists: tactics

[Event "Rated Blitz game"]
[Site "https://lichess.org"]
[Date "2021.06.28"]
[White "genassien"]
[Black "Freiheitskaempfer"]
[Result "1-0"]
[UTCDate "2021.06.28"]
[UTCTime "18:21:43"]
[WhiteElo "2370"]
[BlackElo "2441"]
[WhiteRatingDiff "+7"]
[BlackRatingDiff "-7"]
[WhiteTitle "FM"]
[BlackTitle "FM"]
[Variant "Standard"]
[TimeControl "300+0"]
[ECO "C24"]
[Opening "Bishop's Opening: Berlin Defense"]
[Termination "Time forfeit"]
[Annotator "lichess.org"]

1. e4 e5 2. Bc4 b6 3. Qh5 g6 4. Qxe5+ Qe7 5. Qxh8 Nf6 6. d3