# Connect Four

Classic Connect Four (7×6). Drop pieces that fall by gravity; first to line up four horizontally, vertically or diagonally wins. Play against a heuristic AI, a hard alpha-beta AI, or a friend locally.

> Canonical page: https://elysiatools.com/en/tools/connect-four

- **Category:** Games

- **Keywords:** connect four, connect 4, four in a row, alpha-beta, ai opponent, two players, strategy, game

## Overview

Play the classic Connect Four game directly in your browser on a standard 7×6 grid, choosing between a heuristic AI, a challenging alpha-beta pruning AI, or a local friend.

## Inputs

- **Opponent Mode** (select)
- **First Player** (select)

## When to use

- When you want to test your strategic thinking against a challenging alpha-beta pruning AI opponent.
- When you want to play a quick, local two-player game of Connect Four with a friend on the same screen.
- When you need a quick mental break or want to practice basic spatial reasoning and blocking tactics.

## How it works

- Select your opponent mode, choosing between easy heuristic AI, hard alpha-beta AI, or local two-player mode.
- Choose which player goes first, setting either Red (you) or Yellow (opponent) to make the opening move.
- Click on any of the seven columns to drop your colored piece, which falls to the lowest available space due to gravity.
- Take turns until one player aligns four of their pieces horizontally, vertically, or diagonally to win the game.

## Use cases

- Practicing tactical board game strategies against a deep-searching alpha-beta algorithm.
- Passing the time with a local friend using the shared-screen two-player mode.
- Teaching children basic spatial planning, pattern recognition, and gravity-based mechanics.

## Frequently asked questions

### What is the difference between the Easy and Hard AI modes?

The Easy AI uses simple heuristic evaluations for quick moves, while the Hard AI uses alpha-beta pruning to search multiple moves ahead for optimal play.

### Can I play this game with a friend on the same device?

Yes, select the 'Two players (local)' option to take turns dropping pieces on the same screen.

### What are the dimensions of the game board?

The game uses the standard Connect Four board size of 7 columns by 6 rows.

### How do you win a match?

You win by being the first player to form a continuous line of four of your colored pieces horizontally, vertically, or diagonally.

### Can I choose who makes the first move?

Yes, you can configure the first player option to start as Red (you) or let Yellow (the opponent) go first.

## Related tools

- [Adaptive 12-Point Hidden Watermark](https://elysiatools.com/en/tools/adaptive-12-point-hidden-watermark): Add a subtle text watermark to one image or every supported image in a ZIP, at all, random, or chosen perimeter positions with automatic dark/light local contrast.
- [Bulk Density & Porosity Calculator](https://elysiatools.com/en/tools/bulk-density-calculator): Bulk density and porosity for granular or porous materials. Three-way solver: pick the unknown (ρ_bulk, m, or V) and supply the other two. ρ_bulk = m/V_bulk. Optionally enter the true particle density ρ_true to compute porosity ε = 1 − ρ_bulk/ρ_true, plus relative density against water. SI units (kg, m³, kg/m³).
- [Density Calculator (ρ = m/V)](https://elysiatools.com/en/tools/density-calculator): Compute density, mass, or volume from the other two, with specific gravity and a float/sink check
- [Force Unit Converter (Extended: N / kN / dyn / lbf / kgf / poundal)](https://elysiatools.com/en/tools/force-unit-converter-extended): Convert force between newton (N, SI base), kilonewton (kN), dyne (dyn, CGS = 10⁻⁵ N), pound-force (lbf = 4.4482216152605 N), kilogram-force (kgf = 9.80665 N), and poundal (pdl = 0.138254954376 N). All factors derive from the exact defining constants 1 lb = 0.45359237 kg, 1 ft = 0.3048 m, and standard gravity g₀ = 9.80665 m/s². Converts via newton to the target unit and lists the equivalent value in all six units. Reference: 1 kg of mass on Earth ≈ 9.80665 N (1 kgf); an adult weighs ≈ 700 N.
- [Fractional Excretion of Sodium (FENa)](https://elysiatools.com/en/tools/fractional-excretion-sodium): Calculate the Fractional Excretion of Sodium (FENa) to differentiate prerenal from intrinsic acute kidney injury: FENa (%) = \[U_Na × S_Cr\] / \[S_Na × U_Cr\] × 100. In oliguric AKI, FENa <1% suggests prerenal azotemia (sodium-avid state: volume depletion, heart failure, hepatorenal syndrome), while FENa ≥1% suggests intrinsic injury (typically ATN). FENa >4% is sometimes cited as supportive of post-obstructive pathology. Caveats: unreliable on diuretics (use FEUrea <35%), contrast/sepsis ATN can present with low FENa, chronic CKD and glucosuria elevate FENa independently. Derived from Espinel CH, JAMA 1976. Most useful in oliguric AKI; interpret with full clinical context. Not medical advice.
- [Free Fall Calculator (h = ½gt²)](https://elysiatools.com/en/tools/free-fall-calculator): Compute distance, time, or final velocity for free fall from rest, given any one plus gravity
- [Hardness Converter (HB / HV / HRC / HRB)](https://elysiatools.com/en/tools/hardness-converter): Convert between Brinell (HB), Vickers (HV), and Rockwell (HRC / HRB) hardness via ASTM E140 tabulated data with linear interpolation. Three material classes: carbon/alloy steel (HV 100–960), austenitic stainless (HV 100–600), and cartridge brass (HV 40–200). Any input scale produces all the others; a scale that does not apply in the current hardness band returns 'out of range'. Indicative only — not for acceptance testing per ASTM E140.
- [Image to WEBP Batch Converter](https://elysiatools.com/en/tools/image-to-webp-batch-converter): Convert up to 20 uploaded images, or images inside a ZIP archive, into WebP files packaged as a ZIP

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [macOS Image Processing Objective-C Samples](https://elysiatools.com/en/samples/macos-image-processing-objectivec): macOS Objective-C image processing examples including image reading/saving, image scaling, and format conversion

## Related content

- [Classic Browser Games and Quick Puzzles](https://elysiatools.com/en/hubs/classic-browser-games): Pick an instant browser game for a short break, from 2048 and Minesweeper to trivia and two-player classics.
