Skip to content

Commit

Permalink
写一坨
Browse files Browse the repository at this point in the history
  • Loading branch information
ce-amtic committed Jun 5, 2023
1 parent 940dce8 commit a9d79e5
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 298 deletions.
2 changes: 1 addition & 1 deletion Object/bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void Bot::makeRandomMove()
}
x = rand() % CHESSBOARD_SIZE;
y = rand() % CHESSBOARD_SIZE;
qDebug() << x << ' ' << y;
// qDebug() << x << ' ' << y;
}
while(!judge->CheckVaild(x, y));
judge->PlaceAPiece(x, y);
Expand Down
15 changes: 7 additions & 8 deletions Widget/gamewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ GameWidget::GameWidget(Judge *j, QWidget *parent) :
connect(ui->chatInput, SIGNAL(returnPressed()), ui->sendButton,SIGNAL(clicked()), Qt::UniqueConnection);
connect(timerForPlayer,&QTimer::timeout, this, &GameWidget::playerTimeout_OFFL);
connect(timerForBar,&QTimer::timeout,this,&GameWidget::updateBar);
connect(bot, &Bot::timeout, this, &GameWidget::botTimeout);
connect(bot, &QThread::finished, this, [&](){ // 保证只在 judge->runMode==0 时才会被调用
if(judge->curPlayer == 0) return;
startTimer();
if(autoControl->isToggled()) autoPlayer->start();
});
connect(judge, &Judge::GIVEUP_OP, this, &GameWidget::remoteResign);
connect(judge, &Judge::TIMEOUT_END_OP, this, [&](){gameLose(1);});
connect(judge, &Judge::SUICIDE_END_OP, this, [&](){
Expand All @@ -120,7 +114,7 @@ GameWidget::GameWidget(Judge *j, QWidget *parent) :
connect(autoPlayer, &QThread::finished, this, [&](){
if(!autoControl->isToggled()) return;
if(judge->curPlayer == 1) return;
qDebug()<<"2";
// qDebug() << clock();
startTimer();
if(!judge->runMode) emit turnForBot();
});
Expand All @@ -131,6 +125,12 @@ GameWidget::GameWidget(Judge *j, QWidget *parent) :
autoPlayer->terminate();
}
});
connect(bot, &Bot::timeout, this, &GameWidget::botTimeout);
connect(bot, &QThread::finished, this, [&](){ // 保证只在 judge->runMode==0 时才会被调用
if(judge->curPlayer == 0) return;
startTimer();
if(autoControl->isToggled()) autoPlayer->start();
});

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

Expand Down
261 changes: 0 additions & 261 deletions mynogo.pro.user

This file was deleted.

5 changes: 3 additions & 2 deletions report/report.aux
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
\@writefile{toc}{\contentsline {subsection}{\numberline {2.8}更多功能}{7}{subsection.2.8}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.8.1}附加任务 1,2 实现}{7}{subsubsection.2.8.1}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {2.8.1}{\ignorespaces 对局重现}}{9}{figure.2.8.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.8.2}其他功能}{9}{subsubsection.2.8.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.9}附加任务 5,6 实现}{9}{subsection.2.9}\protected@file@percent }
\@writefile{toc}{\contentsline {subsubsection}{\numberline {2.9.1}其他功能}{9}{subsubsection.2.9.1}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {3}联机对战设计}{9}{section.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}通信协议}{9}{subsection.3.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}联机对战逻辑}{10}{subsection.3.2}\protected@file@percent }
Expand All @@ -45,7 +46,7 @@
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.2.3}完成对局并确认胜负}{10}{subsubsection.3.2.3}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {3.2.1}{\ignorespaces 联机对局界面演示}}{11}{figure.3.2.1}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}AI 算法设计}{11}{section.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{11}{subsection.4.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{12}{subsection.4.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}估价函数}{13}{subsection.4.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}参数调整}{13}{subsection.4.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}AI 对战强度}{14}{subsection.4.4}\protected@file@percent }
Expand Down
29 changes: 18 additions & 11 deletions report/report.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2023.2.22) 5 JUN 2023 13:39
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2023.1.16) 5 JUN 2023 19:51
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
Expand Down Expand Up @@ -964,19 +964,20 @@ File: img/review1.png Graphic file (type bmp)
File: img/review2.png Graphic file (type bmp)
<img/review2.png>
[8]
Overfull \hbox (26.3576pt too wide) in paragraph at lines 329--330
Overfull \hbox (26.3576pt too wide) in paragraph at lines 339--340
[]\TU/SimSun(0)/m/n/10.53937 联 机 功 能 使 用 基 于 [][]\TU/lmtt/m/n/10.53937 QTcpServ
er, QTcpSocket []\TU/SimSun(0)/m/n/10.53937 二 次 封 装 的 [][]\TU/lmtt/m/n/10.53937
NetworkServer, NetworkSocket
[]

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

[10]
File: img/web4.png Graphic file (type bmp)
<img/web4.png>
File: img/web5.png Graphic file (type bmp)
Expand All @@ -985,22 +986,28 @@ File: img/web2.png Graphic file (type bmp)
<img/web2.png>
File: img/web3.png Graphic file (type bmp)
<img/web3.png>
[10] [11] [12] [13]
[11] [12] [13]
File: img/teammate.png Graphic file (type bmp)
<img/teammate.png>
File: img/pk.png Graphic file (type bmp)
<img/pk.png>
[14] [15] (./report.aux)
Package rerunfilecheck Info: File `report.out' has not changed.
(rerunfilecheck) Checksum: 159A39B97E987257127AD834BE5B40C8;2763.

Package rerunfilecheck Warning: File `report.out' has changed.
(rerunfilecheck) Rerun to get outlines right
(rerunfilecheck) or use package `bookmark'.

Package rerunfilecheck Info: Checksums for `report.out':
(rerunfilecheck) Before: 159A39B97E987257127AD834BE5B40C8;2763
(rerunfilecheck) After: BDB544BA3688DE2207613BCB8DA1CECB;2900.
)
Here is how much of TeX's memory you used:
18620 strings out of 476179
381384 string characters out of 5813072
1045560 words of memory out of 5000000
38983 multiletter control sequences out of 15000+600000
18620 strings out of 477146
381384 string characters out of 5829170
1041330 words of memory out of 5000000
38927 multiletter control sequences out of 15000+600000
479889 words of font info for 118 fonts, out of 8000000 for 9000
1348 hyphenation exceptions out of 8191
622 hyphenation exceptions out of 8191
88i,15n,91p,315b,1188s stack positions out of 10000i,1000n,20000p,200000b,200000s

Output written on report.pdf (17 pages).
27 changes: 14 additions & 13 deletions report/report.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
\BOOKMARK [2][-]{subsection.2.7}{\376\377\117\341\140\157\172\227\123\343}{section.2}% 11
\BOOKMARK [2][-]{subsection.2.8}{\376\377\146\364\131\032\122\237\200\375}{section.2}% 12
\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
\BOOKMARK [3][-]{subsubsection.2.8.2}{\376\377\121\166\116\326\122\237\200\375}{subsection.2.8}% 14
\BOOKMARK [1][-]{section.3}{\376\377\200\124\147\072\133\371\142\030\213\276\213\241}{}% 15
\BOOKMARK [2][-]{subsection.3.1}{\376\377\220\032\117\341\123\117\213\256}{section.3}% 16
\BOOKMARK [2][-]{subsection.3.2}{\376\377\200\124\147\072\133\371\142\030\220\073\217\221}{section.3}% 17
\BOOKMARK [3][-]{subsubsection.3.2.1}{\376\377\123\314\145\271\136\372\172\313\217\336\143\245}{subsection.3.2}% 18
\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
\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
\BOOKMARK [1][-]{section.4}{\376\377\000A\000I\000\040\173\227\154\325\213\276\213\241}{}% 21
\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
\BOOKMARK [2][-]{subsection.4.2}{\376\377\117\060\116\367\121\375\145\160}{section.4}% 23
\BOOKMARK [2][-]{subsection.4.3}{\376\377\123\302\145\160\214\003\145\164}{section.4}% 24
\BOOKMARK [2][-]{subsection.4.4}{\376\377\000A\000I\000\040\133\371\142\030\137\072\136\246}{section.4}% 25
\BOOKMARK [1][-]{section.5}{\376\377\141\037\214\042}{}% 26
\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
\BOOKMARK [3][-]{subsubsection.2.9.1}{\376\377\121\166\116\326\122\237\200\375}{subsection.2.9}% 15
\BOOKMARK [1][-]{section.3}{\376\377\200\124\147\072\133\371\142\030\213\276\213\241}{}% 16
\BOOKMARK [2][-]{subsection.3.1}{\376\377\220\032\117\341\123\117\213\256}{section.3}% 17
\BOOKMARK [2][-]{subsection.3.2}{\376\377\200\124\147\072\133\371\142\030\220\073\217\221}{section.3}% 18
\BOOKMARK [3][-]{subsubsection.3.2.1}{\376\377\123\314\145\271\136\372\172\313\217\336\143\245}{subsection.3.2}% 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}% 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}% 21
\BOOKMARK [1][-]{section.4}{\376\377\000A\000I\000\040\173\227\154\325\213\276\213\241}{}% 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}% 23
\BOOKMARK [2][-]{subsection.4.2}{\376\377\117\060\116\367\121\375\145\160}{section.4}% 24
\BOOKMARK [2][-]{subsection.4.3}{\376\377\123\302\145\160\214\003\145\164}{section.4}% 25
\BOOKMARK [2][-]{subsection.4.4}{\376\377\000A\000I\000\040\133\371\142\030\137\072\136\246}{section.4}% 26
\BOOKMARK [1][-]{section.5}{\376\377\141\037\214\042}{}% 27
Binary file modified report/report.pdf
Binary file not shown.
Binary file modified report/report.synctex.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions report/report.tex
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@
\caption{对局重现}
\end{figure}

\subsection{附加任务 5,6 实现}

\textbf{AI 独立线程}

将 AI 类继承自 Qt 内建的 \verb|QThread| 类,使用 \verb|void QThread::run()| 作为 AI 线程的入口即可。

\textbf{AI 进度条}

因为 AI 线程独立,所以仿照上例画一下进度条就好了。

\subsubsection{其他功能}

没有写更多功能是怎么回事呢?大作业相信大家很熟悉,但是没有写更多功能是怎么回事呢?笔者也不是很清楚,大家也可能感到很惊讶,没有写更多功能是怎么回事呢?但事实就是这样,可以前往 \href{https://ce-amtic.github.io/}{ce-amtic 的博客} 看博客。
Expand Down
5 changes: 3 additions & 2 deletions report/report.toc
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
\contentsline {subsection}{\numberline {2.7}信息窗口}{7}{subsection.2.7}%
\contentsline {subsection}{\numberline {2.8}更多功能}{7}{subsection.2.8}%
\contentsline {subsubsection}{\numberline {2.8.1}附加任务 1,2 实现}{7}{subsubsection.2.8.1}%
\contentsline {subsubsection}{\numberline {2.8.2}其他功能}{9}{subsubsection.2.8.2}%
\contentsline {subsection}{\numberline {2.9}附加任务 5,6 实现}{9}{subsection.2.9}%
\contentsline {subsubsection}{\numberline {2.9.1}其他功能}{9}{subsubsection.2.9.1}%
\contentsline {section}{\numberline {3}联机对战设计}{9}{section.3}%
\contentsline {subsection}{\numberline {3.1}通信协议}{9}{subsection.3.1}%
\contentsline {subsection}{\numberline {3.2}联机对战逻辑}{10}{subsection.3.2}%
\contentsline {subsubsection}{\numberline {3.2.1}双方建立连接}{10}{subsubsection.3.2.1}%
\contentsline {subsubsection}{\numberline {3.2.2}一方发起对局,另一方确认对局}{10}{subsubsection.3.2.2}%
\contentsline {subsubsection}{\numberline {3.2.3}完成对局并确认胜负}{10}{subsubsection.3.2.3}%
\contentsline {section}{\numberline {4}AI 算法设计}{11}{section.4}%
\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{11}{subsection.4.1}%
\contentsline {subsection}{\numberline {4.1}Minimax 搜索和 Alpha-Beta 剪枝}{12}{subsection.4.1}%
\contentsline {subsection}{\numberline {4.2}估价函数}{13}{subsection.4.2}%
\contentsline {subsection}{\numberline {4.3}参数调整}{13}{subsection.4.3}%
\contentsline {subsection}{\numberline {4.4}AI 对战强度}{14}{subsection.4.4}%
Expand Down

0 comments on commit a9d79e5

Please sign in to comment.