- Add ZoneBounds type to bot state structs (Go, Rust, TypeScript) - GathererBot now moves toward zone center when outside or near edge - Bots can see zone bounds in fog-filtered state (per plan §3.7.1) - Fixes gofmt formatting in types.go and bot_strategies.go This improves bot survival and combat behavior by making them zone-aware, preventing unnecessary zone deaths when the safe area shrinks. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .github/workflows | ||
| game | ||
| Dockerfile | ||
| go.mod | ||
| main.go | ||
| README.md | ||
| strategy.go | ||
| types.go | ||
AI Code Battle - Go Starter Bot
A minimal Go bot for AI Code Battle with HMAC authentication and type-safe game types.
Quick Start
- Copy this bot to your own repository
- Edit
strategy.goto implement your bot's logic - Build:
go build -o bot . - Run:
SHARED_SECRET=test ./bot - Test:
curl http://localhost:8080/healthshould return "OK"
Strategy Interface
Implement the ComputeMoves function in strategy.go:
func ComputeMoves(state *engine.VisibleState) []engine.Move {
moves := make([]engine.Move, 0)
for _, bot := range state.Bots {
if bot.Owner == state.You.ID {
// TODO: Add your strategy here
moves = append(moves, engine.Move{
Position: bot.Position,
Direction: engine.DirNone, // Hold position
})
}
}
return moves
}
Deployment
Build and push to container registry, then register at https://ai-code-battle.pages.dev/#/register