Skip to main content

Schnapsen platform - Project Intelligent Systems 2023-2024

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 an using an environment.

If you just want to install and use the schnapsen python package (probably for those who take the Intelligent Systems course), but nothing more, you can run:

pip install schnapsen

You can also specify the version, e.g., pip install schnapsen==0.0.5. The list of versions can be found here.

If you want to modify the schnapsen code, add your own bot etc. (probably for those who take the Project Intelligent Systems course), then install this package by running:

pip install -e .

This will install the schnapsen package and its dependencies in editable mode.

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 also play against other bots. Run

python executables/server.py --help

for more details.

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.

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.

Documentation

The code is documented using reStructuredText. You can either read the documentation along the code, or generate a more suer friendly version. A pregenerated version of the documentation can be found int he doc folder. It can be regenerated by runnign the following in the root of the repository.

pip install pdoc
pdoc --html src/schnapsen executables/ -o doc/

if above doesn't work, try pdoc3, instead of pdoc

Metadata

Release files for schnapsen-dev 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schnapsen-dev 0.0.7
File Size Uploaded
schnapsen_dev-0.0.7.tar.gz 46.5 kB Details

Release files / schnapsen_dev-0.0.7.tar.gz

Download URL schnapsen_dev-0.0.7.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb9497a6573b21ad6931a1b1d751e20311e1841b758ff04482f18efd2121cbe4
BLAKE2b-256 checksum
How to use checksums
0302e2a434ed0b4aeaae544d60ac3b16120b0e79471878181077a00594ac72a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page