Hacker News new | past | comments | ask | show | jobs | submit login
Generating chess puzzles with generic algorithms (2022) (propelauth.com)
79 points by zorked on Sept 29, 2023 | hide | past | favorite | 26 comments



Title has a typo: generic -> genetic


Yes, I found this very confusing at first. Thanks for confirming.


I'm a terrible chess player, which I don't mind. But a side effect of this is that I cannot find decent chess problems. Forget a mate three, I'm at the level where I miss obvious forks. Problem is, there doesn't seem to be a decent size collection of such problems. You'd expect there to be quite some demand for it. Maybe I should try to create a few with this system.


Lichess can serve you arbitrarily many puzzles [1]. They'll keep track of your performance and adjust the difficulty of the problems accordingly.

[1] https://lichess.org/training


and here is the project used to generate Lichess puzzle database

https://github.com/ornicar/lichess-puzzler


I can say definitively that many of the easier puzzles are just obvious forks. Don't ask how I know, though :P.


Lichess classify puzzles by themes [0], you can practice on the ones you want. It has more than 500k fork-themed puzzles (of various difficulty) [1].

[0] https://lichess.org/training/themes [1] https://lichess.org/training/fork


I enthusiastically recommend Chess Tempo (https://chesstempo.com/), which will give you interactive chess puzzles from real games that are tailored to your level. Someone else mentioned the similar system on lichess, which is also fine.


And if you are missing forks, you can choose to filter for only fork puzzles.


If I know a problem is “find the fork”, im in a complete different mindset from “find the best move”.

Because of that I doubt doing problems of the former kind will help seeing forks much when going back to “find the best move” type problems.


The main way to improve at solving tactical puzzles - and at seeing tactical opportunities/threats in games - is to develop pattern recognition for the many tactical themes there are. Training on specific themes for some time is a very powerful way to do so. I'm experimenting with this approach on BraiMax Chess and results from users are very good - I'll publish some stats as soon as I get enough data.


> “find the best move”

Before you can do that, you need to understand the moves you can make and their implications. I think identifying forks fit here.


I’m in a very similar position and it has been very challenging finding good resources — most feel like the “now draw the rest of the owl” meme after explaining how the pieces move.

I’ve been enjoying the Dr Wolf app, which mixes lessons, actual play against a very forgiving CPU opponent, and spaced repetition of mistakes.

I tried Chessable but the UI was awful and beginner/learning content was poor.


If you want to improve on specific tactical themes, including forks, you can use this for free: https://chess.braimax.com/play/focused_puzzle_rush

Disclaimer: I'm the creator of BraiMax Chess. Any feedback is welcome.


Tactical puzzles might be the better thing for you: https://www.chess.com/puzzles/rated

These are quick tactical puzzles, that adjust the difficulty to your level. Put in some hours, and you will spot obvious forks!


"Chess: 5334 Problems, Combinations and Games" by Lásló Polgár, father of the Polgar sisters.


At chess.com you can search for exercises on both theme and rating (of the exercise). This means you can search for easy exercises on forks.

https://www.chess.com/puzzles/learning


For easy of copy-pasting, the FEN for the puzzle with the abundance of knights is

  N1n1NN2/qNN5/5NK1/1n1nNnNN/n1Pn4/kn2n1NN/nRR1nn2/3nn1Nn w - - 0 1
I guessed the first move right, but calculating the continuation was too messy for me.


An even easier link to allow you to live-play it against the computer: https://lichess.org/analysis/standard/N1n1NN2/qNN5/5NK1/1n1n...


I'm curious why he sets Stockfish depth to 10 when he's looking for mate-in-3 puzzles. Surely 3 is all he needs?


(author here) That's a good question, I should've explained it better.

Technically, the other property of a puzzle is that there's exactly one good move. If you have one move that can mate in 3 and another move that can mate in 4, it's actually not a puzzle by the strict definition of the term. So, the reason I set the depth to 10 was because I'm actually looking for the second best move to be bad/losing.

For real positions, 10 might honestly be too low to confidentially state that every other move is bad, but for mate in 3 it was a good enough and still performed well.


At high enough depth the only real evaluations are #N, #-N, and 0. I’ve let stockfish sit on positions for an hour on my computer and it’ll find mate in 40. Of course in practical terms that’s computationally infeasible for your problem.


See also generation of a chess variant's puzzles, which is much more thorough & gets much better results by throwing the kitchen sink at it: https://samiramly.com/chess


Can someone skilled in the art tell me where can I learn more about generating those puzzles? Are puzzles on chess.com hand-crafted, or are they generated with an algorithm?


I know that the ones on lichess use an algorithmic that finds puzzles in games played by real players on the platform.

Code here: https://github.com/ornicar/lichess-puzzler

You can even see puzzles by player: https://lichess.org/training/of-player


genetic*




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: