Collection of AI algorithms to solve/optimize 2048 games.
AI solvers for the puzzle game 2048.
Python to C++ ported code from codebase made by
Daniel Wu,
Nathaniel Wine, and
Yang Yang.
Port done by
Nathaniel Wine.
Some modifications/improvements are present with the goal of further improved performance/quality.
The original project (as well as this one) was created with the goal of implementing
algorithms to achieve as high of a score as possible in the game 2048. Game.cpp
contains the code for the game logic, Heuristics.cpp contains several heuristic
metrics/functions to evaluate game state quality, and algorithm implementations are
split between MonteCarlo.cpp, Minimax.cpp, and Expectimax.cpp.
If unfamiliar with the game rules, check out 2048.
First, navigate to the proper directory and run
make all
…and then follow usage. Note that this codebase was written and tested in a Linux environment.
Other operating systems may need to follow additional steps / procedures in order to run the program.
AISolver < flag_1 > < flag_1_val > < flag_2 > < flag_2_val > ...
Flag list:
Ex:
AISolver -a minimax -n 1 -d 1 -p 3