{"id":19368528,"url":"https://github.com/keyu-tian/cpp-gomoku-with-ai","last_synced_at":"2025-04-23T15:30:48.974Z","repository":{"id":58308600,"uuid":"146578478","full_name":"keyu-tian/Cpp-Gomoku-with-AI","owner":"keyu-tian","description":"C++ Gomoku with a strong AI based on minimax search and alpha-beta pruning with Qt5 GUI.  *Dozens of C++ tricks \u0026 hacks are used to improve efficiency.* Come and try to see if you can beat the powerful AI!","archived":false,"fork":false,"pushed_at":"2020-08-03T08:28:00.000Z","size":13061,"stargazers_count":81,"open_issues_count":2,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T16:50:39.457Z","etag":null,"topics":["alpha-beta-pruning","bitwise-operators","gobang","heuristic-search","minmax-algorithm","multi-threading","qt","qt5-gui"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keyu-tian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-29T09:39:53.000Z","updated_at":"2025-03-08T14:21:14.000Z","dependencies_parsed_at":"2022-09-01T01:50:44.671Z","dependency_job_id":null,"html_url":"https://github.com/keyu-tian/Cpp-Gomoku-with-AI","commit_stats":null,"previous_names":["keyu-tian/cpp-gomoku-with-ai","keyu-tian/gobang-by-qt"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyu-tian%2FCpp-Gomoku-with-AI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyu-tian%2FCpp-Gomoku-with-AI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyu-tian%2FCpp-Gomoku-with-AI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyu-tian%2FCpp-Gomoku-with-AI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyu-tian","download_url":"https://codeload.github.com/keyu-tian/Cpp-Gomoku-with-AI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250460247,"owners_count":21434230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpha-beta-pruning","bitwise-operators","gobang","heuristic-search","minmax-algorithm","multi-threading","qt","qt5-gui"],"created_at":"2024-11-10T08:06:51.593Z","updated_at":"2025-04-23T15:30:47.303Z","avatar_url":"https://github.com/keyu-tian.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gobang_by_Kevin\n\n![截图](./images/screenshot.png)\n\n\u003cbr\u003e\n\n\n# 简介\n\n一个桌面五子棋应用程序。通过 Qt 5.11.1 (C++ 11) 开发，AI 最大搜索深度可达 18 层，棋力可观。\n\n目前还不算严格的 AI。下一步会用 RL+MCTS（部分参考Alpha Zero）来做一个真正意义上的棋类AI（使用LibTorch）。\n\n\u003cbr\u003e\n\n\n# 体验\n\nWindows平台可下载exe文件夹下的.exe文件，直接打开即可。\n\n若版本不兼容或使用其他平台，请将 headers 文件夹下所有文件、sources 文件夹下所有文件以及 gobang_by_Kevin.pro 三部分放在同一目录下，使用Qt打开 gobang_by_Kevin.pro，编译运行后即可体验\n\n操作（皆通过鼠标完成）：\n- 落子：鼠标直接点击（待落子点有提示标记）\n- 与AI对弈时切换先后手并重新开始游戏：new 按钮\n- 重新开始游戏：restart 按钮\n- 悔棋：retract 按钮\n- 切换人机对弈模式与人人对弈模式：change 按钮\n\n- 难度：可在 aithread_algo.cpp 最上方更改搜索深度\n- BASE_DEPTH 基础深度 4-6、KILL_DEPTH 浅层算杀深度 8-14、RES_DEPTH 深层算杀深度 12-18\n- （后续更新会增设配置设置界面）\n\n（出现真香警告时，说明 AI 搜到了某一方的必胜情况~）\n\n\u003cbr\u003e\n\n\n# 涉及算法/技术\n\n- 状态压缩\n\n- 极大极小搜索 + alpha-beta 剪枝 + 特殊剪枝（响应必杀棋）\n\n- A*优化（启发式搜索）\n\n- 迭代加深搜索\n\n- 棋类算杀模块\n\n- 棋型映射表\n\n- Zobrist置换表（testing）\n\n- 多线程\n\n\u003cbr\u003e\n\n\n# 关于重构\n\n- 目的在于进行更彻底的解耦，以及简化部分逻辑，以大幅提高可读性（将诸多奇技淫巧进行二次封装）\n\n- 可能会改变状压方式（并利用__gnu_pbds::gp_hash_table进行更高效的棋型识别）\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyu-tian%2Fcpp-gomoku-with-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyu-tian%2Fcpp-gomoku-with-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyu-tian%2Fcpp-gomoku-with-ai/lists"}