無禁手規則
詳細介紹:https://github.com/SXKA/Qt-Gomoku/wiki
可執行檔:https://github.com/SXKA/Qt-Gomoku/releases
Include src/search/engine.h to use search engine.
// 建構一個引擎.
Search::Engine engine;
// 設定搜尋參數.
Search::LIMIT_DEPTH = depth; // Extensions will not be limited.
Search::MC_C = mc_c; // Multi-Cut number of cutoffs.
Search::MC_M = mc_m; // Multi-Cut number of moves.
Search::MC_R = mc_r; // Multi-Cut depth reduction.
Search::VCF_DEPTH = vcf_depth; // VCF depth.
// 黑方落子
engine.move({7, 7}, Black);
// 搜尋白方最佳著法
const auto bestMove = engine.bestMove(White);
// 確認最佳著法是合法的(Engine::bestMove回傳的move一定是合法的)
const auto legal = Search::Engine::isLegal(bestMove);
if (legal) {
// 白方落子.
engine.move(bestMove, white);
}
// 取得棋局狀態
const auto status = engine.gameStatus(bestMove, White);
// 根據狀態決定遊戲是否繼續
switch (status) {
case Draw:
// 處理平局並不再使用此引擎
break;
case Undecided:
// 繼續遊戲
break;
case Win:
// 處理白勝並不再使用此引擎
break;
}
// 悔一步棋,請確定有棋可悔
engine.undo(1);
- Qt 6.5.2
- Enhanced Forward Pruning (搜尋)
- https://github.com/kimlongli/FiveChess (評估)
- https://github.com/Kenny-ting/Chess-Game-2020 (介面)
- 搜尋深度達到 12 ply
- 主要變體搜尋 (PVS)
- 衝四勝(VCF)搜尋
- 同形表
- 空著裁剪
- Multi-Cut
- 延伸