Skip to content

TomWartm/game_2048

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game 2048

Python implementation of the game 2048.

Visual Mode

Visual GUI

Game Strategies

There are 5 game strategies implemented:

  • Random: Makes a random next move.
  • Left Down: Try Left or Down, else Right or Up.
  • Simple Max: Checks all possibilities of the next move and takes the move that maximizes the average.
  • Two Max: Checks all possibilites of the next two moves and takes the move that maximizes the average value.
  • Deep Q-Learning: Uses a Neural Network to approximate the most rewarding moves. Needs to be trained.

Game Screenshot

Deep Q-Learning

Replay GIF

Replay of a Game played by the Deep Q-Lerning agent with 23k training steps, with batch size 512.

How to Run

This script requires the following Python packages:

  • numpy
  • matplotlib
  • tqdm

For QLearning additionally:

  • torch

Then run python main.py and follow the instructions and mode selection in the command prompt

About

The Game 2048, with AI Agent game strategies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors