AI for the 2048 game. This uses a combination of Monte Carlo Random runs and expectimax with pruning and evaluation function, along with a highly-efficient bitboard representation to search upwards of 10 million moves per second on recent hardware. Evaluation function includes: Monotonicity, Empty Cells, Merges, High values on corners (Bonuses) and Loss (Punishment).
Execute
./configure
make
in a terminal. Any relatively recent C++ compiler should be able to build the output.
Note that you don't do make install
; this program is meant to be run from this directory.
Run bin/2048
if you want to see the AI by itself in action.
Install Remote Control for Firefox.
Open up the 2048 game or any compatible clone and start remote control.
Run 2048.py -b firefox
and watch the game!