PDN standard

Discussion about development of draughts in the time of computer and Internet.
Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Wed May 13, 2009 09:48

Ed Gilbert wrote:
Concerning illegal moves I don't know what the best option is. If illegal moves or setups are handled inside comments, this would suggest that older programs are able to deal with the PDN. But this not the case, since ignoring the setup may result in impossible moves right after it. So we might consider to introduce a special token for doing a setup that can appear anywhere in the game. What do others think of this?
I would not expect a draughts program to read a pdn file and then seamlessly show me a full game containing an illegal move! For those unusual situations I think embedding all moves following the illegal move in a comment is sufficient to document what happened and allow someone to sort it out afterwards while reading the comment.

-- Ed
I can see two situations where it is not uncommon to do a setup. In recordings of live games using electronic boards it will happen in say about 5% of the games that a setup is needed after the move recognition fails. And in game analyses that are published in newspapers it frequently happens that side steps are made like this:

Code: Select all

27-22 { In the game X-Y with 2 on 7 and 50 on 49 X won with the combination } 25-20 15x24 30x8.
Clearly the move 25-20 refers to a position that cannot be reached in a normal way, not even with a variation. We can encode the setup using a comment, for example like this:

Code: Select all

27-22 { In the game X-Y with 2 on 7 and 50 on 49 X won with the combination } {[%setup FEN "..."]} 25-20 15x24 30x8.
But this will destroy the property that comments may be removed without altering the game. For that reason it might be useful to have a more well-defined way to do a setup during the game, such as

Code: Select all

27-22 { In the game X-Y with 2 on 7 and 50 on 49 X won with the combination } %FEN "..."% 25-20 15x24 30x8.
Older programs cannot handle the % token, but IMO this is a good thing. Thoughts?

Piet Bouma
Posts: 3574
Joined: Sun Nov 02, 2003 13:05
Location: Harlingen

Post by Piet Bouma » Wed May 13, 2009 10:38

Wieger Wesselink wrote: I can see two situations where it is not uncommon to do a setup. In recordings of live games using electronic boards it will happen in say about 5% of the games that a setup is needed after the move recognition fails. And in game analyses that are published in newspapers it frequently happens that side steps are made like this:

Code: Select all

27-22 { In the game X-Y with 2 on 7 and 50 on 49 X won with the combination } 25-20 15x24 30x8.
I still believe there is a third situation [img]images/smilies/icon_lol.gif[/img], the illegal moves.
Examples:
A player captures just one peace while he has to take with another capture (sometimes with another peace) more peaces, and the game continues.
A player has to capture 5 peaces, but he takes only 4 peaces from the bord and leaves one behind. The game continues.
A player has to capture with a stroke 5 peaces, he takes them, but lets fall one peace and hits the clock. The fallen peace is on the bord and the other player wishes to continue the game with that.

All situations I have seen the last two years (also by fellow clubmates [img]images/smilies/icon_cool.gif[/img] ).
With a setup FEN the game can be continued in display.
Wieger Wesselink wrote: Thoughts?
How you must define this setup FEN? No thoughts at the moment. But it would be fine, if we all use the same method.

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Post by Ed Gilbert » Wed May 13, 2009 13:54

Older programs cannot handle the % token, but IMO this is a good thing. Thoughts?
Looking at pdn emitted by existing programs, I see that whenever there is a FEN tag in the header it is preceded by a SetUp tag, e.g.
[SetUp "1"]
[FEN "..."]
I have never seen a [SetUp "2"], and don't know what the purpose is of this tag, but perhaps it is to address the problem of setups embedded in the list of moves.

-- Ed

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Post by Ed Gilbert » Thu May 14, 2009 13:51

I found a description of the SetUp tag here: http://www.saremba.de/chessgml/standard ... htm#c9.7.1 Perhaps it could be extended to reference setups within the moves. As defined now there are only [SetUp "0"] which means the normal start of game, and [SetUp "1"] which must precede a FEN tag describing the game start position. These seem superfluous in the current standard, as [SetUp "0"] is always assumed, and the presence of a FEN tag is enough to describe a different game start position. I suspect most existing programs ignore SetUp tags and use any FEN tag as the game start position. I checked that CheckerBoard works this way, and the same with kingsrow.

-- Ed

Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Fri May 15, 2009 09:25

I have been thinking about the best way to continue working on the PDN definition. I'm currently setting up a web page containing a definition of PDN, see http://10x10.org/pdn/. Since there is no authority that can approve a PDN standard that is the best I can do. In the next week or so I'll try to complete it. Hopefully the discussions on this forum will lead to improvements, so that we arrive at a useful and practical definition.

Regarding setups I am now firmly convinced that these should be handled as an annotation to the moves. So they can appear anywhere in the analysis, and they are not hidden inside comments. This means I'll define it as an extension to PDN that is not compatible to older versions. People are free to ignore it. What is gained by this is that the GameBody will contain all information about the moves and the positions in the analysis, and this will not change by removing comments. Even the FEN tag in the GameHeader is no longer needed.

Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Sat May 16, 2009 13:54

What about the following definition for valid FEN? It allows for ranges of fields (31-50), and comma's between fields are optional.

Code: Select all

separator space: '\s+'
token Color: '[WB]'
token NumericFieldRange: 'K?\s*\d+(-\d+)?'
token AlphaNumericField: 'K?\s*[a-h][1-8]'
token Comma: ','

START         -> Color (':' Color FieldSequence)+
Field         -> NumericFieldRange | AlphaNumericField
FieldSequence -> Field (Comma? Field)*
Some examples of accepted strings are:

- 'W:W31-50:B1-20'
- 'W:W25,27,28,30,32-35,37,38:B12-14,16,18,19,21,23,24,26'
- 'W : W25 27 28 30 32-35 37 38 : B 12-14 16 18 19 21 23 24 26'
- 'W:W31-40:B1-10:W41-50:B11-20'
- 'W:WK4'
- 'W:W K4'
- 'W:W K 4'
- 'W:W K 4, 15,20,K 47:B36,K46'

Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Sun May 17, 2009 01:24

On http://10x10.org/pdn/test/PDNApplet.html I have put a java applet that checks for valid PDN according to the EBNF grammar in http://10x10.org/pdn.

I have used the ANTLR parser, with the following source: http://10x10.org/pdn/test/pdn.g. This parser generator seems to work fine, but I'm less enthusiastic about the documentation.

Piet Bouma
Posts: 3574
Joined: Sun Nov 02, 2003 13:05
Location: Harlingen

Post by Piet Bouma » Sun May 17, 2009 22:19

Wieger Wesselink wrote:On http://10x10.org/pdn/test/PDNApplet.html I have put a java applet that checks for valid PDN according to the EBNF grammar in http://10x10.org/pdn.

I have used the ANTLR parser, with the following source: http://10x10.org/pdn/test/pdn.g. This parser generator seems to work fine, but I'm less enthusiastic about the documentation.
I tried to paste some .pdn in the input field, but this does not work.
A bug? To type all .pdn code....

Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Sun May 17, 2009 23:18

Piet Bouma wrote:
Wieger Wesselink wrote:On http://10x10.org/pdn/test/PDNApplet.html I have put a java applet that checks for valid PDN according to the EBNF grammar in http://10x10.org/pdn.

I have used the ANTLR parser, with the following source: http://10x10.org/pdn/test/pdn.g. This parser generator seems to work fine, but I'm less enthusiastic about the documentation.
I tried to paste some .pdn in the input field, but this does not work.
A bug? To type all .pdn code....
It works for me with Ctrl-V and Shift-Insert, both with Internet Explorer and Firefox. So I don't know what to do about it.

ANTLR has a lot of interesting "features". For example if there is garbage at the end of the file it will not complain. I found a partial solution for that on google, but still you can add single tokens like '.' or '32' at the end.

Piet Bouma
Posts: 3574
Joined: Sun Nov 02, 2003 13:05
Location: Harlingen

Post by Piet Bouma » Sun May 17, 2009 23:23

Wieger Wesselink wrote:
Piet Bouma wrote:
Wieger Wesselink wrote:On http://10x10.org/pdn/test/PDNApplet.html I have put a java applet that checks for valid PDN according to the EBNF grammar in http://10x10.org/pdn.

I have used the ANTLR parser, with the following source: http://10x10.org/pdn/test/pdn.g. This parser generator seems to work fine, but I'm less enthusiastic about the documentation.
I tried to paste some .pdn in the input field, but this does not work.
A bug? To type all .pdn code....
It works for me with Ctrl-V and Shift-Insert, both with Internet Explorer and Firefox. So I don't know what to do about it.

ANTLR has a lot of interesting "features". For example if there is garbage at the end of the file it will not complain. I found a partial solution for that on google, but still you can add single tokens like '.' or '32' at the end.
Okay, CTRL-V works! I did only test right-click on mouse and "bewerken".
Thanks.

Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Thu May 21, 2009 20:33

I have updated the PDN description on http://10x10.org/pdn. It is now far more complete, and hopefully a valuable resource for programmers who use PDN.

The PDN checker on http://10x10.org/pdn/test checks most of the rules defined in the document above, either in strict or in permissive mode. So I encourage everyone to use this tool to improve the PDN output of his or her programs.

Please let me know if you have feedback or suggestions for improvements.

Piet Bouma
Posts: 3574
Joined: Sun Nov 02, 2003 13:05
Location: Harlingen

Post by Piet Bouma » Thu May 21, 2009 22:05

Wieger Wesselink wrote:I have updated the PDN description on http://10x10.org/pdn. It is now far more complete, and hopefully a valuable resource for programmers who use PDN.

The PDN checker on http://10x10.org/pdn/test checks most of the rules defined in the document above, either in strict or in permissive mode. So I encourage everyone to use this tool to improve the PDN output of his or her programs.

Please let me know if you have feedback or suggestions for improvements.
Very nice Wieger!! With this testparser we can make a step forward.
I see my output .pdn needs some improvements.

Is it a aware choice to not accept exotic 'Delftse results" like 10-0?
And what about 1+ - 1-? Officially accepted by FMJD.
And the zero's: 01-06. Not accepted in strict mode?
I serve: [WhiteClock ""]. Warning in the permissive check, accepted in strict mode?

I'am looking forward to the .pdn's delivered by electronic boards!!
In the future: play an applet from years ago and see the time
go by for one or both players. It will be live again!

Piet Bouma
Posts: 3574
Joined: Sun Nov 02, 2003 13:05
Location: Harlingen

Post by Piet Bouma » Thu May 21, 2009 22:58

Wieger Wesselink wrote:I have updated the PDN description on http://10x10.org/pdn. It is now far more complete, and hopefully a valuable resource for programmers who use PDN.

The PDN checker on http://10x10.org/pdn/test checks most of the rules defined in the document above, either in strict or in permissive mode. So I encourage everyone to use this tool to improve the PDN output of his or her programs.

Please let me know if you have feedback or suggestions for improvements.
Wieger, maybe you should also introduce "web-tags".
Linking to tournament-sites, FMJD-id from www.fmjd.org (rating and photograph of player) and Youtube-films (damvids) and web-photo-albums.
Internet makes this more important!
Also we maybe must introduce a sort of code for openings.

Wieger Wesselink
Posts: 1157
Joined: Sat Jun 28, 2003 13:22
Location: Eindhoven, The Netherlands
Contact:

Post by Wieger Wesselink » Fri May 22, 2009 00:29

Piet Bouma wrote: Very nice Wieger!! With this testparser we can make a step forward.
I see my output .pdn needs some improvements.

Is it a aware choice to not accept exotic 'Delftse results" like 10-0?
And what about 1+ - 1-? Officially accepted by FMJD.
And the zero's: 01-06. Not accepted in strict mode?
I serve: [WhiteClock ""]. Warning in the permissive check, accepted in strict mode?

I'am looking forward to the .pdn's delivered by electronic boards!!
In the future: play an applet from years ago and see the time
go by for one or both players. It will be live again!
Thanks Piet.

- Delft results are supported in the Result tag, but not as a game separator.
- Do you have a reference to an FMJD statement about 1+ - 1-?
- Leading zeroes are not supported in strict mode because it is mentioned in PDN 2.0. Perhaps this limitation should be dropped.
6.1.1.2.2 MOVE DEFINITION (Mandatory)

[[SQ][[DELIMITER][SQ]...]]

[SQ] = square number using standard checkers notation.

[Input] [SQ] can include a leading zero for single-figure square
numbers.
[Output] [SQ] does not include any leading zeros.
For me [WhiteClock ""] gives a warning in both permissive as strict mode!? Personally I think empty tags are useless and should be avoided, even in the case of the seven mandatory tags.

I'm looking for the complete GameType information for draughts variants. So far I have found these:

Code: Select all

[GameType "20,W,10,10,N2,0"]     {10x10 draughts}
[GameType "21,B,10,10,N1,0"]     {English draughts}
[GameType "22,W,8,8,N2,1"]       {Italian draughts}
[GameType "25,W,8,8,A1,0"]       {Russian draughts}
[GameType "26,W,8,8,A1,0"]       {Brazilian draughts}
[GameType "30,W,8,8,A1,0"]       {Turkish draughts}
[GameType "31,W,8,8,N1,0"]       {Thai draughts}
Does anyone know them for other draughts variants?

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Post by Rein Halbersma » Fri May 22, 2009 02:17

Wieger Wesselink wrote:

Code: Select all

[GameType "20,W,10,10,N2,0"]     {10x10 draughts}
[GameType "21,B,10,10,N1,0"]     {English draughts}
[GameType "22,W,8,8,N2,1"]       {Italian draughts}
[GameType "25,W,8,8,A1,0"]       {Russian draughts}
[GameType "26,W,8,8,A1,0"]       {Brazilian draughts}
[GameType "30,W,8,8,A1,0"]       {Turkish draughts}
[GameType "31,W,8,8,N1,0"]       {Thai draughts}
Does anyone know them for other draughts variants?
I think you mean for English draughts to be played on a 8x8 board. Here are some more variants, found from Wikipedia http://en.wikipedia.org/wiki/Draughts . I am still puzzled by Portugese draughts: it's in Adrian Millet's original list as well as on Wikipedia, but I don't know if it is not actually the same as Spanish draughts. I also have taken the liberty to give Frisian draughts gametype 29, and Czech checkers gametype 32.

Code: Select all

[GameType "20,W,10,10,N2,0"]     {10x10 international draughts}
[GameType "21,B,8,8,N1,0"]       {English draughts}
[GameType "22,W,8,8,N2,1"]       {Italian draughts}
[GameType "23,B,8,8,N1,0"]       {American pool draughts}
[GameType "24,W,8,8,N1,1"]       {Spanish pool  draughts} 
[GameType "25,W,8,8,A1,0"]       {Russian draughts}
[GameType "26,W,8,8,A1,0"]       {Brazilian draughts}
[GameType "27,W,12,12,N2,0"]     {Canadian  draughts}
[GameType "28,W,8,8,?,?"]        {Portugese  draughts}
[GameType "29,W,10,10,N2,0"]     {10x10 Frisian draughts}
[GameType "30,W,8,8,A1,0"]       {Turkish draughts}
[GameType "31,W,8,8,N1,0"]       {Thai draughts}
[GameType "32,W,8,8,A1,0"]       {Czech draughts}

Official rules are given below. Most of these rules can be read through http://translate.google.com , and they often have numbered diagrams :

// International rules: http://www.fmjd.org/docs/Annex%201%20of ... aughts.doc
// English rules: http://www.usacheckers.com/rulesofcheckers.php
// Italian rules: http://www.fid.it/regolamenti/2008/RegTec_CAPO_I.pdf
// Pool rules: http://americanpoolcheckers.us/american ... &Itemid=56
// Portugese rules: http://fpdamas.home.sapo.pt/regrasclass.htm
// Russian rules: http://www.shashist.ru/kodeks/kodeks2004.doc
// Czech rules: http://www.damweb.cz/pravidla/cdfull.html

The Czech also have their PDN files: http://www.damweb.cz/2008/mrdrcd08.pdn

Post Reply