Project homepageSource code
|Tech||C / JS / Emscripten|
Back to My workNext: Web-reader
A modification of Gariele Cirulli's 2048 to include an AI. The AI can be used both for playing the game (AI player), and to determine the worst position for new tiles to appear at (AI opponent).
The AI uses an expectiminimax algorithm and a custom scoring function that favors empty tiles, and rows that have an orderly arrangement.
The code powering the AI was written in C and subsequently transpiled to asm.js using Emscripten. This provides a boost to performance on modern browsers that optimizes for asm.js.