使用四线(connect4)游戏实现和使用MinMax游戏。我想我明白了,它应该构建一个可能的板树到一定深度,评估它们并返回它们的分数,然后我们只取这些分数的最大值。因此,aiChooseCol()通过调用MinMax()aiChooseCol()检查每个可能列的得分,并返回得分最高的列。现在我不确定,这是调用MinMax()的正确方法吗?检查temp=Math.Max(temp,1000);是否正确temp=Math.Max(temp,1000);?我仍然没有启发式,但这至少应该确定一个获胜列并选择它,但目前它只是选择左边的第一个空闲列......我不知道我做错了什么。privateintAiChooseCol(){intbest=-1000;intcol=0;for(inti=0;ibest){best=t;科尔=我;}m_Board.RemoveTopCoinFromCol(i);}}返回列;}privateintMinMax(intDepth,boardBoard,charPlayerSign){inttemp=0;if(Depth<=0){//从启发式函数返回returntemp;}charotherPlayerSign=board.GetOtherPlayerSign(PlayerSign);charcheckBoard=Board.CheckBoardForWin();如果(checkBoard==PlayerSign){返回1000;}elseif(checkBoard==otherPlayerSign){return-1000;}elseif(!Board.CheckIfBoardIsNotFull()){返回0;//tie}if(PlayerSign==m_Sign)//最大化Playerismyself{temp=-1000;for(inti=0;i
