Skip to content

JohnMcSpedon/2048-gym-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048 Gym Environment

Introduction

This repository contains a custom Gym environment for the popular game 2048. It is designed to be compatible with the Gymnasium API (formerly OpenAI Gym), allowing for the integration of reinforcement learning algorithms. The environment is implemented in Python and is suitable for anyone interested in experimenting with RL agents for 2048.

Installation

Using Poetry

This project uses Poetry for dependency management.

To install the environment, follow these steps:

Install Poetry: Follow the instructions on the official Poetry website.

Clone the Repository

Install

TODO TODO TODO

Basic Usage

To use the 2048 Gym environment in your Python project, you can follow this simple example:

TODO TODO TODO: revisit this example

import gymnasium as gym
import gym_2048

# Create the environment
env = gym.make('Gym2048-v0')

# Reset the environment to start a new game
state = env.reset()

# Game loop
done = False
while not done:
    # Take a random action
    action = env.action_space.sample()
    state, reward, done, info = env.step(action)

    # Render the current state (optional)
    env.render()

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages