PGN standard

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

PGN standard

Post by lucasart »

What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Joerg Oster
Posts: 937
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany

Re: PGN standard

Post by Joerg Oster »

lucasart wrote: Thu May 21, 2020 2:20 pm What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
Wikipedia https://en.wikipedia.org/wiki/Algebraic ... on_(chess) uses the second format.

However, according to that link, a white move is replaced by an ellipsis (3 dots).
This would make

Code: Select all

1. ... e5
the correct one.
Last edited by Joerg Oster on Thu May 21, 2020 3:14 pm, edited 1 time in total.
Jörg Oster
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: PGN standard

Post by Ferdy »

lucasart wrote: Thu May 21, 2020 2:20 pm What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
This one, 1... e5

8.2.2.2: Export format move number indications
https://opensource.apple.com/source/Che ... andard.txt
Joerg Oster
Posts: 937
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany

Re: PGN standard

Post by Joerg Oster »

Ferdy wrote: Thu May 21, 2020 2:57 pm
lucasart wrote: Thu May 21, 2020 2:20 pm What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
This one, 1... e5

8.2.2.2: Export format move number indications
https://opensource.apple.com/source/Che ... andard.txt
No blanks after the move numbers?
Jörg Oster
Joerg Oster
Posts: 937
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany

Re: PGN standard

Post by Joerg Oster »

Ferdy wrote: Thu May 21, 2020 2:57 pm
lucasart wrote: Thu May 21, 2020 2:20 pm What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
This one, 1... e5

8.2.2.2: Export format move number indications
https://opensource.apple.com/source/Che ... andard.txt
Guess you're right.
2 examples from some of my test suites in pgn format.

Code: Select all

17. Rxe4 $3 {(Var)} Bh2+ 18. Kxh2 Qxe4 19. Re1 Qxc4 20. b3 Qc5 (20... Qb5 21.
Bh6 Rf5 22. Nb6 $18) (20... Qa6 21. Nxc7 $18) 21. Be7 $18 *

Code: Select all

{#} 1. Ke8 (1. c5+ Kc7 2. Be6 Bf3) 1... Bxc4 (1... Kc7 2. Be6 Kd6 3. Bf7 Kc7 4.
Ke7 {mit baldiger Entscheidung durch den d-Bauern.}) 2. Kd8 1-0
Jörg Oster
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: PGN standard

Post by Ferdy »

Joerg Oster wrote: Thu May 21, 2020 3:16 pm
Ferdy wrote: Thu May 21, 2020 2:57 pm
lucasart wrote: Thu May 21, 2020 2:20 pm What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
This one, 1... e5

8.2.2.2: Export format move number indications
https://opensource.apple.com/source/Che ... andard.txt
No blanks after the move numbers?
See section 7 on tokens.
https://opensource.apple.com/source/Che ... andard.txt

One can put a space between tokens.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: PGN standard

Post by lucasart »

Ferdy wrote: Thu May 21, 2020 2:57 pm
lucasart wrote: Thu May 21, 2020 2:20 pm What's the correct syntax for indicating black move ?

Code: Select all

1.. e5
1... e5
1. ... e5
This one, 1... e5

8.2.2.2: Export format move number indications
https://opensource.apple.com/source/Che ... andard.txt
Thanks. I'll just use "1... e5" then.

What confused me is that the same standard document mentions "1. ... c5" in section 16.1.4. What can one do with a self-contradicting standard...
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: PGN standard

Post by Ferdy »

lucasart wrote: Fri May 22, 2020 1:24 am What confused me is that the same standard document mentions "1. ... c5" in section 16.1.4. What can one do with a self-contradicting standard...
This one,

Code: Select all

And then after 1. ... c5:
is only a comment describing the fields of the FEN. That comment is not in movetext section.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: PGN standard

Post by bob »

Been discussed many times. I always used 1. ... e5. Tokenizes much better than having the "..." jammed against the move number (which commonly has a period after it. Which makes it somewhat ambiguous. I handle either. I output "1. ... e5" however. The PGN standard has been around a long time. And now there are multiple flavors dealing with formatting inside comments and such.

Probably won't happen, but it would be good to see a PGN 2.0 that cleans up some of the complaints and ambiguities.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: PGN standard

Post by lucasart »

bob wrote: Fri May 22, 2020 3:18 am Probably won't happen, but it would be good to see a PGN 2.0 that cleans up some of the complaints and ambiguities.
Agreed. We need a new PGN format, and we can still call it PGN: Parsable Game Notation :lol:

The current one is about as parsable as modern C++.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.