Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Open Source Games
  3. c4

c4

MITTypeScriptv5.1.1

A browser-based Connect Four game with AI opponent using Minimax algorithm and alpha-beta pruning.

Visit WebsiteGitHubGitHub
277 stars101 forks0 contributors

What is c4?

c4 is a browser-based implementation of the classic Connect Four game where players compete against an AI opponent. It's built with TypeScript and uses HTML Canvas for rendering, featuring an AI that employs the Minimax algorithm with alpha-beta pruning to make strategic moves.

Target Audience

Web developers and game enthusiasts interested in classic board game implementations, AI algorithms in gaming, or TypeScript/Canvas projects.

Value Proposition

Developers choose c4 for its clean implementation of game AI using Minimax with alpha-beta pruning, educational codebase for learning game development concepts, and polished browser-based gameplay experience.

Overview

🔴🔵 Connect Four game in JS + Canvas

Use Cases

Best For

  • Learning Minimax algorithm implementations
  • Studying alpha-beta pruning in game AI
  • Exploring HTML Canvas game development
  • Building browser-based board games
  • TypeScript game programming examples
  • Educational projects about game algorithms

Not Ideal For

  • Projects requiring multiplayer or online play capabilities
  • Teams needing drag-and-drop UI customization without Canvas programming
  • Applications targeting older browsers without modern JavaScript support
  • Commercial game development requiring advanced graphics, sound, or monetization features

Pros & Cons

Pros

Educational AI Implementation

Implements Minimax with alpha-beta pruning for strategic gameplay, making it a clear example for learning game AI algorithms, as emphasized in the README's focus on clean code.

TypeScript Codebase

Built with TypeScript, ensuring type safety and maintainability, which is highlighted in the GitHub description for a robust development experience.

Smooth Canvas Rendering

Uses HTML Canvas for graphics, providing smooth visual performance directly in the browser, as noted in the key features for responsive controls.

Browser-Based Accessibility

Runs entirely in modern browsers without plugins, offering an accessible gaming experience with no additional installation required.

Cons

Non-Optimal AI Decisions

The README admits the evaluation function is hard-coded, so the AI may not make the most optimal moves, reducing its effectiveness as a challenging opponent.

Limited UI Flexibility

Canvas rendering requires low-level code changes for visual customization, unlike DOM-based approaches where CSS can easily modify styles.

Basic Feature Set

Lacks common game features like undo/redo, multiple difficulty levels, or sound effects, making it less polished for extended play.

Frequently Asked Questions

Quick Stats

Stars277
Forks101
Contributors0
Open Issues0
Last commit27 days ago
CreatedSince 2013

Tags

#game-ai#web-game#html-canvas#minimax-algorithm#typescript#html5-canvas#board-game#browser-game#game-2d#html5-game

Built With

T
TypeScript
H
HTML Canvas

Links & Resources

Website

Included in

Open Source Games2.7k
Auto-fetched 1 day ago

Related Projects

LichessLichess

♞ lichess.org: the forever free, adless and open source chess server ♞

Stars18,428
Forks2,719
Last commit1 day ago
3D Hartwing Chess Set3D Hartwing Chess Set

3D chess game done in HTML/CSS/JS

Stars537
Forks237
Last commit3 years ago
Desperate GodsDesperate Gods

This is a game that was created for FTJ 2012 ("F This Jam")

Stars326
Forks129
Last commit7 years ago
Green MahjongGreen Mahjong

Solitaire mahjong game with several themes and layouts. For android/iphone/ubuntu/firefoxos

Stars102
Forks61
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub