Skip to content

WbaN314/battlesnake

Repository files navigation

Battlesnake Rust Project

Competing at play.battlesnake.com. Each participant provides the brain of his own snake on a self hosted server to survive the longest on the playing field. Games run daily and a leaderboard of the smartest snakes is created. Here is the current ranking of this snake.

Technologies Used

This project uses Rust and Rocket for performance reasons (simulating future gamestates scales exponentially so optimization is key). It also comes with an Dockerfile that is used for easy Google Could Run deployment.

Commands

cargo run
cargo test
cargo bench

To test snakes against stored states

VARIANT=simple_hungry cargo test
VARIANT=simple_tree_search cargo test
VARIANT=depth_first cargo test
VARIANT=breadth_first cargo test

Benchmarks

https://wban314.github.io/battlesnake/dev/bench

Flamegraph

Use to find hot spots with the benchmarks. For example:

CARGO_PROFILE_BENCH_DEBUG=true cargo flamegraph --unit-bench battlesnake_game_of_chicken_lib --open -- game::field::benchmarks::bench_next_state_with_basic_field

About

A battlesnake implementation for https://play.battlesnake.com/

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages