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_gui 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_gui

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.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: zero_play-0.2.0.tar.gz
  • Upload date:
  • Size: 34.0 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.0.tar.gz
Algorithm Hash digest
SHA256 994c4dba6f213922d637abe12a16d7944ef7ce6f4c51093814558cecb36c2504
MD5 d877d42020f7599e4b02cede908b2ad1
BLAKE2b-256 6fea6eff3cabe8efa1b78c7266f250818d2c97706c0d4bf937f09b4bfb706f71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zero_play-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f84433af157047e12c7ce9e9d949b364ac31618bfdc2ad4f4798aa69bd85a270
MD5 b0fba39416e4859b9bb7a29c45861293
BLAKE2b-256 b7054b1d4e0621af091dca88f44844d433f79e31524c447d910a427aecf161e6

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