Connect Four

Drop coloured discs to connect four in a row before the AI does. Classic two-player strategy game, now vs a smart AI.

Runs 100% in your browser — nothing is uploaded.
W 0D 0L 0
Your turn
1
2
3
4
5
6
7

Click a column or press keys 1–7 to drop a disc. Yellow = you, Red = AI.

How to use

  1. 1
    Your turn

    You play as the yellow discs. Click a column to drop a disc.

  2. 2
    AI turn

    The AI (red) responds immediately with its best move.

  3. 3
    Win condition

    Get four of your discs in a row — horizontally, vertically, or diagonally.

  4. 4
    New game

    Click New Game to reset the board and go again.

Frequently asked

How do I drop a disc?

Click a column or press number keys 1–7 to drop your disc into that column.

How smart is the AI?

The AI uses minimax with alpha-beta pruning (depth 5), so it plays a strong game but is still beatable.

What counts as a win?

Connect four of your discs in a row — horizontally, vertically, or diagonally.

Can I play two-player?

Currently single-player vs AI only. Two-player support on the same device may come later.

Related tools