https://github.com/chrisvander/2048-expectimax
A 2048 AI, written in C++ using an ASCII interface and the Expectimax algorithm.
https://github.com/chrisvander/2048-expectimax
2048 2048-game ai ansi ascii bitboards expectation-maximization expectimax multithreading solvers
Last synced: 6 months ago
JSON representation
A 2048 AI, written in C++ using an ASCII interface and the Expectimax algorithm.
- Host: GitHub
- URL: https://github.com/chrisvander/2048-expectimax
- Owner: chrisvander
- License: mit
- Created: 2018-04-26T05:17:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-25T05:08:34.000Z (over 3 years ago)
- Last Synced: 2025-03-28T14:11:12.558Z (7 months ago)
- Topics: 2048, 2048-game, ai, ansi, ascii, bitboards, expectation-maximization, expectimax, multithreading, solvers
- Language: C++
- Size: 13.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 2048 AI
[](https://travis-ci.org/chrisvander/2048-Expectimax)An in-console game of 2048. Play as single player and see what the heuristics do, or run with an AI at multiple search tree depths and see the highest score it can get.
## To download and install
For a machine that has g++ installed, getting this running is as easy as
```
git clone https://github.com/chrisvander/2048-Expectimax
cd 2048-Expectimax
make
./game
```
You don't have to use `make`, any OpenMP-compatible C++ compiler should work.## Modes
### AI
Runs with an AI. Specify a number for the search tree depth. For example, 4 is a moderate speed, decent accuracy search to start at.
### Random Maxing
Plays the game several hundred times for each possible moves and picks the move that results in the highest average score.
### Random
Just plays it randomly once. No idea why I added this.
### Debug
View the heuristic score of any possible board state.
### Singleplayer
Just play 2048! Provides heuristic scores and before/after compacting of columns and rows for debug purposes.