
Play Blokus Duo against the agents
The full game on a 14 by 14 board with all 21 pieces. Choose an opponent, place a piece, and the agent answers in your browser.
The opponents
- Random
randomTurn - Picks uniformly from its legal moves. Its opening move is always a five-square piece.
- PPO checkpoint
MaskablePPO, 100,352 steps - The most-trained policy network saved in the repo, 100,352 steps of masked PPO, run in your browser. In 40 test games against Random it won 16.
- Heuristic, one ply
playSmart - Scores every legal move with the hand-weighted evaluation from the research code (open corners, distance toward your start, squares placed) and plays the best.
- MCTS
monte_carlo_turn - Monte Carlo tree search with UCB selection, scoring leaves by the board evaluation for the first four turns and by score difference after that. Runs 1,000 simulations a move with uniform priors.
- Minimax, level 2
playSmart_v2 - The alpha-beta minimax from the research code, searching its move and every reply of yours with the same evaluation.
- MCTS, tuned
tuned for this page - The same tree search with three changes: each node keeps its 40 most promising moves, the exploration constant is 0.1, and finished games are scored from the side that just moved. Runs 2,000 simulations a move.
How this relates to the research
Every opponent here is ported from the project repository. The board, the move generator, the evaluation function, the minimax and the tree search are TypeScript translations of the Python, with the weights the research code calls standard and four defects found during the port corrected. The PPO checkpoint is the saved network itself, evaluated by a hand-written forward pass.
Rules: your first piece covers your start square. Every later piece touches your own pieces at corners only. The game ends when neither side can move, and the most squares placed wins.