Artificial Intelligence / Unit 3 AI 0145 worked example, 60 to 90 seconds
Pebbles, Solved Whole
The idea
Backward scoring solves the game of Pebbles completely, on an index card.
In practice
The rules: five pebbles on the table; players alternate; a turn takes one or two pebbles; whoever takes the last pebble wins. Work upward from the smallest endgames, scoring each count for the player about to move. One pebble left: take it — win. Two left: take both — win. Three left: taking one leaves two, taking two leaves one — either way the opponent inherits a winning count. Three is a loss no skill repairs. Four left: take one, and the opponent faces the poisoned three — win. Five left: take two, same poison — win. The table is the whole game: five rows, every position settled, and the first player wins Pebbles by taking two and never letting the poison leave the opponent's side.
Where people slip
No cleverness about pebbles appeared anywhere — the rule "score endings, let each fork's controller pick" did everything.
Your place on the trail
Every lesson rests on earlier ones and opens later ones. Tap any to jump.
Something wrong in this lesson? Flag it · Sources for Artificial Intelligence