diff options
Diffstat (limited to 'include/negamax_cnn1986.c')
| -rw-r--r-- | include/negamax_cnn1986.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/negamax_cnn1986.c b/include/negamax_cnn1986.c index 6c834f1..1dd0e72 100644 --- a/include/negamax_cnn1986.c +++ b/include/negamax_cnn1986.c @@ -391,9 +391,13 @@ negamax_cnn1986(const uint8_t cur_depth, float alpha, float beta, negamax_cnn1986_display_progress(cur_depth); } } - // Insert into the cache if we're not too deep + // Insert into the cache if we're not too deep, and make it + // useable for both min and max (colour * colour == 1) if (cur_depth < negamax_cnn1986_cache_threshold) - cnn1986_cache_insert(alpha); + cnn1986_cache_insert(colour*alpha); + } else { + // Impose the colour + alpha *= colour; } return alpha; } |
