A little proposal for promotion moves notation

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

A little proposal for promotion moves notation

Post by stegemma »

Looking at the moves printed on console by the genetic learning of Satana, I've noticed that it would be nice if all moves would be of the same length. That's true in simplified moves, but for promotions:

e2e4
c3e5
...
d7d8Q

So I propose to use this new standard for promotions (almost for standard chess):

d7cQ (captures on c8 and promotes)
d7dQ (normal push and promotion)
d7eQ (captures on e8 and promotion)

This would let all moves 4 characters long.

Maybe it will not becomes a standard but someone can find it useful for its console output (for debugging, for sample).
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
hgm
Posts: 27703
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A little proposal for promotion moves notation

Post by hgm »

Funny that I sort of use the binary equivalent of this in Spartacus. Because I use a 0x88-style board, half of the square numbers is invalid. I use those numbers in the to-square then to make sure the move always fits in 2 bytes. To accomodate enough different promotion pieces (in Capablanca Chess you would need 6) I do not encode the absolute file, but the file change (+1, 0, -1), so that it needs 3 x 6 = 18 off-board codes. Other codes can then be used to encode castlings, e.p. captures and double pushes.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: A little proposal for promotion moves notation

Post by stegemma »

hgm wrote:Funny that I sort of use the binary equivalent of this in Spartacus. Because I use a 0x88-style board, half of the square numbers is invalid. I use those numbers in the to-square then to make sure the move always fits in 2 bytes. To accomodate enough different promotion pieces (in Capablanca Chess you would need 6) I do not encode the absolute file, but the file change (+1, 0, -1), so that it needs 3 x 6 = 18 off-board codes. Other codes can then be used to encode castlings, e.p. captures and double pushes.
In fact, using the extra bit in 0x88 binary format is some how equivalent to use an alpha character in human readable coding, where normally there are a decimal digit. Same idea in different context :)
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: A little proposal for promotion moves notation

Post by sje »

Why not use SAN? A SAN move string is only as long as it needs to be, and it's human readable.

The "e2e4 e7e5 g1f3" business is something best left to the 1970s dedicated chess computers where it got its start.

Symbolic has as part of each Move instance a set of move flags:

Code: Select all

// Move flags

typedef enum
{
  MfNil = -1,
  MfAndf,  // SAN notation: file disambiguation
  MfAndr,  // SAN notation: rank disambiguation
  MfChck,  // SAN notation: check
  MfDraw,  // Immediate draw
  MfMate,  // SAN notation: checkmate
  MfNote,  // Notated
  MfNull,  // Null
  MfZrs7,  // Reserved 7
  MfZrs8   // Reserved 8
} Mf;
There is a set of routines which will generate and apply correct notation flags to a move, list of moves, or a variation. When each of the four notation flags is correctly set or reset, then the MfNote flag is set. This MFNote flag is used to avoid re-notating a move and saves time in situations like when the current variation is being traced.

These routines are not hard to write, and they can be quite fast when using bitboards. A little bit of cleverness can help implement a fast routine which will tell if any of the moves in a position need notation work.

No move is allowed to appear externally that is not properly notated, and only properly notated moves are allowed to be input.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: A little proposal for promotion moves notation

Post by stegemma »

sje wrote:Why not use SAN? A SAN move string is only as long as it needs to be, and it's human readable.[...]
Yes, I know that SAN is more compressed but I would use a fixed length notation because I want to examine the console output and having moves well aligned looks better, so I've shared this little trick.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
Henk
Posts: 7210
Joined: Mon May 27, 2013 10:31 am

Re: A little proposal for promotion moves notation

Post by Henk »

It is also possible to give each move a number. I did something like that to store a game in the database. Perhaps I thought it would save space.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: A little proposal for promotion moves notation

Post by stegemma »

Henk wrote:It is also possible to give each move a number. I did something like that to store a game in the database. Perhaps I thought it would save space.
Of course there must be even better solutions. In my case, I just want to look at this kind of output:

Code: Select all

# 6-7 'Stones of Years' -10 vs 'Tarkus' -11
b1a3 c7c6 a3c4 d7d5 c4e5 d8d6 f2f4 d6b4 e2e3 c8f5 g1f3 a7a5 c2c3 b4c5 f3d4 b8d7
d4f5 d7e5 f4e5 g8h6 f5h4 g7g6 d2d4 c5b6 e3e4 g6g5 c1g5 b6b2 a1b1 b2a2 b1b7 h6g8
f1d3 g8h6 e5e6 a2a3 e1g1 a3d6 d1h5 d6e6 g1h1 h8g8 g5c1 e6g4 d3e2 g4e4 c1h6 g8g6
e2g4 e4g4 h5g4 g6g4 h4f5 g4e4 h6g5 f7f6 g5f4 h7h6 f5g3 e4f4 f1f4 e8c8 b7a7 h6h5
a7a8 c8d7 a8d8 d7d8 f4f1 h5h4 f1b1 h4g3 b1b8 d8d7 b8f8 d7c7 h2g3 a5a4 f8e8 a4a3
0
e2e3 e7e6 d1g4 b8c6 f1a6 c6e5 g4d4 f8d6 g1f3 b7b5 f3e5 c8a6 e5c4 b5c4 d4g7 d8f6
g7g4 d6f8 h1f1 e6e5 f1g1 f8g7 b1c3 h7h6 c3d5 f6g5 d5c7 e8d8 g4g5 h6g5 c7a8 e5e4
g1h1 g8e7 c2c3 e7d5 d2d3 c4d3 c1d2 g7e5 e1c1 a6c4 h2h4 g5g4 h1h2 e5h2 g2g3 d8c8
a2a4 c8b7 a4a5 f7f6 d1h1 b7a8 h1h2 d5e7 h4h5 e7c6 h5h6 c6a5 h2h1 a5b3 c1d1 h8b8
h6h7 b8h8 d1e1 f6f5 f2f3 g4f3 h1h6 b3d2 e1f2 d2b3 h6h1 d3d2 h1f1 -1
I know, it's a lot '90 years but I don't follow soccer so I look at engine tuning on my monitor ;)
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: A little proposal for promotion moves notation

Post by Robert Pope »

stegemma wrote:Looking at the moves printed on console by the genetic learning of Satana, I've noticed that it would be nice if all moves would be of the same length. That's true in simplified moves, but for promotions:

e2e4
c3e5
...
d7d8Q

So I propose to use this new standard for promotions (almost for standard chess):

d7cQ (captures on c8 and promotes)
d7dQ (normal push and promotion)
d7eQ (captures on e8 and promotion)

This would let all moves 4 characters long.

Maybe it will not becomes a standard but someone can find it useful for its console output (for debugging, for sample).
I guess you could also store regular moves as "e2e4 ". I think the extra space shouldn't break anything if it got fed to another program. Actually, I think it would look pretty nice visually -- the promotions will jump out like your team just scored a goal. :)
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

A big fat proposal for move notation

Post by sje »

A big fat proposal for move notation for voice synthesis, example is BWTC.0031:
[d]2qrr1n1/3b1kp1/2pBpn1p/1p2PP2/p2P4/1BP5/P3Q1PP/4RRK1 w - - 0 1[/d]

Code: Select all

[] sf 2qrr1n1/3b1kp1/2pBpn1p/1p2PP2/p2P4/1BP5/P3Q1PP/4RRK1 w - - 0 1
[] dmverb
The white bishop at square d6 moves to square a3.
The white bishop at square d6 moves to square b4.
The white bishop at square d6 moves to square b8.
The white bishop at square b3 moves to square c2.
The white bishop at square b3 moves to square c4.
The white bishop at square d6 moves to square c5.
The white bishop at square d6 moves to square c7.
The white bishop at square b3 moves to square d1.
The white bishop at square b3 moves to square d5.
The white bishop at square d6 moves to square e7.
The white bishop at square d6 moves to square f8.
The white bishop at square b3 captures the black pawn at square a4.
The white bishop at square b3 captures the black pawn at square e6 giving check.
The white king at square g1 moves to square f2.
The white king at square g1 moves to square h1.
The white queen at square e2 moves to square b2.
The white queen at square e2 moves to square c2.
The white queen at square e2 moves to square c4.
The white queen at square e2 moves to square d1.
The white queen at square e2 moves to square d2.
The white queen at square e2 moves to square d3.
The white queen at square e2 moves to square e3.
The white queen at square e2 moves to square e4.
The white queen at square e2 moves to square f2.
The white queen at square e2 moves to square f3.
The white queen at square e2 moves to square g4.
The white queen at square e2 moves to square h5 giving check.
The white queen at square e2 captures the black pawn at square b5.
The white rook at square e1 moves to square a1.
The white rook at square e1 moves to square b1.
The white rook at square e1 moves to square c1.
The white rook at square e1 moves to square d1.
The white rook at square f1 moves to square f2.
The white rook at square f1 moves to square f3.
The white rook at square f1 moves to square f4.
The white pawn at square a2 moves to square a3.
The white pawn at square c3 moves to square c4.
The white pawn at square d4 moves to square d5.
The white pawn at square e5 captures the black knight at square f6.
The white pawn at square f5 captures the black pawn at square e6 giving check.
The white pawn at square g2 moves to square g3.
The white pawn at square g2 moves to square g4.
The white pawn at square h2 moves to square h3.
The white pawn at square h2 moves to square h4.
En passant, promotion, castling, and checkmate are handled as expected. I might add code for discovered and double check.

The output is sorted by SAN but probably should be sorted by text.

I have an old EDN (English Descriptive Notation) output routine somewhere and maybe I should install it with its own move-to-text converter. EDN is easy to generate but not so easy to parse because of ambiguity difficulties.

More baroque would be to use pre-EDN from the 17th century and before with its ordinals, houses, fields, and marches.

Also:

Code: Select all

- .... . .-- .... .. - . -... .. ... .... --- .--. .- - ... --.- ..- .- .-. . -... ...-- -.-. .- .--. - ..- .-. . ... - .... . -... .-.. .- -.-. -.- .--. .- .-- -. .- - ... --.- ..- .- .-. . . -.... --. .. ...- .. -. --. -.-. .... . -.-. -.- .-.-.- ...-.-
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: A big fat proposal for move notation

Post by stegemma »

If we think to help visual impaired people, maybe we should redefine even the FEN description of the position, to have a clear and compact conversion in various languages. This should be done by the interface, of course, not at a db format level.

I'm working on a barcode printing software... and maybe we can also translate a FEN into a QR-Code or Data Matrix. If we would translate a whole game to data matrix, then the most and compact human readable solution would be nice... but who could wants to use/need data matrix to store chess? Maybe chess magazines?
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com