Skip to main content

A RL environment for rock paper scissors(deterministic) based on openai

Project description

Rock Paper Scissors Environment

It is just a simple version of a rock paper scissor game. However, to make the game deterministic it takes in the move of the player and learns to maximize its wins.

Running the jupyter notebook

For obvious reasons, you need to have jupyter, numpy installed in your system before running it. Once done, you can start the notebook and run the example.

What is happening in the output

You would see the following things in the output

  • a matrix -> It represents the bot experience across multiple games against the player.

  • exploiting/exploration -> The bot is fed with some initial experience (see np.uniform at the top) but it begins with exploration when it thinks it does not have any experience and then starts exploiting the already gained experience.

  • stats -> They just tell you of the moves of the player

FAQ's

  • Is the bot playing against pre-defined set of moves of the player ?

No. The player's move has been randomly generated and are then used by the bot to gain experience and win.

  • This isn't how the game is played. Right ?

Good find. In this version of the game I take in the user move and then train the bot to optimize itself. In my case the bot always wins after the training is complete but in the real game the bot will sometime DRAW as well since the moves of the player is random.

  • How do I run your sample ?

Install the dependencies and run the notebook placed in the repo.

  • How to install this package ?

pip3 install rock-paper-scissors

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

rock_paper_scissors-0.0.2.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rock_paper_scissors-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file rock_paper_scissors-0.0.2.tar.gz.

File metadata

  • Download URL: rock_paper_scissors-0.0.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for rock_paper_scissors-0.0.2.tar.gz
Algorithm Hash digest
SHA256 33beb1e42f95badfdbe97cee8ef9324e6295335f4cbd18f1af9a8fccff809b84
MD5 50a3c2fcdb78726e9cb1462a107c7c1a
BLAKE2b-256 54824d9bf5a111c8c70fae5c695a18e7bd022a126cfbca5bb0ba6f7b7e64a633

See more details on using hashes here.

File details

Details for the file rock_paper_scissors-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rock_paper_scissors-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for rock_paper_scissors-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef3d15f49c716e6a32a3be5fabd777bc0c51d60b6b631b1d516982f2834077b4
MD5 69b42995adc80585a2c2561c25e05ca9
BLAKE2b-256 2e7e044d7abe234666dd1150379da90dccfffdf5033351ada8c9c59d4e21af78

See more details on using hashes here.

Supported by

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