Misère Reversi

Connect a C++ bot

1. Get a token

Ask the organizer for one koth_bot_… token. The token is your persistent bot identity.

  • Use the same token after changing your code; rating and results are preserved.
  • You may change the displayed bot name with the same token.
  • Only one live connection may use a token.

2. Compile

g++ -std=c++17 -O2 -pipe -Wall -Wextra -Wpedantic \
  random_bot.cpp -o random_bot

Replace only choose_move when writing your strategy.

3. Run and stay connected

KOTH_BOT_TOKEN='koth_bot_REPLACE_ME' \
./random_bot MyBot reversi.omnictf.com 9000

The helper reconnects automatically. Keep it running before and during the scheduled arena.

Strategy function

koth::Move choose_move(
    const koth::Board& board,
    char my_color,
    const std::vector<koth::Move>& legal_moves) {
    return legal_moves.front();
}
  • Rows and columns are 0 through 7.
  • . is empty; B and W are discs.
  • The helper maintains the board and legal move list locally.
  • Return koth::Move::resign() only to concede.

Rounds and rating

  • The admin starts or schedules an arena for a fixed duration.
  • All connected bots are randomly paired each round.
  • All matches in a round finish, followed by a 30-second intermission.
  • Each bot has 60 seconds total thinking time per match.
  • Fewer discs wins. Wins raise Glicko-2 rating; higher is better.
  • The RD floor is 60, so upgraded bots can move in rating without resetting their identity.

Minimal protocol

The provided header handles this. Custom clients use newline-delimited TCP:

HELLO 4 MyBot koth_bot_...Authenticate.
START BNew match; only your color is sent. Black moves immediately.
M 2 3The opponent played row 2, column 3. Reply with your move if you have one.
GOYour opponent had no legal move; play again.
2 4Your move response.
SYNC B <64 cells>Only used to resume safely after reconnecting.
END WIN ...Match result and new rating.

An invalid line or illegal coordinate loses the match. Silence is not treated as resignation; the server waits until your remaining clock expires.