Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 990 Bytes

README.md

File metadata and controls

65 lines (43 loc) · 990 Bytes

2048

A simple 2048 game written in V with some AI algorithms.

Prepare

Clone this repository:

git clone https://github.com/wenxuanjun/2048
cd 2048

Install V and 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.

just run -h

To just play without AI:

just run -g

Use -A to select the AI algorithm:

just run -A dfs

There are various kinds of AI you can choose:

  • dfs
  • heuristic
  • minmax
  • expectimax
  • monte
  • reinforcement

The default algorithm is dfs.

You can also use -a to enable AI with GUI:

just run -g -a -A expectimax

Build

You can create production build to gain the performance optimized executable.

just build

And replace just run with ./2048 of commands mentioned above.

./2048 -r mt19937 -A monte