Skip to main content

Teach a computer to play any game

Project description

Zero Play Build Status Badge Code Coverage

Teach a computer to play any game

The zero play library is based on the ideas in the AlphaGo Zero paper and the example Python code in the alpha-zero-general project. The goal of this project is to make a reusable Python library that other projects can build on to make powerful computer opponents for many different board games. An example project that uses this library is Shibumi Games.

It includes a graphical display that you can use to play against the computer opponent or another human.

screenshot

Installing Zero Play

Even though Zero Play has a graphical display, it is a regular Python package, so you can install it with pip install zero-play. If you haven't installed Python packages before, read Brett Cannon's quick-and-dirty guide.

Then run it with the zero_play command.

The default installation generates some errors about bdist_wheel that don't seem to actually cause any problems. You can either ignore them, or install wheel before installing Zero Play.

pip install wheel
pip install zero-play
zero_play

Known bug on Ubuntu 20.04:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

This is a PySide2 bug that is missing some dependencies. You can work around it by installing those dependencies like this:

sudo apt install libxcb-xinerama0

More Information

If you'd like to help out with the project, or add your own games, see the CONTRIBUTING.md file in the source code. For all the details, look through the design journal for the project.

Related Projects

Here are some similar projects for inspiration or collaboration:

  • I already mentioned the alpha-zero-general project. It was a big inspiration, but I'm trying to build something that's easier to add new games to, or use as a library within another project.
  • Galvanise looks interesting. It's a mix of Python and C++, using Tensorflow. As of 2020, it looks like a single developer, without much documentation. The games are defined with GDL, not Python code.

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

zero_play-0.2.1.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

zero_play-0.2.1-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file zero_play-0.2.1.tar.gz.

File metadata

  • Download URL: zero_play-0.2.1.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

File hashes

Hashes for zero_play-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a317e3f3ffd19550e094efd056daa661fe44e796c4262d897bb30fff435581cd
MD5 6d74b1c54badbf71afe78f99e73c6ce3
BLAKE2b-256 fe7bd48c3a4a18f535fecb1766788cbb3defd1e4ec5f6ca66b31f6175002485c

See more details on using hashes here.

File details

Details for the file zero_play-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: zero_play-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

File hashes

Hashes for zero_play-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a65976e817c3633a608e8ea84c8aaff3351b477d3d090977d8c5d3928562e1db
MD5 534abc8f7500565561bb5f277182a5ed
BLAKE2b-256 a84a02222ef850af7059dd2392ddb4d8ab1d89ff7c2f8937c38a607bbcb8ece2

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