Portable Game Notation [PGN] is a computer-processible format for recording chess games [both the moves and related data]; many chess programs recognize this extremely popular format due to its accessibility by ordinary ascii editors, including word processors capable of importing and exporting plain ASCII.
PGN is structured "for easy reading and writing by human users and for easy parsing and generation by computer programs." The chess moves themselves are given in Algebraic chess notation. The usual filename extension is ".pgn."
PGN code begins with a set of "tag pairs" [a tag name and its value], followed by the "movetext" [chess moves with optional commentary].
sample pgn file
for more information on this sample file, please see the notes below.
[Event "F/S Return Match"]
[Site "Belgrade, Serbia JUG"]1
[Date "1992.11.04"]2
[Round "29"]
[White "Fischer, Robert J."]3
[Black "Spassky, Boris V."]4
[Result "1/2-1/2"]5
1.e4 e5 2.Nf3 Nc6 3.Bb5 {This opening is called Ruy Lopez.} a6 4.Ba4 Nf6 5.O-O Be7 6.Re1 b5 7.Bb3 d6 8.c3 O-O 9. h3 Nb8 10.d4 Nbd7 11.c4 c6 12.cxb5 axb5 13.Nc3 Bb7 14.Bg5 b4 15.Nb1 h6 16.Bh4 c5 17.dxe5 Nxe4 18.Bxe7 Qxe7 19.exd6 Qf6 20.Nbd2 Nxd6 21.Nc4 Nxc4 22.Bxc4 Nb6 23.Ne5 Rae8 24.Bxf7+ Rxf7 25.Nxf7 Rxe1+ 26.Qxe1 Kxf7 27.Qe3 Qg5 28.Qxg5 hxg5 29.b3 Ke6 30.a3 Kd6 31.axb4 cxb4 32.Ra5 Nd5 33. f3 Bc8 34.Kf2 Bf5 35.Ra7 g6 36.Ra6+ Kc5 37.Ke1 Nf4 38.g3 Nxh3 39.Kd2 Kb5 40.Rd6 Kc5 41.Ra6 Nf2 42.g4 Bd3 43.Re6 1/2-1/26
For archival storage, PGN data must provide the seven bracketed fields seen in the above sample file.
1—"City, Region COUNTRY" format, where COUNTRY is the 3-letter International Olympic Committee code for the country
2—"YYYY.MM.DD" format
3—"last name, first name" format
4—"last name, first name" format
5—one of four possible values: "1-0" [White won], "0-1" [Black won], "1/2-1/2" [Draw], or "*" [other, e.g., the game is ongoing]
6—standard algebraic notation
resources
→ PGN specification by Steven J. Edwards [HTML by Thomas Stahl]
→ Portable Game Notation Specification and Implementation Guide, Steven J. Edwards
→ PGN viewer
→ Online PGN viewer
source :: Wikipedia
3 comments:
we have got to figure this out....I really want to post a trap that arrises in the philidor defense called the "legal's mate" or something like that.
dude, I thought you were going to update this now that you're playing more. Gosh.
I am updating my chess blog more often now, only this is no longer it—my new [and permanent] chess blog can be found at http://greenpointchess.org.
Post a Comment