Skip to main content

Tetris for OpenAI Gym

Project description

gym-etris

PackageVersion PythonVersion Stable Format License

An OpenAI Gym environment for Tetris. This environemnt derives from the Tetromino clone developed by Al Sweigart found here.

Installation

The preferred installation of gym-tetris is from pip:

pip install gym-tetris

Usage

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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gym_tetris-0.3.8.tar.gz (13.2 kB view details)

Uploaded Source

File details

Details for the file gym_tetris-0.3.8.tar.gz.

File metadata

  • Download URL: gym_tetris-0.3.8.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gym_tetris-0.3.8.tar.gz
Algorithm Hash digest
SHA256 839ff563278d1974f22d38bc28cc2751f33ebfd3b79ea9ac0956dac52233cb51
MD5 85e3b3cf804e67be12ab9dd1bda830a0
BLAKE2b-256 187f97cdaa09df1cd121931c9fed26f7381433b208250bab90c6db32452ac979

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page