From: Ejner B. <ej...@gm...> - 2007-07-14 21:46:51
|
On 7/14/07, Michal Rudolf <mr...@kd...> wrote: > Ejner Borgbjerg, sobota, 14 lipca 2007: > >I have thought loosely about file formats for implementing position > >databases. One question that is also relevant for native game > >databases, is how moves can be encoded. Of course, texts like "Nge2" > >is wasteful of space. So, I was wondering if someone else here has > >considered this ? > Yes. Most straightforward idea is to encode piece index in first 4 bits of a > byte and move direction in the next 4 bits. This allows to encode all moves > for all pieces except for queen's diagonal moves. Ok, so we can just use two bytes for a Q diagonal move. Sounds like a reasonable suggestion to me. It may be possible to squeeze all moves into one byte, but I fear this could get much more complex (!?) Ejner |