

Side case: if two snakes collide head-on, the larger snake survives. hits the wall), runs out of life, or hits another snake. Eating 1 food restores the snake's life back to 100 and increases the snake's size by one space (growing from the tail).Ī snake will die if it leaves the board (ie. The rules are simple: eat food to grow, don't run out of life, and survive the longest.Įach snake starts with 100 life and loses 1 life per turn. To compete, users write web servers compatible with the Battlesnake API. Or you can join me for a live session when I'm next on Twitch.Battlesnake is an online multiplayer board game, played entirely through coded agents in groups of 2-8. If you'd like to program along with me, check out my beginner friendly stream where I setup my snake. This one above is a challenge to avoid yourself for 100+ turns.
#Battle snake online game plus
Plus there's lots of challenges to compete in if you don't want to get too competitive against others. It's such a great community to be a part of and there's even live streamed league finals on Twitch.
#Battle snake online game code
So choose your weapon - I mean, code - and get started. There are also lots of Community Starter projects for languages including: Those are the official starter snakes made by the Battlesnake team.

There are starter snakes starting code for a bunch of popular languages: You can write your Battlesnake in any language. What if you want to do something other than Python? Battlesnake has you covered. If you like Python, this is a great project for upping your Python skills.
#Battle snake online game how to
This is useful for deciding how to refine your code and what strategies to build next. You can also rewatch games to see how your snake wins or loses. It's awesome going back to the league's ladder board every few days and checking on where your snake sits on the ladder. The leagues are really fun for seeing just how well your snake performs. When you have your snake 'ready' you can enter it into a league. What problems do you want to focus on and how? Do you want to avoid the walls first? Do you want to avoid other snakes second? What strategy do you want to win? Will you check your snake's games and refine the code? What about using machine learning? The Docs has a tonne of information about how to code your snake and what kind of requests the Battlesnake server will ask your server.

Once you have your repo cloned or forked, you can start coding. If you really want to dive into the code, you can go straight to the GitHub repo and clone or fork the starter snake. The Battlesnake Docs explain how to get started with the click of a button. One of the coolest things about Battlesnake is how easy it is to get going. Your snake also can't run off the board or run into other snakes, including yourself. You must ensure your snake doesn't run out of health, so you need to eat the food on the board. Battling happens constantly and you can go back and watch your games whenever you want.Ī Battlesnake game consists of four snakes on a grid. Program your snake, upload the code, and watch your snake battle against others. This means you don't need to sit down and code against someone. Your snake is hosted on a server and requests are sent between the Battlesnake server and your server. Not only have I met some really cool people through live streaming this project, I've had a lot of fun upping my Python skills, and seeing the results of my coding.īattlesnake is a coding competition where you program a snake (remember the old Nokia phone game) and compete against others. I can definitely say this has been a super fun journey. I came across Battlesnake through a friend. So you want to learn Python? In fact if you want to learn any kind of coding, one of the best things to do, is work on a project.
