Skip to content
Martin Poiroux
Language : Français
Projects · CodeCode · Games · 2026

Barricade

The barricade game as played on barricade.gg: two players, a nine by nine grid, no randomness. A search engine in Python, then the same one compiled.

The Barricade played on barricade.gg is a race game with no luck, close to Quoridor. Two players, a nine-by-nine grid, ten barricades each, the right to jump over the opponent, and the goal of reaching the opposite side of the board. No dice, so a position has an exact value and a program can search for it.

Each pawn’s shortest path, recomputed after every wall. Hover the grid to see where a wall would land, click to place it; a wall that would trap a pawn is refused.

The rules live in a dependency-free Python module: moves, barricade placement, jumping, win condition, clock. The rest of the repository plugs into it behind a single interface, a position in, a move out. Around it, a small local server serves an HTML and Canvas interface, with two-player, player-versus-program and program-versus-program modes.

An AI vs AI game: each pawn looks for the shortest path, each wall makes the opponent’s longer. The bar at the bottom gives each side’s chances.

The first version of the search is a classic negamax alpha-beta: iterative deepening, transposition table, move ordering, and one idea specific to the game, only seriously considering barricades placed on the opponent’s path. The evaluation compares the two distances to the finish and accounts for remaining barricades, reducing confidence when the opponent still has stock.

The debug panel: search depth, nodes explored and the score of the last move.

Then the same search went down a level: bitmask board, kernel compiled with numba, killer moves, late move reductions, aspiration window. It goes from about sixty thousand nodes per second to two and a half million, which is worth four or five extra plies in the same thinking time. A Monte Carlo search exists alongside, correct but weaker at equal time, which is the known limit of light simulations on a race game where distance already says a lot.

One question remains unsettled: what to measure against. Barricade has no reference engine the way chess has Stockfish, so the only available yardstick is the program itself, version against version. That is enough to establish a gain, not to announce a level.

Game over: the blue pawn has reached the far side.

The other barricade game on this site is Malefiz, four players and dice. The two repositories share no code.

Private project, no public link