Coder Social home page Coder Social logo

zmija's Issues

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.

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.

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.

Funny Shouts?

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

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.

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.

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.