[Computer-go] A cautionary tale about randomness, Part 2

Mark Boon tesujisoftware at gmail.com
Fri Sep 7 20:46:12 PDT 2012


On Sat, Sep 8, 2012 at 5:34 PM, Dave Dyer <ddyer at real-me.net> wrote:
>
>>
>>Only if all 100 legal moves are different from the legal moves in the
>>previous position.
>
> The dynamics are different for each game. Go is an especially favorable
> case for incrementally maintaining the list of legal moves.
>

OK, I took a quick peek at the rules. There are 49 positions and each
position can move between 3 and 6 directions. That looks like 250 or
so possible moves (location + direction combinations). So you just
make a list of 250 large and pick a random one and see if it's legal.
If not, you swap it with the last untested item in the list and you
pick random from the same list - 1. Continue until you find a legal
move. When done, you reset your 'untested' pointer back to the end.

Mark



More information about the Computer-go mailing list