[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [computer-go] Storing positions



Yes,  it might be simpler just to store as a list of moves.

It seems there are a few things one might want:

   1.  Readability.
   2.  Compactness.
   3.  Easy to parse.


You must sacrafice readiblity to get compactness and visa versa but
there are some good compromises as has been mentioned.  

To be fair, SGF does provide the ability to store "tree's" but it
doesn't do readability or compactness very well.  PGN also provides
the ability to store tree's and is easy to read.  They simple use
parenthesis to indicate alternate lines of play and they can be
nested.  Chess players are used to reading books that contain lines of
play with alternate lines of play in almost identical format.

If one really wanted compactness, you could do very well with a simple
binary format and completely throw out readability.

The FEN chess notation is not really that readable, but is fairly
compact.  It has a very nice virtue of one line per position.  It's
hard to actually understand a position from looking directly at a FEN
position but it's very easy to reconstruct a position on an actual
board from a diagram.  And it's easy to manually create a FEN diagram
from an actual position with an editor.

Incidently,  Bob Hyatt has used a variation of FEN that is more compact.
The last digit  between slashes can be eliminated to save a few bytes,
and it is more convenient to make a FEN diagram manually.   

But you could also eliminate the slashes (detracting from readability)
and save at least 8 bytes in every case.   You could elimate more if
there are no pieces left on the board,  if for instance the back ranks
are empty.

But for readability in GO diagrams, a diagram such as you propose is
hard to beat.

For parsability, it is easy in C to just dump the board in native
format.  But this is of course far from standard:

   You can do fwrite( &(position), sizeof(position), 1, stream );
   and the equivalent fread() to load it.  


- Don



   From: Marco Scheurer <marco@xxxxxxxxxxxxxxxxx>
   Date: Wed, 8 Jun 2005 13:51:23 +0200

   On Jun 8, 2005, at 5:41 AM, Darren Cook wrote:

   >> Is there a standard format for storing Go positions in a compact way
   >> that is easy for both humans and programs to parse?
   >
   > Ascii board diagrams (. for empty, @ or # for black, O for white).

   depending on what you are doing with these you would need another 
   symbol for ko. I use '!'.

   marco

   _______________________________________________
   computer-go mailing list
   computer-go@xxxxxxxxxxxxxxxxx
   http://www.computer-go.org/mailman/listinfo/computer-go/

_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/