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.
How to play
- Click any column to drop your red disc — it falls to the lowest empty row.
- Connect exactly four of your red discs in a line (horizontal, vertical, or diagonal) to win.
- The AI plays yellow and uses a minimax look-ahead to try to beat you.
- Block the AI's threats while building your own lines.
- 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.