Connect
Four

Two AI engines built from scratch. Deep Q-Network meets Alpha-Beta Pruning. Play against them or watch them fight each other.

Two engines, one board

DQN

reinforcement learning

A Convolutional Neural Network trained through 10,000 self-play episodes. It learned patterns from experience — not programmed rules. Sometimes brilliant, sometimes blind. Uses a safety layer to block obvious threats it might miss.

easy · ep8000medium · ep6000hard · ep2000

Alpha-Beta

game tree search

Hand-crafted minimax with alpha-beta pruning. Searches up to 6 moves ahead, evaluates center control, threats, and blocking. Deterministic — given the same board, it always finds the mathematically best move. No luck.

easy · depth 2medium · depth 4hard · depth 6

What you get

AI vs AI Battle

DQN vs Alpha-Beta, head to head. Random openings, full-strength mid-game. Every battle is different.

Live Q-Values

Watch the AI think. Column-by-column scores update in real-time as the board changes.

Game Replays

Every game saved automatically. Watch it back move by move. Works with GitHub and Google login.

OAuth Login

One-click sign in with GitHub or Google. Replays sync across devices. Or play as guest.

Heuristic Scoring

Center control, 2-in-a-row, 3-in-a-row, blocking — all hand-tuned scoring. No black box.

Open Source

Every line on GitHub. The DQN training, the minimax, the frontend. Built from scratch.

How it works

01

Pick your opponent

DQN or Alpha-Beta. Easy, Medium, or Hard.

02

Drop your piece

Click a column. Your disc drops instantly. AI responds.

03

Win or learn

Replay saved automatically. Watch it back or try again.

2AI engines
10Ktraining episodes
6max search depth
3difficulty levels

TensorFlow · NumPy · FastAPI · Next.js · Tailwind · Supabase · Framer Motion

source ↗