Coder Social home page Coder Social logo

zmija's Introduction

USASK 2nd Years Battlesnake

This a battlesnake server implementing the Battlesnake API to participate in the Battlesnake Saskatchewan event built by a group of 2nd year Usask CS Majors

Starter code taken from the Battlesnake Python Starter Project

Running and Contributing Instructions

Fork this repo and add it to your repl account, then run python server.py to launch the server. You will get a URL to give to your Battlesnake account to test your snake. PR's to the main branch on this repo will update the Competition Snake on the Team's account on Battlesnake.

Alternatives to repl

Although repl is the easiest to just get the snake running for testing, there are a few other options

  • You could run this server on your machine, but you would need to set up a port forwarding tool
  • You can set up a function app on Azure, and through the U of S we get $100 compute credits for free, so this is a decent alternative

Contributing Instructions

Running

Fork this repo and add it to your repl account, then run python app/server.py to launch the server. You will get a URL to give to your Battlesnake account to test your changes. PR's to this repo will update the Competition Snake, which will be connected to Our Team on Battlesnake.

Tests

This project uses pytest. simply run pytest in the root of the directory. You will need pytest installed either globally or in a virtual environment.

Dependancies

You will need the CherryPy module installed on your repl for this to work. If you are having trouble running the server on repl, make sure you install cherrypy using pip.

Team Planning Links

Team Trello

zmija's People

Contributors

benphan777 avatar hamza975a avatar harris-ferguson avatar ttury avatar

Watchers

 avatar  avatar  avatar

Forkers

hamza975a

zmija's Issues

Process a Path

Assuming we have some arbitrary path from a pathfinder function / method / object, we need a way to process and keep track of:

  • How far along the path we are, so we can decide what the next move is
  • when, if, and how we recalculate the path
    • Could we check just along the path for any potential collisions using the GameState object, and adjust just that section of the path?

Should we create a Class to keep track of these calculations, or let the Decider class worry about it?

We could also calculate an path each step of the game, take the first step on that path, then recalculate on the next step.

Infinite Loop if there are no safe moves

The server goes into an infinite loop if there are no safe moves. It's only happened twice so far, and the server can still recieve requests will this is happening, but it caused a seg fault the most recent time it happened to me.

Method to convert a board location to a direction

We need a way to convert a board location adjacent to our current location (i.e. the next step of a path, or an adjacent piece of food), to a direction. I think this method could be in either the Decider or GameState and make reasonable sense.

Funny Shouts?

We can reply with a shout every time we give a move. We could have some funny shouts!

Decide what piece of food to try and get.

in Decider, we should have a method that decides what piece of food on the game board we should go towards. Going to the closest piece each time makes sense, however there might be some strategy in picking a piece that is closest to our snake but furthest from other snakes. Regardless of what, we need a method that picks a spot.

Pathfinding Strategy Interface

I think an interface class would be good here. We can have a pathfinder class for looking for food and another class for "holding pattern", and swap them out in the Decider depending on the state of the board.

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.