Dev Tools · 2h ago
Developer Builds Six Browser Games With Classic AI Algorithms in Vanilla JS
A developer created six browser games including 2048 and tic-tac-toe using only vanilla JavaScript and three classic AI algorithms: minimax, expectimax, and BFS. The 2048 solver uses expectimax with a heuristic that rewards corner-snake gradients, empty cells, and smoothness, achieving the 2048 tile ~70% of the time. The project is fully static, runs client-side, and includes a headless self-play harness for reproducible benchmarks.
Meridian48 take
The honest benchmarking and zero-dependency approach make this a refreshingly practical demonstration of classic AI techniques, though the algorithms themselves are well-trodden territory.
Read the full reporting
Six Games, Three Classic Algorithms: Shipping Real Game AI in Vanilla JS →
DEV Community
game-aivanilla-javascript