A Rust-based bot template for a game competition system. This project implements a web API server that provides endpoints for bot interaction in a turn-based game.
- Rust (latest stable version)
- Cargo (comes with Rust installation)
- Clone the repository:
git clone <repository-url>
cd template-rust- Install dependencies:
cargo buildStart the server:
cargo runThe server will start and listen on http://0.0.0.0:6000
For development with automatic recompilation, you can use:
cargo watch -x run(requires cargo install cargo-watch)
GET /info- Returns bot informationPOST /play- Accepts game state and returns bot action
cargo check # Fast compilation check
cargo clippy # Linting
cargo fmt # Code formatting
cargo test # Run tests (if any)cargo build --releaseThe release build is highly optimized with LTO, single codegen unit, and debug symbols stripped for maximum performance.
The bot's decision-making logic is implemented in src/services/bot_service.rs. The current implementation randomly selects actions as a starting template. Modify the play function to implement your game strategy.