Package: schnapsen-dev
Schnapsen platform - Project Intelligent Systems 2023-2024Getting startedThis is the improved platform for the schnapsen card game. To get to know the concept of the game, please visitthis web page.To use the platform, yourpython 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:pipinstallschnapsenYou 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:pipinstall-e.This will install the schnapsen package and its dependencies in editable mode.To run the tests, run:pipinstall-e'.[test]'# on Linux / MacOSpipinstall-e".[test]"# on Windowspytest./testsIf the above fails, try deactivating your environment and activating it again.
Then retry installing the dependencies.Running the CLIAfter 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:pythonexecutables/cli.pyThis will list the available commands.For example, if you want try a RandBot play against another RandBot, typepython executables/cli.py random-game.Running the GUIThe graphical user interface (GUI) lets you play visually against a bot (e.g., You vs. RandBot).To start the GUI, run:pythonexecutables/server.pyNow, 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. Runpythonexecutables/server.py--helpfor more details.Implementing more botsYou will find bot examples in thesrc/schnapsen/botsfolder.
You can look at the example_bot.py file for various methods provided to your bot.TroubleshootingGetting the right pythonThe 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 installcondato manage them.
Then, you can use conda to create a new environment by runningcondacreate--nameproject_ispython=3.10With this environment created, you can start itconda activate project_isInside this environment you can install the dependencies as instructed above.Run the right pythonIf you install conda and create an environment, you can run python by just running thepythoncommand.
However, often your system also provides a python version.
To know which python is running, usewhichpython# on linuxwherepython# 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.DocumentationThe 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.pipinstallpdoc
pdoc--htmlsrc/schnapsenexecutables/-odoc/if above doesn't work, try pdoc3, instead of pdoc