chiark / gitweb /
cp: Tweak guess selection algorithm: minimize largest bin.
The computer player analyses guesses by trying each possible guess
prototype and dividing the remaining code candidates into bins according
to the possible ratings for the guess.
Previously, we'd choose the guess which minimizes the square-sum of the
bin sizes. This change makes it choose the guess which minimizes the
size of the largest bin.
This is simpler to compute (it can be done in integers -- the least
squares code used doubles to avoid overflow). Unfortunately, the play
is somewhat poorer, even though it's often faster.