This bot plays on a 10×10 board aiming to get five in a row (horizontal, vertical, or diagonal). It uses:
-
Immediate tactics
- Win scan: checks every empty cell—if placing there yields five in a row, play it.
- Block scan: checks opponent’s potential wins and blocks them.
-
Strategic search
- Iterative deepening minimax with alpha‑beta pruning (depth ≤ 15).
- Move generation limited to empty cells within a 2‑cell “neighborhood” of existing pieces (or center on an empty board) to reduce branching.
- Time control: aborts deeper search via a
TimeOutExceptionafter 4.8 s, falling back to the best completed depth.
-
Heuristic evaluation
- Scores board patterns (open/closed runs of length 1–4) for both players.
- Treats a confirmed win (+∞) or loss (–∞) as terminal.
-
bot
The compiled single‐file executable for Ubuntu 24.04. -
bot.cpp
Full C++17 source code implementing the strategy above. -
json.hpp
nlohmann/json single‑header library for parsingstate.json. -
README.md
This file.
Ensure you have a C++17 compiler installed. In bot directory, run:
g++ -std=c++17 -O2 -o bot bot.cpp