Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

五子棋 AI

使用 Minimax 算法的五子棋(五子连珠)游戏 AI 对手。

功能

  • 使用 Minimax 算法与 AI 对战
  • 选择扮演黑棋或白棋
  • 简单直观的图形界面
  • 随时重启游戏并切换颜色

安装

选项 1:从源代码运行(需要 Python)

  1. 安装所需包:
pip install numpy pygame
  1. 运行游戏:
python gui.py

选项 2:Windows 独立可执行文件

  1. dist 文件夹下载 Gomoku.exe
  2. 双击运行(无需 Python 安装)

如何玩

  1. 启动游戏并选择你的颜色:

    • 点击 "执黑先行" 执黑棋先手
    • 点击 "执白后行" 执白棋后手
  2. 在你的回合期间:

    • 点击任意交点放置棋子
    • 等待 AI 完成它的回合
  3. 游戏控制:

    • 游戏结束后点击任意位置开始新游戏
    • 新游戏中再次选择你的颜色

技术细节

  • 使用 Python 和 Pygame 构建
  • AI 使用带有 Alpha-Beta 剪枝的 Minimax 算法
  • 搜索深度为 4 层以平衡性能

About

使用python实现的蒙特卡洛树搜索的AI五子棋

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages