Under the Hood

How the Othello AI Works: Mobility, Square Weights and an Exact Endgame

How the Othello AI works: a negamax search with alpha-beta pruning that weighs square control and mobility instead of the visible disc count, then switches to an exact endgame solve once the board is nearly full.

Published September 12, 2026 · LK Forge · search numbers from a re-runnable, seeded benchmark

+610
Elo from the first extra ply of search
exact
endgame solved to the finish
3
difficulty levels, one engine
0
servers — runs in your browser

The opponent on LK Forge Othello (Reversi) is a negamax search engine — but it is shaped by a fact that makes Othello unlike most board games, and understanding that fact is the whole story.

Why the AI ignores the score it can see

In Othello, the disc count is almost meaningless until the very end. Leading 30–4 at move 20 is usually a losing position, because a single move can flip a long line back. So the engine deliberately ignores the visible score and searches for the position it wants instead: corners (which can never be flipped), the stable discs they anchor, and — above all — mobility, the number of moves each side has. A player starved of moves is often forced to hand over a corner.

Negamax with square weights and mobility

To choose a move it runs negamax with alpha-beta pruning — playing futures out for both sides, keeping the best each can force, and pruning lines that cannot matter. The evaluation combines positional square weights (corners are gold; the squares diagonally next to them are traps that hand the corner away) with a mobility term that rewards having many moves while the opponent has few.

// evaluation: position, not disc count (schematic)
function evaluate(board, me) {
  const pos = weightedSquares(board, me);      // corners +++, X-squares −−−
  const mob = moves(board, me).length
            - moves(board, opp(me)).length;    // mobility edge
  return pos + MOBILITY_WEIGHT * mob;
}

An exact endgame

Near the end of the game everything changes: now the disc count is the result, and there are few enough empty squares to search all the way to the last move. So the engine switches to solving the ending exactly — it stops estimating and reads the true final score, playing the endgame perfectly within its horizon.

How much is one more move of lookahead worth?

We measured it by pinning the shipped engine to a fixed depth and self-playing 120 colour-balanced games between adjacent depths. The first extra ply is worth +610 Elo — a depth-1 engine barely beats random play — and later plies keep adding a healthy, game-specific amount, more than in most games because Othello positions are so easy to misjudge shallow.

0 175 350 525 700 +610 +160 +229 +174 +107 1→2 2→3 3→4 4→5 5→6 Elo gained per extra ply of search depth → lkforge.com

Elo gained by each extra ply of fixed-depth Othello search, 120 colour-balanced games per step (Elo = 400·log₁₀(p/(1−p)), draws count half). Full method and the other three engines are in What One Ply of Search Is Worth.

Three levels, one engine. Beginner gives away corners and edges; Medium plays a solid positional game; Hard runs the full search, values corners and mobility, and reads the exact result near the end. It is extremely strong, though not perfect.

That is the whole engine: judge the position by corners and mobility rather than the deceptive disc count, search it with negamax and alpha-beta, and solve the ending exactly once it fits. Want to watch a search decide? Read minimax and alpha-beta, step by step, or compare four engines in What One Ply of Search Is Worth.

FAQ

How does the Othello AI choose a move?

The Othello AI runs a negamax game-tree search with alpha-beta pruning. Instead of chasing the disc count it can see, it evaluates positions on square values (corners are gold, the squares next to them are traps), mobility (how many moves each side has) and, once the board is close to full, it solves the ending exactly. Everything runs in your browser.

Why does the AI ignore who has more discs?

Because in Othello the disc count is almost meaningless until the very end — leading 30 to 4 at move 20 is usually a losing position, since those discs can be flipped back wholesale. So the engine deliberately ignores the visible score and searches for the position it wants: corners, stable discs and more moves than the opponent. That is why the evaluation favors corner control and mobility over the raw disc count for most of the game.

What is mobility and why does it matter?

Mobility is how many legal moves a side has. A player with few moves is often forced to play into a corner-losing square. The engine rewards positions where it has many options and the opponent has few, which is a far better predictor of who is winning than the current disc count.

How much does one more move of lookahead help?

In a seeded self-play benchmark, the first extra ply of Othello search was worth +610 Elo, because a depth-1 engine barely beats a random mover. Later plies added between +107 and +229 Elo per step out to depth 6. That steep early payoff is why even Medium, which searches only a few plies, already plays a solid positional game.

Take on the engine — corners win games.

Play Othello →