Connect Four
Two-player browser game implementing gravity-based token placement and multi-direction win detection in vanilla JavaScript.


Load interactive demo
What this demonstrates
Vanilla JavaScript, a 6×7 board-state model, gravity-based placement, alternating turns, directional win detection, draw handling, full-column protection, and a complete replay lifecycle.
Why it matters
A focused demonstration of state management, reusable game logic, DOM rendering, responsive interaction, and accessible status feedback without a framework.
What it does
A local two-player Connect Four game where players alternate dropping tokens into seven columns until one connects four horizontally, vertically, or diagonally.
JavaScript mechanics
The game uses a 6×7 board array, gravity-based placement, alternating turn state, directional win detection, draw handling, full-column protection, and a game-over lock with Play Again support.
Interaction and accessibility
Seven keyboard-operable column controls share the same move logic as pointer input. Live status messages announce turns and outcomes, player identity is not color-only, and the board scales responsively for desktop and mobile play.
Technology
HTML, CSS, vanilla JavaScript, and Firebase Hosting.