Giter Club home page Giter Club logo

snakebot-client-python's Introduction

Pythonidae

The Pythonidae, commonly known simply as pythons, from the Greek word python (πυθων), are a family of nonvenomous snakes found in Africa, Asia, and Australia. Among its members are some of the largest snakes in the world. Eight genera and 31 species are currently recognized. -- Wikipedia

Running the client

You need to have pipenv installed as that is how we manage both dependencies and virtualenvs for the project. To install pipenv:

sudo pip install pipenv

Once you have piipenv installed you can use it to download all dependencies and activate the virtualenv:

pipenv shell

This will put you in a shell with the python environment activated, allowing you to run the client:

python client/client.py

You can also run the tests simply by running:

pytest

Modifying the bot

The code for the bot can be found in client/snake.py and the behavior of the bot is controlled by function get_next_move, which receives a game_map ( of the type util.Map) and is expected to respond with a util.Direction object.

If you want to use multiple different snake implementations and switch between them you can change which Snake class is used by modifying the get_snake function.

Connecting to a different host or port

You can modify the host, port and log level of the client via flags to client.py, for possible flags and default values see the --help:

python client/client.py --help

snakebot-client-python's People

Contributors

mbark avatar

Watchers

Emil Breding avatar Jakob Rönström avatar Jonas Öhrn avatar James Cloos avatar  avatar  avatar Petter Alvsten avatar David de Lusenet avatar MIkael Nitell avatar Max Davidson avatar Emil Bergström avatar Daniel Lenksjö avatar Johannes Dolk avatar Johan Nilsson avatar  avatar Siri Lööf avatar

snakebot-client-python's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.