|
|
1.
Avoid depth-first search, go width-first.
2.
Keep track of every position encountered.
Every position has a pointer to the previous position in the game. (That
position also has it's own previous position etc etc). If the position has
been encountered before, ignore it and don't save it, because when the
program "met" it before, it had done less moves/steps to reach it.
3.
When a single step makes the game situation flip-invertable, you're halfway
and the rest of the game is like the beginning but than flipped-inverted
going backward.
4.
Throw away step sequences that are *absolutely* unnecessary. This is the
trickiest part :-P
Post a reply to this message
|
|