Skip to content

Monte Carlo Tree Search Algorithm used to solve 2048 puzzles.

License

Notifications You must be signed in to change notification settings

BooleanCube/2048-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048 AI

Monte Carlo Tree Search Algorithm used to solve 2048 puzzles.

This Artificial Intelligence algorithm (Monte Carlo Tree Search) attempts to maximize the amount of score gained while also attempting to minimize the number of moves used.

Visualization

It can be visualised as a tree that displays the current situation as the root node and then roots down across many paths and chooses a valid path that maximizes score (reaching a leaf node) in the shortest amount of moves.
image

Installation and Usage

  • Make sure to have Python 3.9 installed on your local system.

  • Install the required python packages for the project to work (pygame and numpy).

    $ pip install requirements.txt
  • Run the game.py script by executing this command in a terminal

    $ python3 game.py

Results

To my surprise, this algorithm doesn't just beat 2048, it actually demolishes it in every way possible. Just in my 4th attempt, I was able to reach upto ~170k scores. This algorithm has beaten most other 2048 artificial intelligence algorithms that I have seen out there and its potential scares me.

image image

About

Monte Carlo Tree Search Algorithm used to solve 2048 puzzles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages