A single integer N = a complete chess game

Maximilian Hasler Maximilian.Hasler at martinique.univ-ag.fr
Thu Apr 10 17:10:44 CEST 2008


>  What would be the most "economical way" to assign a single number
>  to a complete chess game? I guess this number would be of googol-
>  length...

it is sufficient to use the number obtained from concatenating initial
and final square of each move, i.e.
G = sum( (a.i+64b.i)*64^2i )
where i is the half-move, and a.i, b.i is starting / ending square

more economical would be to use a convention about numbering possible
moves, and to use
G = c0 + p0*( c1 + p1*(....))

where c0 is the number of the first half-move made, among the p0
possibilities (this number is known at the initial position)
then, after move "c0", again it is known how many moves p1 are
possible, and each has a unique number c1 in {0,...,p1}, etc.

So you can successively isolate the move c.i by taking what remains
from G after previous divisions mod p.i, and that way reconstruct the
whole game.
I think this should be nearly optimal at least for the class of
"greedy" encoding schemes.

Maximilian





More information about the SeqFan mailing list