Chapter 2 · GameConnect Four? ← Chapter 2 CloseHow to playPlayers take turns choosing one of the seven columns (click a column, or use the arrow buttons above the board with Tab and Enter).The disc falls to the lowest empty cell in that column. Red always starts.The first player to connect four discs in a horizontal, vertical or diagonal line wins at once.A full column cannot be chosen.If the board fills up without four in a row, the game is a draw.Computer levelsEasy plays at random but never misses a move that wins immediately.Medium wins with or blocks immediate threats and avoids giving the opponent the cell above a threat.Hard looks seven half-moves ahead with minimax and alpha-beta pruning; it scores open twos and threes.Threats and forksA strong move often creates a threat: a cell that wins on the next turn. Even stronger is a fork: on the next turn there are two separate winning moves and the opponent can block only one. Because discs fall downward, every future threat also depends on whether the supporting cells beneath it can be filled safely.Strategy tipsThe middle column takes part in more possible fours than the edge columns.Before chasing your own long plan, check whether the opponent can win right away.Avoid moves that give the opponent the supporting cell needed for a winning diagonal.Against the Hard level, build several threats instead of relying on one obvious line.Connection to game theoryConnect Four is a deterministic, perfect-information game; it was solved in 1988: with perfect play the first player wins. It is a compact setting for minimax reasoning, tactical threat detection, alpha-beta pruning and heuristic evaluation. The gravity rule makes the action space especially interesting, because not every empty cell is immediately playable.