Place a disc to outflank your opponent: your disc must form a straight line (horizontal, vertical, or diagonal) with another of your discs, with one or more opponent discs in between. All outflanked discs flip to your color. If you can't make a valid move, your turn is skipped. The game ends when neither player can move. Most discs wins.
The AI: Minimax with Alpha-Beta Pruning
The AI looks 5 moves ahead using a tree search. At each level, it assumes Black picks the move that maximizes the score and White picks the move that minimizes it (minimax). Alpha-beta pruning skips branches that can't possibly affect the outcome, cutting the search from ~30,000 nodes to ~3,000.
Board Evaluation (Heuristic)
The AI scores positions using: corners (worth +25, nearly uncapturable), edges (+5, stable), squares adjacent to corners (-10, dangerous to occupy early), mobility (how many moves you have vs opponent), and disc count (only matters late-game). This weighted sum guides the search.
Game Over
Discussion
Sign in with GitHub to share strategies, ask questions, or report a bug.