freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于c的五子棋游戲的設(shè)計(jì)與實(shí)現(xiàn)-在線瀏覽

2025-08-06 12:32本頁(yè)面
  

【正文】 if (!ActiveConnectqp(qzcolor, count, point1, point2)) return false。 else if (count == 4) return true。 points[x, y] = qzcolor+1。 points[x, y] = qzcolor。 }9) 查看是否是最好的點(diǎn)——FindBestPoint首先,查看有沒(méi)有最佳點(diǎn),并形成棧元素。當(dāng)棧非空時(shí),將棧元素彈出,如果棧中的pointNumber小于pointCount時(shí),在棋盤上下一棋。如果和棋的話,也不再繼續(xù)探測(cè),并在棋盤上退一棋。如果棧頂元素?zé)o點(diǎn),彈出后棧必非空,并在棋盤上退一棋。實(shí)現(xiàn)的代碼如下:result totalresult = 。 StackElement tempStackElement = new StackElement()。 if (!FindBestFivePointsAndFormAStackElement(qzcolor, ref tempStackElement)) return false。 if (!FindBestFivePointsAndFormAStackElement(qzcolor, ref tempStackElement)) return false。 while ( 0)//棧非空 { tempStackElement = (StackElement)()。 if (Win(, [])) {//贏棋,不在繼續(xù)探測(cè) [] = 。 //在棋盤上退一棋 points[[].X, [].Y] = 2。 (tempStackElement)。 [] = M。 ++。 } else {//另一方繼續(xù)下棋向下探測(cè) ++。 FindBestFivePointsAndFormAStackElement(+1, ref tempStackElement)。 } }//end if else//棧頂元素?zé)o點(diǎn)或點(diǎn)均已試過(guò) { if ( == 0)//棧頂元素?zé)o點(diǎn),且彈出后棧必非空 { tempStackElement = (StackElement)()。 [ 1] = + 1。 (tempStackElement)。 for (i = 0。 i++) if (totalresult [i]) totalresult = [i]。 for (i = 0。 i++) if (totalresult == [i] amp。 bestStepNumber [i]) bestStepNumber = [i]。 for (i = 0。 i++) if (totalresult == [i] amp。 bestStepNumber [i]) bestStepNumber = [i]。 [ 1] = (result)(0 totalresult)。 //在棋盤上退一棋 points[[ 1].X, [ 1].Y] = 2。 } } } } for (i = 0。 i++) if (totalresult == [i] amp。 bestStepNumber == [i]) break。 return true。如果找到,返回true;否則。要找 最佳點(diǎn),就是找權(quán)值最大的點(diǎn)。代碼如下: int[,] qpPower = new int[15, 15]。 int x, y, i, max。 for (x = 0。 x++) for (y = 0。 y++) qpPower[x, y] = GetqpPower(qzcolor, x, y)。 i 5。 for (x = 0。 x++) for (y = 0。 y++) if (max qpPower[x, y]) max = qpPower[x, y]。 x 15。 for (y = 0。 y++) if (max == qpPower[x, y]) { [i] = new Point(x, y)。 qpPower[x, y] = 1。 break。 } } if ( == 0) return false。 = 0。 }11) 求權(quán)值——GetqpPower定義八個(gè)方向:左,右,上,下,左上,右下,左下,右上。 right = new Point((14, x + 4), y)。 down = new Point(x, (14, y + 4))。 leftTop = new Point(x temp, y temp)。 leftDown = new Point(x temp, y + temp)。 rightTop = new Point(x + temp, y temp)。 rightDown = new Point(x + temp, y + temp)。然后看這個(gè)點(diǎn)各個(gè)方向黑棋子的數(shù)目是多少,并看是否是活棋,再作出處理。表示這點(diǎn)沒(méi)有下棋子。然后看這個(gè)點(diǎn)各個(gè)方向白棋子的數(shù)目是多少,并在此放一白棋破壞黑棋,再做出相應(yīng)的處理。就將tempActive3自加1。表示這點(diǎn)沒(méi)有下棋子。代碼如下:if (qzcolor == 1) { if (points[x, y] != 2) return 2。 //左右方向 connectCount = ConnectqpCount(1, left, right)。 if (ActiveConnectqp(1, connectCount, left, right)) { [connectCount]。 } //上下方向 connectCount = ConnectqpCount(1, top, down)。 if (ActiveConnectqp(1, connectCount, top, down)) { [connectCount]。 } //左上_右下方向 connectCount = ConnectqpCount(1, leftTop, rightDown)。 if (ActiveConnectqp(1, connectCount, leftTop, rightDown)) { [connectCount]。 } //左下_右上方向 connectCount = ConnectqpCount(1, leftDown, rightTop)。 if (ActiveConnectqp(1, connectCount, leftDown, rightTop)) { [connectCount]。 } points[x, y] = 2。 //左右方向 connectCount = ConnectqpCount(0, left, right)。 if (BreakActiveConnectqp(0, connectCount, x, y, left, right)) { [connectCount]。 } //上下方向 connectCount = ConnectqpCount(0, top, down)。 if (BreakActiveConnectqp(0, connectCount, x, y, top, down)) { [connectCount]。 } //左上_右下方向 connectCount
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1