Skip to content

Commit a9d79e5

Browse files
committed
写一坨
1 parent 940dce8 commit a9d79e5

File tree

10 files changed

+56
-298
lines changed

10 files changed

+56
-298
lines changed

Object/bot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void Bot::makeRandomMove()
260260
}
261261
x = rand() % CHESSBOARD_SIZE;
262262
y = rand() % CHESSBOARD_SIZE;
263-
qDebug() << x << ' ' << y;
263+
// qDebug() << x << ' ' << y;
264264
}
265265
while(!judge->CheckVaild(x, y));
266266
judge->PlaceAPiece(x, y);

Widget/gamewidget.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ GameWidget::GameWidget(Judge *j, QWidget *parent) :
9393
connect(ui->chatInput, SIGNAL(returnPressed()), ui->sendButton,SIGNAL(clicked()), Qt::UniqueConnection);
9494
connect(timerForPlayer,&QTimer::timeout, this, &GameWidget::playerTimeout_OFFL);
9595
connect(timerForBar,&QTimer::timeout,this,&GameWidget::updateBar);
96-
connect(bot, &Bot::timeout, this, &GameWidget::botTimeout);
97-
connect(bot, &QThread::finished, this, [&](){ // 保证只在 judge->runMode==0 时才会被调用
98-
if(judge->curPlayer == 0) return;
99-
startTimer();
100-
if(autoControl->isToggled()) autoPlayer->start();
101-
});
10296
connect(judge, &Judge::GIVEUP_OP, this, &GameWidget::remoteResign);
10397
connect(judge, &Judge::TIMEOUT_END_OP, this, [&](){gameLose(1);});
10498
connect(judge, &Judge::SUICIDE_END_OP, this, [&](){
@@ -120,7 +114,7 @@ GameWidget::GameWidget(Judge *j, QWidget *parent) :
120114
connect(autoPlayer, &QThread::finished, this, [&](){
121115
if(!autoControl->isToggled()) return;
122116
if(judge->curPlayer == 1) return;
123-
qDebug()<<"2";
117+
// qDebug() << clock();
124118
startTimer();
125119
if(!judge->runMode) emit turnForBot();
126120
});
@@ -131,6 +125,12 @@ GameWidget::GameWidget(Judge *j, QWidget *parent) :
131125
autoPlayer->terminate();
132126
}
133127
});
128+
connect(bot, &Bot::timeout, this, &GameWidget::botTimeout);
129+
connect(bot, &QThread::finished, this, [&](){ // 保证只在 judge->runMode==0 时才会被调用
130+
if(judge->curPlayer == 0) return;
131+
startTimer();
132+
if(autoControl->isToggled()) autoPlayer->start();
133+
});
134134

135135
//链接reviewdialog
136136
connect(reviewDialog, &ReviewDialog::trybutton, this, &GameWidget::on_try);
@@ -867,7 +867,6 @@ void GameWidget::on_loadButton_clicked()
867867
else{
868868
judge->updateStep(dataStr[0] - '1', dataStr[2] - '0', dataVec, strState);
869869
// 理论上,没有判断非法 .dat
870-
qDebug()<<"5";
871870
startTimer(); // 重置计时器
872871
}
873872

mynogo.pro.user

Lines changed: 0 additions & 261 deletions
This file was deleted.

report/report.aux

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
\@writefile{toc}{\contentsline {subsection}{\numberline {2.8}更多功能}{7}{subsection.2.8}\protected@file@percent }
3737
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.8.1}附加任务 1,2 实现}{7}{subsubsection.2.8.1}\protected@file@percent }
3838
\@writefile{lof}{\contentsline {figure}{\numberline {2.8.1}{\ignorespaces 对局重现}}{9}{figure.2.8.1}\protected@file@percent }
39-
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.8.2}其他功能}{9}{subsubsection.2.8.2}\protected@file@percent }
39+
\@writefile{toc}{\contentsline {subsection}{\numberline {2.9}附加任务 5,6 实现}{9}{subsection.2.9}\protected@file@percent }
40+
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.9.1}其他功能}{9}{subsubsection.2.9.1}\protected@file@percent }
4041
\@writefile{toc}{\contentsline {section}{\numberline {3}联机对战设计}{9}{section.3}\protected@file@percent }
4142
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}通信协议}{9}{subsection.3.1}\protected@file@percent }
4243
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}联机对战逻辑}{10}{subsection.3.2}\protected@file@percent }
@@ -45,7 +46,7 @@
4546
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.3}完成对局并确认胜负}{10}{subsubsection.3.2.3}\protected@file@percent }
4647
\@writefile{lof}{\contentsline {figure}{\numberline {3.2.1}{\ignorespaces 联机对局界面演示}}{11}{figure.3.2.1}\protected@file@percent }
4748
\@writefile{toc}{\contentsline {section}{\numberline {4}AI 算法设计}{11}{section.4}\protected@file@percent }
48-
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{11}{subsection.4.1}\protected@file@percent }
49+
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{12}{subsection.4.1}\protected@file@percent }
4950
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}估价函数}{13}{subsection.4.2}\protected@file@percent }
5051
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}参数调整}{13}{subsection.4.3}\protected@file@percent }
5152
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}AI 对战强度}{14}{subsection.4.4}\protected@file@percent }

report/report.log

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2023.2.22) 5 JUN 2023 13:39
1+
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2023.1.16) 5 JUN 2023 19:51
22
entering extended mode
33
restricted \write18 enabled.
44
%&-line parsing enabled.
@@ -964,19 +964,20 @@ File: img/review1.png Graphic file (type bmp)
964964
File: img/review2.png Graphic file (type bmp)
965965
<img/review2.png>
966966
[8]
967-
Overfull \hbox (26.3576pt too wide) in paragraph at lines 329--330
967+
Overfull \hbox (26.3576pt too wide) in paragraph at lines 339--340
968968
[]\TU/SimSun(0)/m/n/10.53937 联 机 功 能 使 用 基 于 [][]\TU/lmtt/m/n/10.53937 QTcpServ
969969
er, QTcpSocket []\TU/SimSun(0)/m/n/10.53937 二 次 封 装 的 [][]\TU/lmtt/m/n/10.53937
970970
NetworkServer, NetworkSocket
971971
[]
972972

973973
[9]
974-
Overfull \hbox (9.971pt too wide) in paragraph at lines 361--362
974+
Overfull \hbox (9.971pt too wide) in paragraph at lines 371--372
975975
[]\TU/SimSun(0)/m/n/10.53937 此 时,| 提 出 邀 请 发 发 送 [][]\TU/lmtt/m/n/10.53937 REA
976976
DY_OP []\TU/SimSun(0)/m/n/10.53937 型 数 据,| 接 收 方 识 别 该 数 据,| 并 弹 出 同 样 的 [][]
977977
\TU/lmtt/m/n/10.53937 OptionDialog
978978
[]
979979

980+
[10]
980981
File: img/web4.png Graphic file (type bmp)
981982
<img/web4.png>
982983
File: img/web5.png Graphic file (type bmp)
@@ -985,22 +986,28 @@ File: img/web2.png Graphic file (type bmp)
985986
<img/web2.png>
986987
File: img/web3.png Graphic file (type bmp)
987988
<img/web3.png>
988-
[10] [11] [12] [13]
989+
[11] [12] [13]
989990
File: img/teammate.png Graphic file (type bmp)
990991
<img/teammate.png>
991992
File: img/pk.png Graphic file (type bmp)
992993
<img/pk.png>
993994
[14] [15] (./report.aux)
994-
Package rerunfilecheck Info: File `report.out' has not changed.
995-
(rerunfilecheck) Checksum: 159A39B97E987257127AD834BE5B40C8;2763.
995+
996+
Package rerunfilecheck Warning: File `report.out' has changed.
997+
(rerunfilecheck) Rerun to get outlines right
998+
(rerunfilecheck) or use package `bookmark'.
999+
1000+
Package rerunfilecheck Info: Checksums for `report.out':
1001+
(rerunfilecheck) Before: 159A39B97E987257127AD834BE5B40C8;2763
1002+
(rerunfilecheck) After: BDB544BA3688DE2207613BCB8DA1CECB;2900.
9961003
)
9971004
Here is how much of TeX's memory you used:
998-
18620 strings out of 476179
999-
381384 string characters out of 5813072
1000-
1045560 words of memory out of 5000000
1001-
38983 multiletter control sequences out of 15000+600000
1005+
18620 strings out of 477146
1006+
381384 string characters out of 5829170
1007+
1041330 words of memory out of 5000000
1008+
38927 multiletter control sequences out of 15000+600000
10021009
479889 words of font info for 118 fonts, out of 8000000 for 9000
1003-
1348 hyphenation exceptions out of 8191
1010+
622 hyphenation exceptions out of 8191
10041011
88i,15n,91p,315b,1188s stack positions out of 10000i,1000n,20000p,200000b,200000s
10051012

10061013
Output written on report.pdf (17 pages).

report/report.out

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
\BOOKMARK [2][-]{subsection.2.7}{\376\377\117\341\140\157\172\227\123\343}{section.2}% 11
1212
\BOOKMARK [2][-]{subsection.2.8}{\376\377\146\364\131\032\122\237\200\375}{section.2}% 12
1313
\BOOKMARK [3][-]{subsubsection.2.8.1}{\376\377\226\104\122\240\116\373\122\241\000\040\0001\000,\0002\000\040\133\236\163\260}{subsection.2.8}% 13
14-
\BOOKMARK [3][-]{subsubsection.2.8.2}{\376\377\121\166\116\326\122\237\200\375}{subsection.2.8}% 14
15-
\BOOKMARK [1][-]{section.3}{\376\377\200\124\147\072\133\371\142\030\213\276\213\241}{}% 15
16-
\BOOKMARK [2][-]{subsection.3.1}{\376\377\220\032\117\341\123\117\213\256}{section.3}% 16
17-
\BOOKMARK [2][-]{subsection.3.2}{\376\377\200\124\147\072\133\371\142\030\220\073\217\221}{section.3}% 17
18-
\BOOKMARK [3][-]{subsubsection.3.2.1}{\376\377\123\314\145\271\136\372\172\313\217\336\143\245}{subsection.3.2}% 18
19-
\BOOKMARK [3][-]{subsubsection.3.2.2}{\376\377\116\000\145\271\123\321\215\167\133\371\134\100\377\014\123\346\116\000\145\271\170\156\213\244\133\371\134\100}{subsection.3.2}% 19
20-
\BOOKMARK [3][-]{subsubsection.3.2.3}{\376\377\133\214\142\020\133\371\134\100\136\166\170\156\213\244\200\334\215\037}{subsection.3.2}% 20
21-
\BOOKMARK [1][-]{section.4}{\376\377\000A\000I\000\040\173\227\154\325\213\276\213\241}{}% 21
22-
\BOOKMARK [2][-]{subsection.4.1}{\376\377\000M\000i\000n\000i\000m\000a\000x\000\040\144\034\175\042\124\214\000\040\000A\000l\000p\000h\000a\000-\000B\000e\000t\000a\000\040\122\152\147\235}{section.4}% 22
23-
\BOOKMARK [2][-]{subsection.4.2}{\376\377\117\060\116\367\121\375\145\160}{section.4}% 23
24-
\BOOKMARK [2][-]{subsection.4.3}{\376\377\123\302\145\160\214\003\145\164}{section.4}% 24
25-
\BOOKMARK [2][-]{subsection.4.4}{\376\377\000A\000I\000\040\133\371\142\030\137\072\136\246}{section.4}% 25
26-
\BOOKMARK [1][-]{section.5}{\376\377\141\037\214\042}{}% 26
14+
\BOOKMARK [2][-]{subsection.2.9}{\376\377\226\104\122\240\116\373\122\241\000\040\0005\000,\0006\000\040\133\236\163\260}{section.2}% 14
15+
\BOOKMARK [3][-]{subsubsection.2.9.1}{\376\377\121\166\116\326\122\237\200\375}{subsection.2.9}% 15
16+
\BOOKMARK [1][-]{section.3}{\376\377\200\124\147\072\133\371\142\030\213\276\213\241}{}% 16
17+
\BOOKMARK [2][-]{subsection.3.1}{\376\377\220\032\117\341\123\117\213\256}{section.3}% 17
18+
\BOOKMARK [2][-]{subsection.3.2}{\376\377\200\124\147\072\133\371\142\030\220\073\217\221}{section.3}% 18
19+
\BOOKMARK [3][-]{subsubsection.3.2.1}{\376\377\123\314\145\271\136\372\172\313\217\336\143\245}{subsection.3.2}% 19
20+
\BOOKMARK [3][-]{subsubsection.3.2.2}{\376\377\116\000\145\271\123\321\215\167\133\371\134\100\377\014\123\346\116\000\145\271\170\156\213\244\133\371\134\100}{subsection.3.2}% 20
21+
\BOOKMARK [3][-]{subsubsection.3.2.3}{\376\377\133\214\142\020\133\371\134\100\136\166\170\156\213\244\200\334\215\037}{subsection.3.2}% 21
22+
\BOOKMARK [1][-]{section.4}{\376\377\000A\000I\000\040\173\227\154\325\213\276\213\241}{}% 22
23+
\BOOKMARK [2][-]{subsection.4.1}{\376\377\000M\000i\000n\000i\000m\000a\000x\000\040\144\034\175\042\124\214\000\040\000A\000l\000p\000h\000a\000-\000B\000e\000t\000a\000\040\122\152\147\235}{section.4}% 23
24+
\BOOKMARK [2][-]{subsection.4.2}{\376\377\117\060\116\367\121\375\145\160}{section.4}% 24
25+
\BOOKMARK [2][-]{subsection.4.3}{\376\377\123\302\145\160\214\003\145\164}{section.4}% 25
26+
\BOOKMARK [2][-]{subsection.4.4}{\376\377\000A\000I\000\040\133\371\142\030\137\072\136\246}{section.4}% 26
27+
\BOOKMARK [1][-]{section.5}{\376\377\141\037\214\042}{}% 27

report/report.pdf

2.29 KB
Binary file not shown.

report/report.synctex.gz

752 Bytes
Binary file not shown.

report/report.tex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,16 @@
314314
\caption{对局重现}
315315
\end{figure}
316316

317+
\subsection{附加任务 5,6 实现}
318+
319+
\textbf{AI 独立线程}
320+
321+
将 AI 类继承自 Qt 内建的 \verb|QThread| 类,使用 \verb|void QThread::run()| 作为 AI 线程的入口即可。
322+
323+
\textbf{AI 进度条}
324+
325+
因为 AI 线程独立,所以仿照上例画一下进度条就好了。
326+
317327
\subsubsection{其他功能}
318328

319329
没有写更多功能是怎么回事呢?大作业相信大家很熟悉,但是没有写更多功能是怎么回事呢?笔者也不是很清楚,大家也可能感到很惊讶,没有写更多功能是怎么回事呢?但事实就是这样,可以前往 \href{https://ce-amtic.github.io/}{ce-amtic 的博客} 看博客。

report/report.toc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111
\contentsline {subsection}{\numberline {2.7}信息窗口}{7}{subsection.2.7}%
1212
\contentsline {subsection}{\numberline {2.8}更多功能}{7}{subsection.2.8}%
1313
\contentsline {subsubsection}{\numberline {2.8.1}附加任务 1,2 实现}{7}{subsubsection.2.8.1}%
14-
\contentsline {subsubsection}{\numberline {2.8.2}其他功能}{9}{subsubsection.2.8.2}%
14+
\contentsline {subsection}{\numberline {2.9}附加任务 5,6 实现}{9}{subsection.2.9}%
15+
\contentsline {subsubsection}{\numberline {2.9.1}其他功能}{9}{subsubsection.2.9.1}%
1516
\contentsline {section}{\numberline {3}联机对战设计}{9}{section.3}%
1617
\contentsline {subsection}{\numberline {3.1}通信协议}{9}{subsection.3.1}%
1718
\contentsline {subsection}{\numberline {3.2}联机对战逻辑}{10}{subsection.3.2}%
1819
\contentsline {subsubsection}{\numberline {3.2.1}双方建立连接}{10}{subsubsection.3.2.1}%
1920
\contentsline {subsubsection}{\numberline {3.2.2}一方发起对局,另一方确认对局}{10}{subsubsection.3.2.2}%
2021
\contentsline {subsubsection}{\numberline {3.2.3}完成对局并确认胜负}{10}{subsubsection.3.2.3}%
2122
\contentsline {section}{\numberline {4}AI 算法设计}{11}{section.4}%
22-
\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{11}{subsection.4.1}%
23+
\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{12}{subsection.4.1}%
2324
\contentsline {subsection}{\numberline {4.2}估价函数}{13}{subsection.4.2}%
2425
\contentsline {subsection}{\numberline {4.3}参数调整}{13}{subsection.4.3}%
2526
\contentsline {subsection}{\numberline {4.4}AI 对战强度}{14}{subsection.4.4}%

0 commit comments

Comments
 (0)