Perfect moves lab

Games grouped by how far a plain algorithm can take us. Solved games give exact perfect-move hints. The Not solved side holds the games that need a real engine.

Four wolves, one sheep

Wolves step diagonally forward only (down the board). The sheep steps diagonally in any direction. Wolves win by trapping the sheep. The sheep wins by reaching the top row.

Solving every possible game…
Tap a piece, then tap a dot to move. The computer answers with perfect moves, and every move you make gets graded.
    Why this one is fully algorithmic
    • A position is just the four wolf squares, the sheep square and whose turn it is.
    • Wolves never move backward, so every game is finite. That means the whole game tree can be searched to the end.
    • The page runs minimax with memoisation over every reachable position. Each position gets a score: who wins, and how many plies until the game ends.
    • A “perfect” move is one whose resulting position keeps the best score. The winner picks the fastest win, the loser picks the longest delay.
    • Rule of thumb the search keeps rediscovering: advance the rear wolf, keep the line staggered, and never leave a gap the sheep can slip through.