Skip to main content

This is the package for the Software-Challenge Germany 2023. This Season the game will be 'Hey, danke für den Fisch' a.k.a. 'Penguins' in short.

Project description

Software-Challenge Logo

Python Client for the Software-Challenge Germany 2023

Please note that this is a very early version, which may still contain some bugs. However, the client is able to play a game from start to end.

If you have any questions about this package, you can write a issue or for faster answer write a message on our Discord server.

If you find bugs, or have suggestions for improvements, please post an issue, or contribute to the project yourself.

Thanks a lot!

This repository contains the Python package for the Software-Challenge Germany, a programming competition for students. The students have to develop an artificial intelligence that plays and competes against other opponents in an annually changing game.

This year it is the game Hey, danke für den Fisch!.

Installation

The installation is quite simple with pip.

pip install socha

If you want to install the package manually, then you have to download the release of your choice, unpack the package and then run setup.py with Python.

python setup.py install --user

This should satisfy the dependencies and you can start right away.

Getting Started

If you want to start with the Software-Challenge Python client, you have to import some dependencies first.

  • Your logic must inherit from the IClientHandler in order for it to communicate correctly with the API.
  • Furthermore, you should import the plugin of this year's game so that you can communicate with the GameState and use other functionalities.
  • To make your player start when the script is executed, you have to import the Starter and call it later.
from socha.api.networking.player_client import IClientHandler
from socha import Starter
from socha import *

If you now want to develop and implement your logic, then the structure of the class should look like this.

class Logic(IClientHandler):
  gameState: GameState

  def calculate_move(self) -> Move:
    possibleMoves = self.gameState.get_possible_moves()
    return possibleMoves[0]

  def on_update(self, state: GameState):
    self.gameState = state

  def on_error(self, logMessage: str):
    ...

The above example is the simplest working Logic you can build. As you can see the Logic must inherit from the IClientHandler, so that you can overwrite its methods and the api knows where to find your logic.

If you're done with your version of an working player, than you have to finish your file with this function, where you call the Starter with your desired arguments.

if __name__ == "__main__":
    Starter("localhost", 13050, Logic())

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

socha-0.9.1.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

socha-0.9.1-py3-none-any.whl (20.6 kB view hashes)

Uploaded Python 3

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