This crudely devloped Python Battlesnake won the NJIT ACM Battlesnake hackathon held in Spring 2023!
This project uses Python 3 and Flask. It also comes with an optional Dockerfile to help with deployment.
Install dependencies using pip
pip install -r requirements.txt
Start your Battlesnake
python main.py
You should see the following output once it is running
Running your Battlesnake at http://0.0.0.0:8000
* Serving Flask app 'My Battlesnake'
* Debug mode: off
Open localhost:8000 in your browser and you should see
{
"apiversion": "1",
"author": "",
"color": "#888888",
"head": "default",
"tail": "default"
}
Install the Battlesnake CLI
- You can download compiled binaries here
- or install as a go package (requires Go 1.18 or higher)
Command to run a local game
battlesnake play -W 11 -H 11 --name 'Python Starter Project' --url http://localhost:8000 -g solo --browser
Continue with the Battlesnake Quickstart Guide to customize and improve your Battlesnake's behavior.
Note: To play games on play.battlesnake.com you'll need to deploy your Battlesnake to a live web server OR use a port forwarding tool like ngrok to access your server locally.