From 504868c7398a330132ccb8af65ea3e2adce56f39 Mon Sep 17 00:00:00 2001 From: LHY20 <3364451258@qq.com> Date: Mon, 21 Jul 2025 00:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96AI=E5=8F=82=E6=95=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=9A=E4=BD=BF=E7=94=A8DEFAULT=5FDEFENSE=5FCOEFFIC?= =?UTF-8?q?IENT=E5=B9=B6=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.h | 4 ++-- game_mode.c | 14 +++++++------- main.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config.h b/config.h index f6b0d17..50f87f0 100644 --- a/config.h +++ b/config.h @@ -37,8 +37,8 @@ #define DEFAULT_TIME_LIMIT 30 // 默认时间限制为30秒(内部存储) //---------- AI参数 ----------// -#define DEFAULT_AI_DEPTH 5 // 默认AI搜索深度(从3提升到5) -#define DEFAULT_DEFENSE_COEFFICIENT 1.5 // 默认防守系数(从1.2提升到1.5) +#define DEFAULT_AI_DEPTH 5 // 默认AI搜索深度 +#define DEFAULT_DEFENSE_COEFFICIENT 1.5 // 默认防守系数 //---------- 网络参数 ----------// #define DEFAULT_NETWORK_PORT 8888 // 默认网络端口 diff --git a/game_mode.c b/game_mode.c index 88df58f..9373821 100644 --- a/game_mode.c +++ b/game_mode.c @@ -349,18 +349,18 @@ void run_ai_game() scores_calculated = 0; // AI对战模式 - int AI_DEPTH = 3; + int AI_DEPTH = DEFAULT_AI_DEPTH; AI_DEPTH = get_integer_input("请选择AI难度(1~5), 数字越大越强,注意数字越大AI思考时间越长!):", 1, 5); /** * @brief AI的防守系数,系数越大越倾向于防守 - * @note 1~1.2 - * 2~1.3 - * 3~1.4 - * 4~1.5 - * 5~1.6 + * @note 1~1.5 + * 2~1.6 + * 3~1.7 + * 4~1.8 + * 5~1.9 */ - defense_coefficient = 1.2 + (AI_DEPTH - 1) * 0.1; + defense_coefficient = DEFAULT_DEFENSE_COEFFICIENT + (AI_DEPTH - 1) * 0.1; empty_board(); int current_player = determine_first_player(PLAYER, AI); diff --git a/main.c b/main.c index c050ba8..b074c3a 100644 --- a/main.c +++ b/main.c @@ -11,7 +11,7 @@ * @brief 将指令复制到powershell * gcc -std=c17 -o gobang.exe *.c -lws2_32 .\gobang.exe - * gcc 为编译器,添加了network.c网络模块,-lws2_32链接Windows网络库 + * gcc 为编译器,添加了-lws2_32链接Windows网络库 */ int main(int argc, char *argv[])