🔴 Connect Four

Click a column to drop your red disc. Connect four in a row — horizontally, vertically or diagonally.

Loading game…

About Connect Four

Connect Four is a vertical strategy game: discs dropped into a column fall to the lowest free slot, and you are trying to line up four of your own. You play red against a yellow computer opponent that looks several moves ahead.

How to play

  • The board has 7 columns and 6 rows. You play red and always move first; the computer plays yellow.
  • On your turn, choose a column. Your disc drops to the lowest empty space in that column. A full column cannot be chosen.
  • Four of your discs in a straight line horizontally, vertically or diagonally wins the game, and the winning four are outlined.
  • If all 42 spaces fill without a line of four, the game is a draw.
  • The score bar counts your wins and the computer's wins for the current visit; your Best is the highest win count you have reached.

Controls

  • Click or tap anywhere in a column to drop your disc there.
  • Each column is a button, so you can Tab between columns and press Enter or Space to drop a disc.
  • After a game ends, press Play again for a fresh board. You move first every game.

Tips and strategy

  • Take the centre column early. More winning lines pass through the middle column than any other, and the computer values it too.
  • Look at what your move gives away: every disc you drop also makes the space above it playable for your opponent.
  • Build threats in different rows. Two threats stacked one directly above the other are especially strong, because blocking the lower one hands you the upper one.
  • Avoid forcing moves that do nothing; they often create a playable space your opponent can use.
  • The computer searches about five moves deep, so traps that only pay off further ahead than that are your best chance to win.

Background

Connect Four was published by Milton Bradley in 1974, though games of lining up pieces in a vertical frame are older. It is also a well-known solved game: in 1988 James D. Allen and, independently, Victor Allis showed that on the standard 7 by 6 board the first player can always force a win with perfect play, provided the first disc goes in the centre column. In practice the game is far too deep for people to play perfectly, which keeps it interesting.

Questions

How strong is the computer?
It runs a negamax search with alpha-beta pruning about five plies deep and scores positions by counting open lines of two and three, with a small bonus for the centre column. It blocks obvious threats and spots short traps, but it can be beaten by plans that develop beyond its search depth.
Can I play against a friend?
Not in this version. Connect Four here is always you against the computer.
Do I always go first?
Yes. You play red and make the first move in every game, which is an advantage in Connect Four.
Advertisement

More games