AbraCalc

Four-in-a-Row — Drop Pieces to Connect Four

Drop pieces into a 7-column grid. Connect four of your colour in a row, column or diagonal to win.

Your turn (red). Click a column to drop a piece.
Embed this tool on your site

How to play

  1. Click any column to drop your red disc — it falls to the lowest empty row.
  2. Connect exactly four of your red discs in a line (horizontal, vertical, or diagonal) to win.
  3. The AI plays yellow and uses a minimax look-ahead to try to beat you.
  4. Block the AI's threats while building your own lines.
  5. Click 'New Game' to reset the board.

Drop red discs into a 6×7 grid. Connect four of your discs in a row (horizontal, vertical, or diagonal) before the AI does. Uses a minimax AI with depth-3 look-ahead.

Frequently asked questions

How does the AI work?
The AI uses a minimax algorithm with alpha-beta pruning at depth 3, scoring positions based on windows of 4 cells.
Who goes first?
You (red) always go first. Click any column to drop a disc.