[computer-go] creating a "random" position

Erik van der Werf erikvanderwerf at gmail.com
Sun Jul 8 13:49:41 PDT 2007


On 7/8/07, George Dahl <george.dahl at gmail.com> wrote:
> How would one go about creating a random board position with a uniform
> distribution over all legal positions?  Is this even possible?  I am
> not quite sure what I mean by uniform.  If one flipped a three sided
> coin to determine if each vertex was white,black or empty, then one
> would have to deal with stones with no liberties somehow.  Could those
> just removed?
>
> - George

All legal positions can be enumerated, so just create a database
containing all legal positions and then select one at random. If this
does not work for you, e.g., due to insufficient storage, just keep
generating random positions (using your special coin) until you hit
one that's legal. OC, once you start 'correcting' illegal positions it
probably won't be uniform over all legal positions any more, that's
why, unless you come up with something clever, you should regenerate
the entire position.

May I ask why you need any of this?

E.


More information about the computer-go mailing list