Skip to content

elvisyjlin/2048-rl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048 Reinforcement Learning

Let's play 2048 with reinforcement learning!

Current status: not better than the random agent

Requirements

Install Python 3 and all its dependencies:

pip3 install -t requirements.txt
  1. numpy
  2. tensorflow
  3. keras
  4. h5py

Train and Test

python3 --agent=[TYPE] --model_path=[MODEL] --train --test

Environment

from gym2048 import Gym2048
gym = Gym2048()
env = gym.make()

env.reset()
while True:
    action = env.action_space.sample()
    obervation, reward, done, info = env.step(action)
    env.render()
    if done: break

Play in Console

You can play 2048 with arrow keys:

python3 play.py
from py2048 import Console
console = Console()
console.start()

TODO

  • Build a 2048 game with Python
  • Wrap 2048 into an OpenAI Gym like environment
  • Perform reinforcement learning methods on 2048
  • Improve the existing RL methods
  • Analyse the training progress of each method

About

2048 Reinforcement Learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages