Tetris for OpenAI Gym
Project description
gym-etris
An OpenAI Gym environment for Tetris. This environemnt derives from the Tetromino clone developed by Al Sweigart.
Installation
The preferred installation of gym-tetris
is from pip
:
pip install gym-tetris
Usage
Python
You must import gym_tetris
before trying to make an environment. This is
because gym environments are registered at runtime.
import gym_tetris
env = gym_tetris.make('Tetris-v0')
done = True
for step in range(5000):
if done:
state = env.reset()
state, reward, done, info = env.step(env.action_space.sample())
env.close()
NOTE: gym_tetris.make
is just an alias to gym.make
for
convenience.
Command Line
gym_tetris
feature a command line interface for playing environments using
either the keyboard, or uniform random movement.
gym_tetris -e <the environment ID to play> -m <`human` or `random`>
NOTE: by default, -e
is set to Tetris-v0
and -m
is set to
human
.
Citation
Please cite gym-tetris
if you use it in your research.
@misc{gym-tetris,
author = {Albert Sweigart and Christian Kauten},
title = {{Tetris} for {OpenAI Gym}},
year = {2018},
publisher = {GitHub},
howpublished = {\url{https://github.com/Kautenja/gym-tetris}},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file gym_tetris-1.0.10-py3-none-any.whl
.
File metadata
- Download URL: gym_tetris-1.0.10-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36a340f0b656eb76b7edd7ad641664affb80b976c1006de58c6e3f28f7f1fa08 |
|
MD5 | c0891ecf8b22924bac3dcaa36e0f3a62 |
|
BLAKE2b-256 | 7620211b3d9f757dfecdb2c3b1cb860e4688399d6f9718b80e5f07a6828ba688 |