Programming Chess #4 - Like a human
Or like an ice fairy, as the case may be.
To analyse the position below, Cirnovelty would first look at, say, Bc4. Eventually it (right, I've decided that using 'she' sounds awkward most of the time. I'll use the firm policy of switching between 'it' and 'she' whenever I feel like it) would figure out that, after Bc4, ...Rh1+ leads to mate in two, and discard that move. Then she would look at Ba4. Eventually it would figure out that, after Ba4, ...Rh1+ leads to mate in two, and discard that move. Then she would look at d6. Eventually she would figure out that, after d6, ...Rh1+ leads to mate in two, and discard that move. Then it would look at...
-there's a lot of wasted computation here.
How do humans do it? Most of us find the threats and then look for ways to deal with it, not the other way around.
So, Cirnovelty uses a recommendation list of sorts. The first time it analyses the move Bc4, it adds ...Rh1 to the list of black's reccomended moves, and adds Bc4 to the list of white's definitely not reccomended moves.
Then, after Ba4, Cirno looks at the mating line first and gets rid of a lot of needless computation.
Now our formula for analysing moves turns into
(material worth) + (excitement value) + (reccomendation) - (# of moves ahead).
Expect this formula to get more and more complicated until it takes over the world.
Next time- a short break as I look at a totally completely different method.