, . , .
. :
score = number of allies - number of opponents
+ 3 * number of crowned allies - 3 * number of crowned opponents
, . , . , .
To make naive checkers an “engine”, all you have to do is find the best move, given the position on the board, which simply searches for all immediate legal steps and finds one that maximizes your result.
Your engine will not think more than one move, but it will be able to play a little with you.
The next step is to give your engine the ability to plan ahead, which essentially predicts your opponent’s reaction. To do this, simply find the best opponent (there is a recursion) and subtract it from your account.
source
share