Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plttn/snake-1
https://github.com/plttn/snake-1
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/plttn/snake-1
- Owner: plttn
- License: mit
- Created: 2023-09-22T17:56:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-18T18:43:25.000Z (about 1 year ago)
- Last Synced: 2024-12-17T02:46:28.380Z (7 days ago)
- Language: Rust
- Size: 95.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Battlesnake Rust Starter Project
An official Battlesnake template written in Rust. Get started at [play.battlesnake.com](https://play.battlesnake.com).
![Battlesnake Logo](https://media.battlesnake.com/social/StarterSnakeGitHubRepos_Rust.png)
This project is a great starting point for anyone wanting to program their first Battlesnake in Rust. It can be run locally or easily deployed to a cloud provider of your choosing. See the [Battlesnake API Docs](https://docs.battlesnake.com/api) for more detail.
[![Run on Replit](https://repl.it/badge/github/BattlesnakeOfficial/starter-snake-rust)](https://replit.com/@Battlesnake/starter-snake-rust)
## Technologies Used
This project uses [Rust](https://www.rust-lang.org/) and [Rocket](https://rocket.rs). It also comes with an optional [Dockerfile](https://docs.docker.com/engine/reference/builder/) to help with deployment.
## Run Your Battlesnake
```sh
cargo run
```You should see the following output once it is running
```sh
🚀 Rocket has launched from http://0.0.0.0:8000
```Open [localhost:8000](http://localhost:8000) in your browser and you should see
```json
{"apiversion":"1","author":"","color":"#888888","head":"default","tail":"default"}
```## Play a Game Locally
Install the [Battlesnake CLI](https://github.com/BattlesnakeOfficial/rules/tree/main/cli)
* You can [download compiled binaries here](https://github.com/BattlesnakeOfficial/rules/releases)
* or [install as a go package](https://github.com/BattlesnakeOfficial/rules/tree/main/cli#installation) (requires Go 1.18 or higher)Command to run a local game
```sh
battlesnake play -W 11 -H 11 --name 'Rust Starter Project' --url http://localhost:8000 -g solo --browser
```## Next Steps
Continue with the [Battlesnake Quickstart Guide](https://docs.battlesnake.com/quickstart) to customize and improve your Battlesnake's behavior.
**Note:** To play games on [play.battlesnake.com](https://play.battlesnake.com) you'll need to deploy your Battlesnake to a live web server OR use a port forwarding tool like [ngrok](https://ngrok.com/) to access your server locally.