The Algorithms That Play Games
Every time a computer plays chess, Go, or even tic-tac-toe, it uses one of these algorithms. Minimax looks ahead through every possible future. Alpha-beta pruning cuts the tree down to size. Monte Carlo Tree Search plays thousands of random games to find the best move. Here you can play against these algorithms, watch them think, and see their decision trees unfold in real time.
The fundamental tree-search algorithms that power game-playing AI. From brute-force minimax to the elegant pruning strategies that make deep search possible.
Play against a perfect AI. Watch the minimax algorithm explore every possible game state to find the optimal move. Can you draw against perfection?
Step through alpha-beta pruning on a game tree. Watch branches get eliminated when the algorithm proves they can’t affect the outcome. Green=explored, red=pruned.
Monte Carlo Tree Search plays Connect-4 against you. Instead of evaluating positions, it plays thousands of random games to estimate which move wins most often.
Negamax simplifies minimax by using score(me) = -score(opponent). Play the ancient game of Nim against it and watch the evaluation bars shift with each move.
Algorithms that make game tree search faster and smarter without changing the result. These are the tricks that let AI search millions of positions per second.
When games involve chance (dice, cards), expectimax replaces MIN nodes with CHANCE nodes that compute expected values. Roll dice and watch the AI reason about probability.
Search depth 1, then 2, then 3… each iteration goes one level deeper. Watch the tree light up layer by layer, with each pass refining the best move.
Different move orders can reach identical game states. Transposition tables cache evaluated positions, sometimes cutting search time by 30% or more.
The heuristics that guide search, and a real-time tournament pitting different strategies against each other.
Compare material counting, positional scoring, and mobility analysis on the same chess position. Move pieces around and see how each heuristic evaluates differently.
Draw walls, place start and goal, then watch A*, Dijkstra, and Greedy BFS race to find the shortest path. Compare how many nodes each algorithm expands.
Minimax vs Random vs Greedy vs Center-First—pit four AI strategies against each other in a round-robin Tic-Tac-Toe tournament. Watch the standings evolve.