Skip to main content

A platform for coding and running card playing bots

Project description

Schnapsen platform - Project Intelligent Systems 2022-2023

Getting started

This is the improved platform for the schnapsen card game. To get to know the concept of the game, please visit this web page.

To use the platform, your python version must be at least 3.10, we suggest installing conda and using an environment (see below). At this point, the code is not tested with python 3.13, yet.

To get started, clone the repository, go into the folder and install the schnapsen package and its dependencies in editable mode by running:

pip install -e .

To run the tests, run:

pip install -e '.[test]'  # on Linux / MacOS
pip install -e ".[test]"  # on Windows

pytest ./tests

If the above fails, try deactivating your environment and activating it again. Then retry installing the dependencies.

Running the CLI

After intalling, you can try the provided command line interface examples. Most examples are bots playing against each other; read the code for details.

To run the CLI, run:

python executables/cli.py

This will list the available commands.

For example, if you want try a RandBot play against another RandBot, type python executables/cli.py random-game.

Running the GUI

The graphical user interface (GUI) lets you play visually against a bot (e.g., You vs. RandBot).

To start the GUI, run:

python executables/server.py

Now, open your webbrowser and type in the server address (i.e., http://127.0.0.1:8080). By default, you are playing against RandBot. You can modify the code in executables/server.py to play against other bots.

Implementing more bots

You will find bot examples in the src/schnapsen/bots folder. You can look at the example_bot.py file for various methods provided to your bot.

The documentation for the platform is hosted at https://intelligent-systems-course.github.io/schnapsen/

Troubleshooting

Getting the right python

The first hurdle in getting the platform to run is getting the right python version on your system. An easy way to get that is using virtual environments. We suggest you install conda to manage them. Then, you can use conda to create a new environment by running

conda create --name project_is python=3.10

With this environment created, you can start it

conda activate project_is

Inside this environment you can install the dependencies as instructed above.

Run the right python

If you install conda and create an environment, you can run python by just running the python command. However, often your system also provides a python version. To know which python is running, use

which python    # on linux
where python    # on windows (untested)

Now, you want to look at the output and make sure that this executable is inside the anaconda folder and not where your system stores its executables.

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

schnapsen-0.0.4.tar.gz (58.1 kB view details)

Uploaded Source

Built Distribution

schnapsen-0.0.4-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file schnapsen-0.0.4.tar.gz.

File metadata

  • Download URL: schnapsen-0.0.4.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for schnapsen-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ebd5e4b725e44f86b8ca4bfd839eb95c78f43a854740bf23ea7964b6628dd53d
MD5 15189219952a80882be6fd01d3636314
BLAKE2b-256 781416619db5e224f8cc3b2d8c30a798743ded9a4ee60c2719b8f9919b224c8a

See more details on using hashes here.

File details

Details for the file schnapsen-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: schnapsen-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for schnapsen-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb0a6dc5c1794607642463a3e6083f5668853f9e3786baad7f8d3ced227da59d
MD5 43ad49f066475aecfe29e6abd3517805
BLAKE2b-256 b83a1b00b93e2bdbceda1cde30dc38336c92a69d070b44cb069c4a7bc3f83620

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