Skip to content

This is a Neural Network created with tflearn that can play the 2048 Game.

License

Notifications You must be signed in to change notification settings

fernaper/Game-2048-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game 2048

Game 2048 AI

This is an artificial intelligence project. Pretend using AI techniques to play the 2048's game. It is based on training through simple heuristics of road exploration.

It is based on the training of a neural network (thanks tflearn) by means of simple heuristics of road exploration.

The results obtained are:

Pre-requisites

pip3 install -r requirements.txt

How to train:

  • Execute: python3 Game2048 train
  • First it will generate training games with an exploration algorithm.
  • You could stop this games when you think (but the default amount of games are a really good option).
  • When it generates all the training data, it start training the neural network.

Note: If you want to re-train your neural network without generating more training games just execute: python3 Game2048 train --games=0

How to test:

  • Execute python3 Game2048 play
  • If you want to see more games just change the command to: python3 Game2048 play --games=10

How to play the game manually:

  • Execute python3 Game2048 play --heuristic=manual

Credits:

The base code of the Game (not the artificial intelligence) was made by yangshun. I made some changes on the code, mainly to adapt it to play and train the neuronal network.

The rest of the code has been created entirely by Fernando Pérez (@fernaperg).

LICENSE:

This code is free to use, but look carefully at the LICENSE file.

About

This is a Neural Network created with tflearn that can play the 2048 Game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages