Diagrams from FEN positions

, par Jacques

Chessboard 1

Display only one position, with the text of the solution on the side.

The following code

[pgn]
["White play and win"]
[Result "1-0"]
[FEN "rn1qkbnr/1pp2ppp/p2p4/4p3/2B1P1b1/2N2N2/PPPP1PPP/R1BQK2R w KQkq - 0 5" ]
5. Nxe5 Bxd1 $4 (5... dxe5 {would be the less evil... White only won a pawn.} 6. Qxg4) 6. Bxf7+ Ke7 7. Nd5#
1-0
[/pgn]

display the chessboard this way

Chessboard 2

Here also the intention is to display only one position but this time we want to hide the solution. This is done by adding the option
movesDisplay=puzzle

The following code

[PGN movesDisplay=puzzle]
[Black  "Blacks play and win"]
[Result "0-1"]
[FEN "1r4k1/p1p2pp1/1b1r3p/3P4/QP2q3/5N2/P4PPP/R5KR b - - 0 1"]

1... Qe2 2. h4 Rg6 3. Rh2 0-1
[/PGN]

display the chessboard this way

Chessboard 3

This time the need is to display several games on the smae chessboard. The chessboard will be enlarged as well.

The following code

[PGN frameHeight=500 squareSize=34 layout=vertical movesDisplay=puzzle]
[White "White play and win"]
[Result "1-0"]
[FEN "5q1k/2p3Rp/1p1rnP2/p4p2/2Q5/PP2P3/1B3P1P/7K w - - 0 1"]
1. Qxe6 Rxe6 2. f7 h6 3. Rg8+ Kh7 4. Rxf8 Kg6 1-0

[Black  "Blacks play and win"]
[Result "0-1"]
[FEN "1r4k1/p1p2pp1/1b1r3p/3P4/QP2q3/5N2/P4PPP/R5KR b - - 0 1"]
1... Qe2 2. h4 Rg6 3. Rh2 0-1
[/PGN]

display the chessboard this way