Skip to content

Five in a row

Updated: 6 min read

Setting up the board…

The classic board is seven columns wide. Here it is nine, and the two extra columns are already full when the game starts. You cannot drop a disc into them, but you can build on them. The goal grows from four to five. When pupils at the club have mastered the ordinary game, this is the variant that makes them rebuild their habits, because most of what feels natural in Connect 4 is one disc too short here.

The board

The board is nine columns wide and six rows tall. The first column holds, from the bottom up, red, yellow, red, yellow, red, yellow. The last column is the same pattern with the colours swapped: yellow, red, yellow, red, yellow, red. In every row, then, one edge disc is red and the other is yellow. In odd rows red has the left one, in even rows red has the right one.

A 9 by 6 Connect 4 board with the first and last columns completely filled with alternating red and yellow discs and the seven middle columns empty; the cells of the third row are marked with the numbers 5, 8, 10, 11, 10, 8, 55810111085Column 11Column 22Column 33Column 44Column 55Column 66Column 77Column 88Column 99
The starting position. The numbers in row 3 show how many five-in-a-row lines pass through each open cell.

The seven middle columns are six cells tall, exactly as many as the classic board has. That gives 42 free cells, so red drops 21 discs, yellow drops 21, and yellow places the last one. The edge discs are never moved, and every one of them belongs to some lines.

How the lines change

On a nine by six board with five needed, the number of possible lines is 68. The classic board has 69. So the number of winning lines is about the same, but each of them is longer. The 68 divide into 30 horizontal lines, 18 vertical lines and 20 diagonal lines.

Two things follow from that.

  • Vertical lines almost vanish as a plan. A column is six cells tall, so a vertical five can only start in the first or the second row. To build one you need the other player to stay away from your column for five turns.
  • The middle matters even more. The numbers on the diagram above are exact counts. The cell in the middle of the third row belongs to 11 lines, and the open cell next to an edge to only 5. In column 5 every cell from row 2 to row 5 has 11 lines through it. The filled edge cells have only 3 or 4 each, so the edge columns matter as ends of lines, not as places to build.

What a threat looks like

In the classic game the dangerous shape is three in a row with both ends free. Here the shape is a line of four with both ends free, and one more disc than the classic board asks.

A 9 by 6 Connect 4 board where red has four discs side by side in columns 4 to 7 of the bottom row, with the bottom cells of columns 3 and 8 empty, and yellow has three discs stacked in column 2RRColumn 11Column 22Column 33Column 44Column 55Column 66Column 77Column 88Column 99
Yellow to move. Red has four discs in a row on the bottom, and both cells next to them are free. Yellow can fill only one, and red takes the other.

Red has four bottom discs in columns 4 to 7. A fifth in column 3 or in column 8 wins, so yellow cannot cover both ends with one move. The engine confirms that red wins from here.

Yellow's three discs in column 2 do not help. A vertical four does not win in this variant, and yellow would need two more turns to reach five, while red needs one.

Using the edge discs

The edge discs are the new tool. They count as part of any line, so a disc that is already in place saves you a move.

A 9 by 6 Connect 4 board where red has five discs in a row on the bottom row, from column 1 to column 5, the first of them belonging to the pre-filled edge column; yellow has three discs stacked in column 8Column 11Column 22Column 33Column 44Column 55Column 66Column 77Column 88Column 99
Red wins on its fourth move. The disc in column 1 was already there, so red needed only four discs of its own to make five.

Red owns the bottom of column 1, so on the bottom row it needs only columns 2 to 5 to make five. Yellow spent its moves stacking column 8 and never looked at the left end. That is the typical mistake: players forget that a line starts at the edge disc. Before you make a plan, read the edge discs in the rows you want to use. Row 1 and row 3 give red the left end. Row 2 and row 4 give red the right end. In a row where the nearby edge belongs to your opponent, your opponent needs one disc fewer.

Things to keep in mind

Count the five, not the four. A group of four that cannot be extended to five on either side is dead. Before you celebrate, check that one end of the group is a cell you can reach.

Watch for four, not three. In the classic game an open three already wins. Here three discs side by side still need two more, so you have a turn to react. A group of four is what you must watch.

Think about the diagonals. A five on a diagonal runs through five rows out of six, so it needs a stair of discs under it. That makes diagonals slow to build and easy to overlook. A diagonal can also start from an edge disc, which gives it its first link for free.

The parity question is open. The open columns are six cells high, as on the classic board, so the question of who gets the odd and who the even rows is decided in the same way. The page on odd and even threats explains that for the classic game. I have not worked out how much it matters when a line has five cells, and I do not want to give you a rule that I have not checked. Use it as something to think about, not as a law.

No one knows from this page who wins. The result of perfect play on this board is not something I can state. The classic game was solved in 1988 (see the solved game), but our variant is a different game. Play it for the pleasure of the tactics.

Try it in our game

Open the new game dialog and choose Five in a row. The board is drawn wider, and the full edge columns cannot be chosen. Play against the computer at a low level first and use the Hint when you are not sure which end to take. After the game, the Review chart shows the move where the result changed. If you want the other extreme, a board with a different height, try the 7×7 board.

Frequently asked questions

Can I drop a disc into the edge columns?

No. In this variant the first and the last column start completely full, in alternating colours, so nobody can drop there. Their discs still count: a line of five may begin or end on one of them.

Does four in a row win?

No. You need five discs in a row, in any direction. A line of four is only a threat, and four with both ends open usually cannot be stopped.

Who makes the last move?

Yellow. The seven open columns hold 42 free cells, which is an even number, so red and yellow each drop 21 discs and the board is full after yellow's move.

Keep reading