Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wenxuanjun/2048
Some AI that that play 2048!
https://github.com/wenxuanjun/2048
2048 traditional-ai
Last synced: 2 months ago
JSON representation
Some AI that that play 2048!
- Host: GitHub
- URL: https://github.com/wenxuanjun/2048
- Owner: wenxuanjun
- License: mit
- Created: 2023-05-23T17:38:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-26T14:40:51.000Z (6 months ago)
- Last Synced: 2024-08-05T01:10:56.310Z (6 months ago)
- Topics: 2048, traditional-ai
- Language: V
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-v - 2048 - A 2048 game with several types of traditional AI integrated. (Applications / Games)
README
# 2048
A simple 2048 game written in V with some AI algorithms.
## Prepare
Clone this repository:
```bash
git clone https://github.com/wenxuanjun/2048
cd 2048
```Install [`V`](https://github.com/vlang/v) and [`just`](https://github.com/casey/just), then use `just -l` to list available recipes.
## Run
Add `-h` to those recipes that have optional flags to see full options of the game.
```bash
just run -h
```To just play without AI:
```bash
just run -g
```Use `-A` to select the AI algorithm:
```bash
just run -A dfs
```There are various kinds of AI you can choose:
- dfs
- heuristic
- minmax
- expectimax
- monte
- reinforcementThe default algorithm is `dfs`.
You can also use `-a` to enable AI with GUI:
```bash
just run -g -a -A expectimax
```## Build
You can create production build to gain the performance optimized executable.
```bash
just build
```And replace `just run` with `./2048` of commands mentioned above.
```bash
./2048 -r mt19937 -A monte
```