ArticleslgStudy

computer science

Connect Four

Connect Four is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Connect Four rather than just read about it. In short: Connect Four (also known as Connect 4, Four Up, Plot Four, Find Four, Captain's Mistress, Four in a Row, Drop Four, and, in the Soviet Union, Gravitrips) is a game in which the players choose a color and then take turns dropping colored tokens into a six-row, seven-column vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column.

Connect Four — main illustration
Connect Four — illustration

Key takeaways

  • Connect Four belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Connect Four to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Connect Four from memory before moving on to harder problems.

Reference excerpt

Connect Four (also known as Connect 4, Four Up, Plot Four, Find Four, Captain's Mistress, Four in a Row, Drop Four, and, in the Soviet Union, Gravitrips) is a game in which the players choose a color and then take turns dropping colored tokens into a six-row, seven-column vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own tokens. It is therefore a type of m,n,k-game (7, 6, 4) with restricted piece placement. Connect Four is a solved game; the first player can always win by playing the right moves. The game was created by Howard Wexler, and first sold under the Connect Four trademark by Milton Bradley in February 1974.

Gameplay Object: Connect four of your discs in a row while preventing your opponent from doing the same. But, look out – your opponent can sneak up on you and win the game! A gameplay example (below right) shows the first player starting Connect Four by dropping one of their yellow discs into the center column of an empty game board. The two players then alternate turns dropping one of their discs at a time into an unfilled column, until the second player, with red discs, achieves a diagonal four in a row, and wins the game. If the board fills up before either player achieves four in a row, then the game is a draw.

Mathematical solution Connect Four is a two-player game with perfect information for both sides, meaning that nothing is hidden from anyone. Connect Four also belongs to the classification of an adversarial, zero-sum game, since a player's advantage is an opponent's disadvantage. One measure of complexity of the Connect Four game is the number of possible board positions. For classic Connect Four played on a 7-column-wide, 6-row-high grid, there are 4,531,985,219,092 positions for all game boards populated with 0 to 42 pieces.

The game was first solved by James Dow Allen (October 1, 1988), and independently by Victor Allis (October 16, 1988). Allis describes a knowledge-based approach, with nine strategies, as a solution for Connect Four. Allen also describes winning strategies in his analysis of the game. At the time of the initial solutions for Connect Four, brute-force analysis was not deemed feasible given the game's complexity and the computer technology available at the time. Connect Four has since been solved with brute-force methods, beginning with John Tromp's work in compiling an 8-ply database. The artificial intelligence algorithms able to strongly solve Connect Four are minimax or negamax, with optimizations that include alpha-beta pruning, move ordering, and transposition tables. The code for solving Connect Four with these methods is also the basis for the Fhourstones integer performance benchmark. In 2025, a win-draw-loss look-up table was computed for the classic 7x6 board. The solved conclusion for Connect Four is first-player win. With perfect play, the first player can force a win, on or before the 41st move by starting in the middle column. The game is a theoretical draw when the first player starts in the columns adjacent to the center. For the edges of the game board, column 1 and 2 on left (or column 7 and 6 on right), the exact move-value score for first player start is loss on the 40th move, and loss on the 42nd move, respectively. In other words, by starting with the four outer columns, the first player allows the second player to force a win.

Rule variations There are many variations of Connect Four with differing game board sizes, game pieces, and gameplay rules. Many variations are popular with game theory and artificial intelligence research, rather than with physical game boards and gameplay by persons. The most commonly used Connect Four board size is 7 columns × 6 rows. Size variations include 5×4, 6×5, 8×7, 9×7, 10×7, 8×8, Infinite Connect-Four, and Cylinder-Infinite Connect-Four. Several versions of Hasbro's Connect Four physical gameboard make it easy to remove game pieces from the bottom one at a time. Along with traditional gameplay, this feature allows for variations of the game. Some earlier game versions also included specially marked discs, and cardboard column extenders, for additional variations to the game.

PopOut

PopOut starts the same as traditional gameplay, with an empty board and players alternating turns placing their own colored discs into the board. During each turn, a player can either add another disc from the top, or if one has any discs of their own color on the bottom row, remove (or "pop out") a disc of one's own color from the bottom. Popping a disc out from the bottom drops every disc above it down one space, changing their relationship with the rest of the board and changing the possibilities for a connection. The first player to connect four of their discs horizontally, vertically, or diagonally wins the game.

Pop 10 Before play begins, Pop 10 is set up differently from the traditional game. Taking turns, each player places one of their own color discs into the slots filling up only the bottom row, then moving on to the next row until it is filled, and so forth until all rows have been filled. Gameplay works by players taking turns removing a disc of one's own color through the bottom of the board. If the disc that was removed was part of a four-disc connection at the time of its removal, the player sets it aside out of play and immediately takes another turn. If it was not part of a "connect four", then it must be placed back on the board through a slot at the top into any open space in an alternate column (whenever possible) and the turn ends, switching to the other player. The first player to set aside ten discs of their color wins the game.

Five-in-a-Row The Five-in-a-Row variation for Connect Four is a game played on a 6 high, 9 wide grid. Two additional board columns, already filled with player pieces in an alternating pattern, are added to the left and right sides of the standard 6-by-7 game board. The game plays similarly to the original Connect Four, except players must now get five pieces in a row to win. This is still a 42-ply game since the two new columns added to the game represent twelve game pieces already played, before the start of a game.

… excerpt ends here. Continue reading the full article.

Illustrations

Connect Four illustration
Connect Four illustration
Connect Four: Gameplay of Connect Four
Gameplay of Connect Four
Connect Four: A travel version of the Milton Bradley game
A travel version of the Milton Bradley game

Worked examples

Example 1 — a first encounter with Connect Four

Start with the simplest possible case. Write down what Connect Four claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Connect Four before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Connect Four ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Connect Four

In research
Connect Four appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Connect Four in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Connect Four is common in secondary-school and first-year university syllabi. It links to neighbouring topics Abstract strategy games, Board games introduced in 1974, Children's board games, so understanding it makes those chapters shorter.
In everyday life
Look for Connect Four outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Connect Four” →

How to study Connect Four in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Connect Four means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Connect Four out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Connect Four in simple terms?

Connect Four (also known as Connect 4, Four Up, Plot Four, Find Four, Captain's Mistress, Four in a Row, Drop Four, and, in the Soviet Union, Gravitrips) is a game in which the players choose a color and then take turns dropping colored tokens into a six-row, seven-column vertically suspended grid…

Why does Connect Four matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Connect Four?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Connect Four.

Tags

  • Abstract strategy games
  • Board games introduced in 1974
  • Children's board games
  • Computer-assisted proofs
  • Connection games
  • Games played on Go boards
  • In-a-row games
  • Milton Bradley Company games
  • Paper-and-pencil games
  • Solved games

Keep exploring