1
2% test.pgn file showing a number of PGN features
3
4some garbage at the start of the PGN file
5
6[Event "Testing PGN header tags, comments and clock information"]
7[Site "Some site"]
8[Date "1234.56.78"]
9[Round "1"]
10[White "Some White player"]
11[Black "Some Black player"]
12[Result "1/2-1/2"]
13[WhiteTitle "IM"]
14[BlackTitle "FM"]
15[WhiteElo "2468"]
16[BlackElo "2345"]
17[ECO "A00"]
18[Opening "Some opening"]
19[Variation "Some variation"]
20[SubVariation "Some subvariation"]
21[TimeControl "40/3600:900+30"]
22[Section "Some section"]
23[Stage "Some stage"]
24[Board "1"]
25[Termination "normal"]
26[WhiteClock "1:00:00"]
27[BlackClock "1:00:00"]
28[Clock "W/00:41:19"]
29
301. e4 { [%clk 00:59:01] } 1... e5 { [%clk 00:58:02] this is an inline
31comment } 2. Nf3 { [%clk 00:57:03] } 2... Nf6 { [%clk 00:56:04] } (2... Nc6
32%
33% this line should not be passed through by the PGN viewer
34%
353. Bb5 (3. Bc4)) 3. d4 { [%clk 00:55:05] } 3... exd4 { [%clk 00:54:06] } 4.
36e5 { [%clk 00:53:07] } 4... Ne4 { [%clk 00:52:08] } 5. Qxd4 { [%clk
3700:51:09] } 5... d5 { $5 [%clk 00:50:10] } 6. exd6 { [%clk 00:49:11] } 6...
38Nxd6 { [%clk 00:48:12] } 7. Bd3 { [%clk 00:47:13] } 7... Nc6 { [%clk
3900:46:14] } 8. Qf4 { [%clk 00:45:15] } ; the rest of this line is a comment
408... Be7 { [%clk 00:44:16] [%pgn4web pgn4web message] } 9. O-O { [%clk
4100:43:17] } 9... O-O { [%clk 00:42:18] } 1/2-1/2
42
43[Event "Testing non standard initial position, NAG comments and basic variations"]
44[Site "Another site"]
45[Date "2345.67.89"]
46[Round "2"]
47[White "Another White player"]
48[Black "Another Black player"]
49[Result "*"]
50[SetUp "1"]
51[FEN "rnbqkb1r/pppppppp/5n2/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 1 2"]
52
532. Nc3 d5 { $140 3. exd5 Nxd5 $10 } 3. e5 $5 d4 $1 4. exf6 dxc3 5. d4 (  $142
545. fxg7 $10) 5... cxb2 $15 6. fxg7 bxa1=Q 7. gxh8=Q Qb1 { ?? } 8. Qxf8+  $1
55Kxf8 9. Bh6+ $18 { special characters within comments: áâãäå } *
56
57[Event "Testing non standard initial position with Black to move and more variations"]
58[Round "3"]
59[Result "0-1"]
60[SetUp "1"]
61[FEN "rq4k1/6pp/p1p2r2/7R/4n3/1P2QP2/1P3P1P/RN4K1 b - - 0 1"]
62
631... Rg6+ 2. Kh1 (2. Kf1 Qd6 3. Nc3 Nd2+ 4. Ke2 Nxb3) 2... Qf4 3. fxe4 (3.
64Qxf4 Nxf2#) (3. Qxe4 Qc1+) (3. Nc3 Qxe3 4. fxe3 Nf2#) 3... Qg4 0-1
65
66[Event "Testing advanced variations: nesting and siblings"]
67[Round "4"]
68
691. d4 (1. c4 (1. b4 (1. a4 a5) 1... b5) 1... c5) (1. e4 (1. f4 (1. g4 (1. h4
70h5) 1... g5) 1... f5) 1... e5) 1... d5 (1... c5 (1... b5 (1... a5))) (1... e5
71(1... f5 (1... g5 2. g3) 2. f3) 2. e3) e3 (f3 f6) (g3 g6) (h3 h6) e6 *
72
73[Event "Testing non standard initial position with tablebase ending"]
74[Round "5"]
75[Result "1/2-1/2"]
76[SetUp "1"]
77[FEN "2k5/5p2/6Pp/7p/6P1/8/8/2K5 b - - 0 1"]
78
791... fxg6 2. gxh5 Kb7 3. Kd2 gxh5 4. Ke3 h4 1/2-1/2
80
81[Event "Testing advanced variations: comments before/after variations"]
82[Round "6"]
83
841. d4 { this comment is right after White's first move } ( { this also, but
85already inside a variation } e4 { this is after the variation } ) { this is
86is outside the variation } d5 c4 *
87
88[Event "Testing advanced variations: empty variations"]
89[Round "7"]
90
911. d4 () d5 ( ) 2. c4 ({ variations without moves should become comments })
92(2. Nf3) 2... dxc4 ( ( { accepting the gambit } ) ) 3. e4 (3. Nf3 1/2-1/2) e5 *
93
94[Event "Testing null moves"]
95[Round "8"]
96
971. e4 e5 2. Bc4 ($140 2. Bc4 -- 3. Qf3 -- 4. Qxf7#) Nf6 3. d3 ({ defending
98against } 3. -- Nxe4) 3... Bc5 *
99
100[Event "Testing continuations"]
101[Round "9"]
102[SetUp "1"]
103[FEN "rnbqkbnr/ppp1pppp/8/3p4/3P4/8/PPP1PPPP/RNBQKBNR w KQkq d6 0 2"]
104
1052. c4 dxc4 (* $140 3. e4 e5 { this is a continuation }) 3. Nf3 Nf6
106(* 4. e3 Bg4 { another continuation }) (3... b5 4. a4 {this is a
107variation}) *
108
109[Event "Testing header patterns in comments"]
110[Round "10"]
111
1121. e4 e6 { [White "Another White player"] [Black "Another Black player"] }
113d4 d5 *
114
115[Event"Testing very odd game"][Round "11"]a4(b4$6)a6!?{comment}a5*[Event"Testing another very odd game"][Round "12"]h4(g4)h6{comment}h5*
116
117[ Event  "Testing malformed header (extra spaces and extra line)"]
118
119[ Round"13"]
120
121e4 e6 *
122
123[Event "Testing a basic NAG before variation start"]
124[Round "14"]
125[SetUp "1"]
126[FEN "3k4/3P4/4K3/8/8/8/8/8 w - - 0 1"]
127
128$22 {this is a draw} 1. Kd6 ($22 1. Kf7 ($11 Kf6 Kd7) Kd7) ({ if only White
129could pass } 1. -- Kc7 ({ a simple win } $18 1.. Kc7 2. Ke7)) -- (* { also
130lost if Black passes} $18 2. Kc6 Ke7) 2. Kd5?? { this is a blunder } Kd7 $11
131Kd4 Kd6 Ke4 Ke6 *
132
133[Event "Testing FEN castling rights"]
134[Round "15"]
135[SetUp "1"]
136[FEN "r3k2r/pppppppp/8/8/8/8/PPPPPPPP/R3K2R w Qk - 0 1"]
137
1381. O-O-O O-O
139
140