This repository contains a precomputed look-up table for a specific game position in Hexogonal Tic-Tac-Toe(Hexo) called triangle. The proof demonstrates that under specific constraints, the attacker wins within 10 moves for almost all possible defender responses(except one).
At each turn, the defender is restricted to choosing one of the 18 best moves for that position, as determined by a simplified value function.
Under this constraint, all allowed first moves lead to an attacker victory within 10 moves, except for one specific case.
Move for which a winning sequence was not found:
To get started, clone the repository and navigate to the project directory:
git clone https://github.com/K0tovsk1y/hexo-triangle-precomputed
cd hexo-triangle-precomputedYou can explore the proof and play as the defender using the provided interactive viewer:
python viewer.pyViewer Example: Red hexagons are attacker's colored cells, blue hexagons are defender's colored cells, green are avalible moves.
If you wish to modify the script or recompute the moves yourself, compile and run the C++ solver.
g++ -O3 -std=c++17 -o solver basic_solver.cpp -lpthread./solverExample Output:
[13/39] D=(-1,0)+(1,1) -> ALREADY SOLVED
[16/39] D=(-1,0)+(0,-3) -> A WINS
[17/39] D=(-1,2)+(0,-3) -> A WINS
Saved proof proof_db/move_0016.bin (60694 entries)
Saved proof proof_db/move_0015.bin (95618 entries)
[8/39] D=(-1,0)+(0,3) -> A WINS
Saved proof proof_db/move_0007.bin (149992 entries)
[7/39] D=(-1,0)+(0,-2) -> A WINS
[15/39] D=(-1,0)+(-3,4) -> A WINS
....
Note: A full precomputation takes approximately one hour on a standard 8-core CPU.
- AI-Generated Code: Most of the code in this repository was generated by AI; please be aware that bugs may exist.
- Value Function Bias: The current value function is relatively simple and biased towards defensive moves. This causes a flaw where where certain strong moves (such as -2,1 and -2,2 in the following position) are currently not allowed/considered.
Value Function Flaw Example:


