This starter snake is currently unofficial
This is a basic BattleSnake AI written in C#.
Visit https://docs.battlesnake.io for API documentation and instructions for running your AI.
Install .NET Core SDK to build this project.
The StarterSnake.Startup
class starts a new server using the StarterSnake.StarterController
class to control snake
movement. This movement is random and will lead to rather soon death. You may either implement your own controller
inheriting StarterSnake.Service.ISnakeServiceController
or improve the existing controller directly.
Generally there should be no need to modify code inside the StarterSnake.Service
and StarterSnake.ApiModel
namespaces.
By default the snake runs a server on port 5050. You may change this through the environment variable PORT
.
dotnet run -c Release
- Create a new Heroku app:
heroku create [APP_NAME]
- Set the correct heroku build pack for .NET Core
heroku buildpacks:set jincod/dotnetcore
- Deploy code to Heroku servers:
git push heroku master
You may have to register your app name as a git remote if git does not recognize 'heroku'
heroku git:remote -a [APP_NAME]
- Open Heroku app in browser:
heroku open
or visit http://APP_NAME.herokuapp.com.
- View server logs with the
heroku logs
command:
heroku logs --tail