Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/BattlesnakeOfficial/rules
Battlesnake Game Rules and Logic
https://github.com/BattlesnakeOfficial/rules
battlesnake cli game-logic game-rules
Last synced: 3 months ago
JSON representation
Battlesnake Game Rules and Logic
- Host: GitHub
- URL: https://github.com/BattlesnakeOfficial/rules
- Owner: BattlesnakeOfficial
- License: agpl-3.0
- Created: 2020-01-01T04:42:27.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-05T19:43:42.000Z (7 months ago)
- Last Synced: 2024-08-02T18:37:53.503Z (6 months ago)
- Topics: battlesnake, cli, game-logic, game-rules
- Language: Go
- Homepage: https://play.battlesnake.com
- Size: 498 KB
- Stars: 99
- Watchers: 6
- Forks: 51
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# BattlesnakeOfficial/rules
[![codecov](https://codecov.io/gh/BattlesnakeOfficial/rules/branch/master/graph/badge.svg)](https://codecov.io/gh/BattlesnakeOfficial/rules)
[Battlesnake](https://play.battlesnake.com) rules and game logic, implemented as a Go module. This code is used in production at [play.battlesnake.com](https://play.battlesnake.com). Issues and contributions welcome!
## CLI for Running Battlesnake Games Locally
This repo provides a simple CLI tool to run games locally against your dev environment.
### Installation
Download precompiled binaries here:
[https://github.com/BattlesnakeOfficial/rules/releases](https://github.com/BattlesnakeOfficial/rules/releases)Install as a Go package. Requires Go 1.18 or higher. [[Download](https://golang.org/dl/)]
```
go install github.com/BattlesnakeOfficial/rules/cli/battlesnake@latest
```Compile from source. Also requires Go 1.18 or higher.
```
git clone [email protected]:BattlesnakeOfficial/rules.git
cd rules
go build -o battlesnake ./cli/battlesnake/main.go
```### Usage
Example command to run a game locally:
```
battlesnake play -W 11 -H 11 --name --url -g solo -v
```For more details, see the [CLI README](cli/README.md).
## FAQ
### Can I run games locally?
Yes! [See the included CLI](cli/README.md).
### How is this different from the old Battlesnake engine?
The [old game engine](https://github.com/battlesnakeio/engine) was re-written in early 2020 to handle a higher volume of concurrent games. As part of that rebuild we moved the game logic into a separate Go module that gets compiled into the production engine.
This provides two benefits: it makes it much simpler/easier to build new game modes, and it allows the community to get more involved in game development (without the maintenance overhead of the entire game engine).
### Feedback
* **Do you have an issue or suggestions for this repository?** Head over to our [Feedback Repository](https://play.battlesnake.com/feedback) today and let us know!