ai-code-battle/starters/go
jedarden 4f1b26f6fe feat(bots): add zone bounds awareness to GathererBot, RusherBot, SwarmBot
- 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>
2026-05-26 08:03:30 -04:00
..
.github/workflows feat(starters,web): add 6-language bot starter kits per §6 2026-04-21 13:58:27 -04:00
game style: apply gofmt alignment fixes across codebase 2026-05-24 10:40:33 -04:00
Dockerfile fix(starter-kits): complete incomplete refactoring and fix build errors 2026-05-25 22:40:37 -04:00
go.mod fix(starter-kits): complete incomplete refactoring and fix build errors 2026-05-25 22:40:37 -04:00
main.go fix(starter-kits): complete incomplete refactoring and fix build errors 2026-05-25 22:40:37 -04:00
README.md fix(starter-kits): complete incomplete refactoring and fix build errors 2026-05-25 22:40:37 -04:00
strategy.go fix(starter-kits): complete incomplete refactoring and fix build errors 2026-05-25 22:40:37 -04:00
types.go feat(bots): add zone bounds awareness to GathererBot, RusherBot, SwarmBot 2026-05-26 08:03:30 -04:00

AI Code Battle - Go Starter Bot

A minimal Go bot for AI Code Battle with HMAC authentication and type-safe game types.

Quick Start

  1. Copy this bot to your own repository
  2. Edit strategy.go to implement your bot's logic
  3. Build: go build -o bot .
  4. Run: SHARED_SECRET=test ./bot
  5. Test: curl http://localhost:8080/health should 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