Playing a round of checkers
Now, it's time to take a break and play checkers. For this recipe, we are going to implement an artificial intelligence kernel capable of analyzing a checkers board, determining, under the game rules, where to move while staying out of the reach of the opponent's attacks, and spotting the opportunity as to when it can capture some of the enemy's soldiers.
Let's go through a little refresher of the game of checkers. You and your opponent are located on a square chess board, but you are only able to move diagonally over black squares one step at a time. Also, you can only move forward. Both of you can capture an enemy piece if it is situated just one step away from one of your pieces, provided that when you jump over it ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access