V. ย ย ย Portable Game Notation (pgn).
Theย Portable Game Notation (pgn)ย is a notation type utilized primarily for computer chess programs. Files in pgn format are simple text-based files, configured for reading by and operation of computer programs. They are editable with simple text-based editors such as Windows Notepad and WordPad. Of course, there are game player/editor programs which also permit editing, annotating, and creating pgn files. The file consists of a series of text/information “headers” within brackets [ ] with each header on its own line. Not all pgn files contain the same headers. The headers included depend on what information is input by the creator of the pgn file. Next comes the game in a new paragraph utilizing the English Algebraic format. At the end is usually the result of the game (1-0, 0-1, 1/2 – 1/2) with a comment (signalling how the game ended; e.g., Black checkmated, draw by agreement, Three-Move Repetititon draw, 50-move draw, stalemate). Additionally, pgn files may be simple game files with no annotations or comments. More detailed game pgn files contain annotations and comments. Annotations are made using basic chess symbols [e.g., + (for check), # (for checkmate), e.p. (enpassant), 0-0 (Kingside castling), 0-0-0 (Queenside castling)]. Additional annotations are available using Numeric Annotation Glyphs (NAG) [e.g., !, !!, ?!, !? and so on, represented in pgn notation starting with the $ symbol followed by a numer corresonding to the desired annotation – a separate tutorial on NAG is available (link after pgn examples below)]. In addition, if a game file starts out other than with the normal board starting position, then an FEN heading is included so that the file is read correctly by computer programs. The FEN heading is used if the creator of the pgn wants to start the file at a particular move in a game, or present a chess problem or puzzle. Below are examples of a simple pgn game file, the same game but starting at move 20, a detailed pgn game file with annotations and comments, and a chess “problem” pgn file:
Simple pgn game file with annotations or comments:
[Event “ICC 90 0”]
[Site “Internet Chess Club”]
[Date “2003.02.25”]
[Round “-“]
[White “ERIQ”]
[Black “DaveTheRook”]
[Result “0-1”]
[ICCResult “White resigns”]
[WhiteElo “2069”]
[BlackElo “1606”]
[Opening “Ruy Lopez: four knights (Tarrasch) variation”]
[ECO “C77”]
[NIC “RL.12”]
[Time “19:35:07”]
[TimeControl “5400+0”]
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. Nc3 Be7 6. d4 exd4 7. Nxd4 O-O 8. a3 Re8 9. O-O Nxd4 10. Qxd4 b5 11. Bb3 c5 12. Qd1 c4 13. Ba2 Bc5 14. b3 Nxe4 15. Nxe4 Rxe4 16. Qd5 Bxf2+ 17. Kh1 Qh4 18. g3 Qh3 19. Bb2 Bb7 20. Qxb7 Rae8 21. Qd5 R8e6 22. Qxd7 f6 23. Qc8+ Kf7 24. Qd7+ Kg6 25. Qc7 Be1 26. Rg1 Re2 27. g4 Qf3+ {White resigns} 0-1
Same pgn game file but starting at move 20, showing FEN heading included:
[Event “ICC 90 0”]
[Site “Internet Chess Club”]
[Date “2003.02.25”]
[White “ERIQ”]
[Black “DaveTheRook”]
[Result “0-1”]
[WhiteElo “2069”]
[BlackElo “1606”]
[ECO “C77”]
[SetUp “1”]
[FEN “r5k1/1b1p1ppp/p7/1p1Q4/2p1r3/PP4Pq/BBP2b1P/R4R1K w – – 0 20”]
20.Qxb7 Rae8 21.Qd5 R8e6 22.Qxd7 f6 23.Qc8+ Kf7 24.Qd7+ Kg6 25.Qc7 Be1 26.Rg1 Re2 27.g4 Qf3+ {White resigns} 0-1
Detailed pgn game file with annotations and comments:
[Event “ICC 5/12 Blitz game challenge”]
[Site “Internet Chess Club”]
[Date “2005.01.11”]
[White “Double Sacrifice: PiecefulChaos”]
[Black “mal57”]
[Result “0-1”]
[WhiteElo “1221”]
[BlackElo “1295”]
[ECO “C07”]
[Annotator “Mark Lowery’s Exciting World of Chess”]
{A tough defensive pawn structure is formed in the game. White blunders allowing Black to set up and use a Double Sacrifice. Black first does an En prise sacrifice of a pawn as a Decoy sacrifice luring White’s King to the h-file. Black follows with an Exchange sacrifice to gain the win. Black throws in some Zwischenzug moves to focus White’s concentration on the lure of the pawn sacrifice. The battle to break past the difficult defensive pawn structure that developed principally starts at move 50. I provide here the full game so that if you desire, you may review the first 49 moves to see how we arrived at the pawn structure that developed.} 1.e4 e6 2.d4 d5 3.Nd2 c5 4.c3 cxd4 5.cxd4 Bb4 6.e5 Nc6 7.Nf3 Qb6 8.a3 Bxd2+ 9.Qxd2 Nge7 10.Be2 Na5 11.Bd1 Nf5 12.O-O Bd7 13.b4 Nc4 14.Qg5 Qd8 15.Qxd8+ Rxd8 16.g4 Ne7 17.h3 h5 18.g5 g6 19.h4 Ra8 20.Bb3 Bb5 21.Kg2 a5 22.bxa5 Nxa5 23.Ba4 Bxa4 24.Rh1 Nb3 25.Rb1 Nc6 26.Be3 Nca5 27.Nd2 b5 28.Rb2 Nc6 29.Nxb3 Na5 30.Nxa5 Rxa5 31.Ra1 Ra6 32.Rb4 O-O 33.Rc1 Rb8 34.Rc7 Rbb6 35.Kf3 Rc6 36.Rxc6 Rxc6 37.Rb2 Rc3 38.Ra2 Kf8 39.Ke2 Ke7 40.Bd2 Rb3 41.Bb4+ Kd7 42.f3 Rb1 43.Kf2 Rd1 44.Ke3 Rh1 45.Kf2 Rxh4 46.Ke3 Rh1 47.Rg2 Rb1 48.Kf4 Rb3 49.Rd2 Rb1 50.Kg3 Bb3 $1 {Black’s intent is to block the c-file and prevent White’s Rook from stopping Black’s King moving to the a-file.} 51.Rd3 {Black anticipated this attack on Black’s Bishop.} 51…Bc4 $1 {Blocks c-file.} 52.Rd2 Rb3 {Absolute pins White’s pawn at f3.} 53.Rf2 Rd3 54.Bc5 $6 {Opens up h5.} 54…Kc6 55.Kh4 Kb7 56.Kg3 Ka6 57.Kh4 $4 {Surprisingly, White leaves h5 undefended allowing White to bring Black’s King into play on the a-file.} (57.Bb4 {White could have ensured a draw with this move. The strong defensive pawn structure would have prevented Black from opening the a-file for Black’s King.}) 57…Ka5 58.Kg3 Ka4 {Black at this point is in position to launch the Exchange sacrifice (59…Rxa3 60.Bxa3 Kxa3). However, I was concerned with the position of White’s King. I felt it better to lure White’s King farther away into the h-file so that White’s King could not maneuver back to defense in the center in time after the Exchange sacrifice.} 59.Kh4 Kb3 {A meaningless move on my part, not sure what I was thinking.} 60.Kg3 Ka4 61.Kh4 Rb3 {Blocks White from moving White’s Rook to b2, a possible defensive maneuver for White, while setting up for some Zwischenzug moves to attempt to confuse White while Black sets up the Double Sacrifice.} 62.Kg3 Rb1 63.Kg2 Bd3 64.Bb4 h4 $1 {Black launches the tempting pawn sacrifice lure} 65.Kh3 Rh1+ {A short cat-and-mouse series of Zwischenzug moves follows.} 66.Kg2 Rb1 67.Kh3 Rh1+ 68.Kg2 Rd1 {Black cannot go back to b1 because of the Three-Move Repetition Draw rule. Black thought to make it look like he was doing something, defending Black’s Bishop.} 69.Kh3 Ra1 $1 {offering the En prise sacrifice} 70.Kxh4 {White’s King takes the bait and is lured to h4, now Black feels comfortable with launching the winning Exchange sacrifice} 70…Rxa3 $1 71.Bxa3 Kxa3 {From here on out, Black plays for the win, but in a long series of somewhat confusing moves, examination after the game revealed Black had a much more direct route to accomplish the goal.} 72.f4 b4 73.Rd2 Bf5 {Better would have been 73…Bc4! blocking the open c-file and defending c3 for the pawn advance. However, Black focused on trying to lure White to utilize the open c-file for the Rook, believing White would seize the opportunity to get into Black’s space behind Black’s strong defensive pawn structure to try to attack from the rear and breakthrough.} 74.Rc2 $4 {White does precisely that, but this was a really blunderous move. Black could just simply capture White’s Rook with Black’s Bishop from f5. It is always better to simplify as the rest of this game shows. Black calculated that it did not matter because White’s King was too far away to provide any defense, and so did not capture White’s Rook.} 74…b3 (74…Bxc2 {Black now has easy win.}) 75.Rc7 b2 76.Rxf7 {White follows the path Black believed White would take. However, with Black’s Bishop at f5, there is no way for White successfully to breakthrough Black’s defensive pawn structure. This is why Black positioned Black’s Bishop at f5 earlier intending to lure White’s Rook behind Black’s defensive pawn structure, where it would be ineffectual. Black’s En prise sacrifice of the pawn at f7 therefore gained White nothing.} 76…b1=Q {Black knows what is coming, the promoted Queen will be lost, but Black will lose the Rook in the process. The strong effect of White’s earlier pawn Decoy sacrifice becomes apparent, because Black will be able to successfully attack White’s center pawn structure before White can get White’s King into position to defend.} 77.Ra7+ Kb2 78.Rb7+ Kc2 79.Rxb1 Kxb1 80.Kg3 Kc2 81.Kf2 Kd3 {the game is over, although White struggles on for a while (hoping perhaps that Black would blunder) before resigning} 82.Kf3 Kxd4 83.Ke2 Ke4 84.Kd2 Kxf4 85.Kc3 Ke4 {probably should have taken White’s pawn at e5 too, but it is not necessary to win anyway} 86.Kb4 d4 87.Kc4 Kxe5 {as noted, should have done this earlier anyway} 88.Kb3 Ke4 89.Kb2 d3 90.Kc1 Bg4 $1 {defends the promotion square at d1} 91.Kd2 Kd4 $1 {Black brings opposition of the Kings into play forcing White’s King away to either of two square c1 or e1, both of which ensure pawn promotion and Queening} 92.Kc1 {Black’s other option of 92.Ke1 is no better} (92.Ke1 {either} 92…Ke3 ({or} 92…Kc3 {will result in pawn promotion and Queening, with mate to follow} 93.Kf1 d2 94.Kf2 d1=Q 95.Kg2 Kd3 96.Kf2 Qe2+ 97.Kg1 (97.Kg3 Qf3+ 98.Kh2 Ke3 99.Kg1 Qf2+ 100.Kh1 Bf3#) 97…Ke3 98.Kh1 Qf3+ 99.Kg1 Bh3 100.Kh2 Qg2#) 93.Kf1 d2 94.Kg2 (94.Kg1 d1=Q+ 95.Kg2 Qe2+ (95…Qf3+ 96.Kg1 (96.Kh2 Qf2+ 97.Kh1 Bf3#) 96…Qf2+ 97.Kh1 Bf3#) 96.Kg1 Qf2+ 97.Kh1 Bf3#) 94…d1=Q 95.Kg3 (95.Kh2 Qe2+ 96.Kg1 Qf2+ 97.Kh1 Bf3#) 95…Qf3+ 96.Kh2 Qf2+ 97.Kh1 Bf3#) 92…Kc3 {forcing White’s King away and opening unstoppable path to pawn promotion and Queening} 93.Kb1 d2 94.Ka2 d1=Q {White resigns; mate on next move because White’s only move is 95.Ka3, followed by 93…Qb3#} 0-1
Puzzle pgn file example:
[Event “?”]
[Site “?”]
[White “White Mates in Four (four solutions)”]
[Black “?”]
[Result “*”]
[Annotator “Mark Lowery’s Exciting World of Chess /Chess/”]
[SetUp “1”]
[FEN “2kr1b1r/2B2p1p/3p1Np1/5n1b/1P6/7K/1P3P1P/R1R2B2 w – – 0 1”]
1.Ra8+ (1.Bxd6+ Kb7 2.Rc7+ Kb8 (2…Kb6 3.Ra6#) 3.Rd7+ Kc8 4.Rc1# (4.Ra8#)) 1…Kb7 2.Rxd8 Nd4 {any Black move or pawn advance makes no difference} 3.Rb8+ Ka7 4.Ra1# *