The Shot That Survives the Reply
The tempting shot is straight towards the centre. One controlled flick, a clean passage between the pegs, and perhaps that satisfying drop into the hole. But the disc that stops short might become your opponent’s easiest takeout.
Today’s crokinole lesson: judge a shot by what happens after the applause.
Minimax makes that instinct executable. For each candidate shot, consider several opposing replies and keep the worst resulting position. Then choose the shot whose worst result is best. It is a natural fit for adversarial games: assume the other player recognizes the opportunity you leave behind.
These numbers are invented position evaluations from our perspective, not official crokinole scores. Higher is better. Each row describes the results of three possible replies after a candidate shot.
shots = {
"centre": [20, -6, 4],
"guard": [3, 1, 2],
"takeout": [8, -2, 5],
}
choice = max(shots, key=lambda name: min(shots[name]))
print(f"Choose {choice}: worst reply leaves {min(shots[choice])}")
The guard wins with a worst-case evaluation of 1. The centre attempt has the prettiest upside, but minimax gives it no credit for an outcome a capable opponent can avoid.
Zig spells out the same two reductions: find each row’s minimum, then retain the largest minimum.
const std = @import("std");
pub fn main() void {
const names = [_][]const u8{ "centre", "guard", "takeout" };
const scores = [_][3]i32{ .{ 20, -6, 4 }, .{ 3, 1, 2 }, .{ 8, -2, 5 } };
var best: usize = 0;
var value: i32 = -6;
for (scores, 0..) |replies, i| {
var worst = replies[0];
for (replies) |score| { worst = @min(worst, score); }
if (worst > value) { best = i; value = worst; }
}
std.debug.print("Choose {s}: worst reply leaves {d}\n", .{ names[best], value });
}
There is a catch hiding beside the pegs. This tiny model treats every listed reply as achievable and ignores flicking errors, rebound uncertainty, and unlisted responses. A difficult takeout receives the same respect as an effortless one. That can make the choice overly cautious.
Still, the useful habit survives the simplification: before admiring your own shot, borrow your opponent’s chair.