ADD file via upload

main
pwhjurltz 11 months ago
parent 78b925ac68
commit cd978d543d

@ -0,0 +1,32 @@
#include "ChessGame.h"
ChessGame::ChessGame(Man* man, AI* ai, Chess* chess)
{
this->man = man;
this->ai = ai;
this->chess = chess;
man->init(chess);
ai->init(chess);
}
//对局(开始五子棋游戏)
void ChessGame::play()
{
ChessPos pos;
chess->init();
while (1) {
//先由棋手走
man->go();
if (chess->checkOver()) {
chess->init();
continue;
}
//由AI走
ai->go();
if (chess->checkOver()) {
chess->init();
continue;
}
}
}
Loading…
Cancel
Save