Open
Conversation
增加AI最大计算时间设置 增加是否优先保将设置 性能优化
Python中国象棋🩠🩡🩢🩣🩤🩥🩦🩧🩨🩩🩪🩫🩬🩭 1.9.8更新 增加停一手功能及是否开启停一手功能设置 增加AI最大计算时间设置 增加是否优先保将设置 性能优化
Xiaokang2022
requested changes
Jul 5, 2025
Owner
Xiaokang2022
left a comment
There was a problem hiding this comment.
存在非常多的问题,而且不建议修改该项目中的 tkintertools.py 文件,因为该文件已不再维护,该文件取自项目 tkintertools 的 2.5.9.5 版本,当前该项目已重命名且不再通过该方式引入。
此项目本应该归档,但有时需要进一步修改 AI 的逻辑,主要是修改其中的 cpp 文件,所以仍开放 PR
如果你愿意修改你的 PR,我也愿意进一步帮你看看
| mode = None # 当前游戏模式 | ||
| timer = 0 # 计时判断时间戳 | ||
| count = 0 # 未吃棋回合计数(和棋判定需要) | ||
| count = 0 # 未吃棋回��计数(和棋判定需要) |
| def help(self, _ind: list[int] = [0]) -> None: | ||
| """ 帮助页面 """ | ||
| def help(self, _ind: list[int] = None) -> None: | ||
| """ 帮助页��� """ |
Owner
There was a problem hiding this comment.
docstring 中存在乱码,其它地方也存在该问题,不再重复指出
| self.send(msg='OK') | ||
| code = self.recv()['msg'] | ||
| # code 末尾加上当前优先保护将设置 | ||
| import GUI |
| __version__ = '1.9.8' | ||
| # 作者 | ||
| __author__ = '小康2022' | ||
| __author__ = '非主刘Non_main_liu' |
| try: | ||
| import GUI | ||
| return getattr(GUI.Global, 'protect_king_when_check', config.get('protect_king_when_check', True)) | ||
| except Exception: |
Owner
There was a problem hiding this comment.
一个建议:尽量减少使用 Exception 类,异常的捕获范围太大
Comment on lines
+1
to
+20
| { | ||
| "Launch": 47, | ||
| "Play": 29, | ||
| "First": 14, | ||
| "Time": 357, | ||
| "LAN": 0, | ||
| "LOCAL": 5, | ||
| "COMPUTER": 23, | ||
| "END": 1, | ||
| "TEST": 0, | ||
| "Win": 0, | ||
| "Lose": 3, | ||
| "Peace": 0, | ||
| "Eat": 26, | ||
| "Move": 0, | ||
| "Revoke": 0, | ||
| "Recovery": 0, | ||
| "Warn": 10, | ||
| "AI": 0, | ||
| "Skip": 1 |
| CURSOR = '│' # 文本光标 | ||
| FONT = '楷体', 15 # 默认字体 | ||
| LIMIT = -1 # 默认文本长度 | ||
| LIMIT = -1 # 默认文本�����度 |
| `title`: 窗口标题 | ||
| `width`: 窗口宽度(单位:像素) | ||
| `height`: 窗口高度 | ||
| `height`: 窓口高度 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.9.8更新
增加停一手功能及是否开启停一手功能设置
增加AI最大计算时间设置
增加是否优先保将设置
性能优化