

Thus, you can freely move in any of the four directions, because there is nothing that would kill you. That’s because all other body parts are stacked beneath your head - all are at the same point. If a new game starts, you only see the head of your snake, but it already has a length of 3. So an initial strategy should check all points that can be reached by following the respective direction, if they result in death. When your snake is asked to make a move, it has to pick one of the four directions. starving (running out of health one move normally costs you 1 health point, but 15 with your head in the hazard sauce).head-on collision with a snake at least as long as your snake.running into another snake, head-on collisions are a special case.


The most important one is the move endpoint that handles the requests for your next move.Ī request contains the description of the entire board prior to your move, for example: You only need a running web server that implements four endpoint, a.k.a.

The animation stops after 3 repetitions in order to minimize distraction.īattlesnake is an online game where programs - and thus their programmers - play against each other. The following game features four snakes fighting against each other. The game idea is even older, but Nokia made it known to a broad audience. How does the game look like?īattlesnake can be thought of as the evolution of the classic game Snake from Nokia, that appeared for the first time in 1998 on the Nokia 6110. I have some ideas that I will mention at the end of this article, so stay tuned. In the future, I plan to write more articles about how I got my snake to improve - if I’m able to make it better. If you start programming your own snake, maybe they can make your snake better as well. Up to now, I’ve invested about a working day of my spare time into this project.ĭuring that time, I learned some lessons to make my snake better. I started programming my first own snake Fairy Rust a couple of weeks ago. The information can be useful if you use other programming languages, too. This blog post uses Rust as a programming language, but only as an example to explain the implementation of strategies. I first heard about Battlesnake in the podcast Go Time with Jon Calhoun, Brad van Vugt, and Mat Ryer. Therefore, I’m looking for new toy projects to train my Rust programming skills. A short time ago I started learning to program in Rust.
