Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puzzles #291

Open
DanijelDomazet opened this issue Apr 25, 2024 · 2 comments
Open

Puzzles #291

DanijelDomazet opened this issue Apr 25, 2024 · 2 comments

Comments

@DanijelDomazet
Copy link

Once there is a mechanism to have games starting from some FEN possition #290, it could be used for chess puzzles, but would require additional "show solution" button or something similar (have a look at pgn4web solution to this feature).

@yo35
Copy link
Owner

yo35 commented May 9, 2024

Already discussed in other issues. See for instance #221 or #239.

@clorgie
Copy link

clorgie commented May 17, 2024

I happened to come here with the same question, and seeing that this is not (yet, perhaps) a feature, this is the approach I am probably going to use for now. Perhaps it will help others who end up here!

I am using rpb-chessboard and the bbspoiler plugin. For the puzzle I use two blocks:

The first is the diagram of the puzzle using a fen string such as this used in the example:
5rRk/p1p4p/5n2/4NPR1/1PQ5/P3P2r/5PK1/3q4 b - - 0 1

The second is a shortcode block with the solution which I set to be hidden using the bbspoiler plugin. This block contains something like the following as seen in the current (live test post):

[spoiler title='Solution']
[pgn flip=true navigation_board=above colorset=original]

[Event "Dutch Open"]
[Site "<a href='https://old.chesstempo.com/chess-problems/9119'>Chess Tempo: 9119</a>"]
[Round "8"]
[Date "2001.7.25"]
[White "Janssen, Ruud"]
[Black "Van Den Doel, Erik"]
[WhiteElo "2437"]
[BlackElo "2607"]
[Result "1-0"]
[Variant "Standard"]
[TimeControl "600+0"]
[ECO "A20"]
[Opening "English Opening"]
[Termination "Time forfeit"]
[Annotator "Stockfish"]
[FEN "5rRk/p1p4p/5n2/4NPR1/1PQ5/P3P2r/5PK1/3q4 b - - 0 1"]

1...Nxg8 2.Qxg8+ ({+1.24}  2.Kxh3 Qh1+ 3.Kg3 Qg1+ 4.Kf4 Qh2+ 5.Rg3 Qxf2+ 6.Nf3 Rxf5+ 7.Kxf5 Qxg3 8.Qd4+ Qg7 9.Ke6 h5 10.Qxg7+ Kxg7 ) Rxg8 3.Nf7# 1-0
[/pgn]
[/spoiler]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants