STRATEGYBOTARENA
You're on Territory Step into a cell and wait a turn to take it. Stay connected to your home or you're out. Most cells wins. Switch to Cutline →

Teams write Python bots that fight for territory, four at a time. The server plays games nonstop and ranks every bot. Below is the latest ranked game.

Play against the bots

Latest ranked game Open replay
Cells held, by turn
Game variants in this playtest
  • Territory: step into a cell and wait a turn to take it. Stay connected to your home or you're out.
  • Cutline: draw a trail and close loops to claim land. Step on a rival's trail to cut it. Nobody gets knocked out.

Switch games with the buttons at the top. One account works for every game; each game has its own bots and rankings.

What each page is for
  • Rules: how the game works and how to write a bot.
  • Rankings: every bot, ordered by rating.
  • Replays: every game played, step through any of them.
  • Test match: pick any four bots and watch. Ratings don't change.
  • Play yourself: steer one bot with the keyboard against three.
  • My bots: sign up and upload your bots.
RankingsAll bots
Get your bot on the board
  1. Make an account. Sign up with the invite code you were given.
  2. Grab the starter bot. starter_bot.py, one Python function.
  3. Upload it. It plays a test game, 12 placement games, then the ladder.
How the game works

Rankings

Every bot, ordered by rating. Every few seconds the server picks four bots and plays a ranked game. Finishing above a bot raises your rating, finishing below it lowers it, so second place beats third and fourth and loses to first.

#BotRating trendRatingLast 5Finishes 1st → 4thGamesWin %

Rating after each rated game
Finishing places
Versions
Head to head: how often it finished above each opponent
OpponentGamesFinished above
Recent matches

Replays

Every game the server has played. Ranked games count for the rankings. Placement games are a new bot's first 12, which set its starting rating. Test matches are ones people ran by hand and don't count.

Replay

½×1×2×4×
Turn0
Cells held, by turn · drag to scrub
Key moments
    This turn

      Test match

      Put any four bots on the board and watch. Fights don't change ratings.

      Board

      Play yourself

      Take a seat against three bots. Arrows or WASD move, Space stays, R retreats from a capture.

      Board

      My bots

      Upload bots here. A new bot plays one 60-turn check game, then 12 placement games, then joins the rankings.

      How it works

      Write one Python function. It gets the whole board every turn and returns a move.

      The game

      1. Four bots start on the four corners. Your corner is your home. Every other cell starts neutral.
      2. Each turn all four bots pick NORTH, EAST, SOUTH, WEST, STAY or RETREAT at the same time.
      3. Moving through your own cells is free. Stepping into a neutral or enemy cell starts a capture: stay one more turn and it's yours. An enemy home takes two.
      4. While capturing you can only STAY (keep going) or RETREAT (back to the cell you came from).
      5. Stay connected to your home through your own cells. Land cut off from home turns neutral. If you get cut off, you're out. Lose your home and you're out. Out means all your land turns neutral.
      6. You can hold 35 cells. A 36th releases one of your outer cells.
      7. A cell with a bot on it is closed for that turn. Two bots stepping into one empty cell: the owner wins it, otherwise whoever holds the priority token. The token moves one seat per turn.
      8. Last bot standing wins. After 300 turns, the living bot with the most cells wins; a tie is a draw.

      Your code

      One file with act(state) returning the move as a string. 2 s for the first turn, 200 ms after. Late, missing or illegal = STAY. Standard library only; print() goes to your log.

      def act(state):
          me = state["self"]
          if me["capture_target"]:
              return "STAY"          # finish the capture
          return "EAST" if "EAST" in state["legal_actions"] else "STAY"

      What you get each turn

      turn, turns_remaining, width, height, cell_cap
      owner[y][x]        -1 neutral, else the owner's id
      self               id, position [x, y], home, capture_target,
                         dwell_remaining, owned_count
      bots[4]            the same for everyone, plus alive
      priority_seat      who wins a tie this turn
      legal_actions      what you may do right now
      Download starter_bot.py