Four in a Row
Play Four in a Row free against a rule-based AI. Drop discs into the grid and line up four across, up, or diagonally before your opponent does.
How to Play Four in a Row
- The grid has 7 columns and 6 rows. Red moves first; pick Red to start, or Yellow to let the CPU open.
- Click a column to drop a disc. It falls to the lowest empty space, and the faint disc shows where it will land before you commit.
- Line up 4 of your discs across, up and down, or diagonally to win. If the grid fills with no line, the game is a draw.
- Choose PvP to play a friend on the same screen, or CPU to watch the AI play itself. Undo takes back your last disc and the CPU's reply.
Frequently Asked Questions
- What CPU strategies are available?
- Smart follows the rule-based AI priority order and picks randomly among columns with similar scores, so it is strong but varied. Best always takes the highest-scored column for the top-priority rule. Random drops into any open column with no rules or scoring.
- How does the rule-based AI choose a column?
- It works down a priority list: win if it can, block your winning drop, set up two winning drops at once so you cannot stop both, take the spot where you could do that to it, and otherwise play a safe column, one that does not open a winning space for you directly above it. Among the columns a rule allows, it scores every run of four spaces on the board and takes the best.
- Why does the AI sometimes refuse a column that looks good?
- Dropping a disc also makes the space above it playable. If that space would complete four for you, the AI treats the column as off limits, however good it looks otherwise, and only plays it when every column loses.
- What is a double threat?
- Two winning spaces at once, which your opponent cannot both block. Three in a row on the bottom with both ends open is the classic example. So is a winning space stacked directly on top of another: blocking the lower one lets the upper one be played.
- Does the first player have an advantage?
- Yes. With perfect play the first player can force a win by opening in the centre column. Against the AI, the centre is still the strongest start, because more lines of four pass through it than through any other column.
- Can two people play on the same device?
- Yes. Choose PvP and take turns clicking columns. The status line shows whose turn it is.