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

正文內容

基于c的五子棋游戲的設計與實現_畢業(yè)設計論文-在線瀏覽

2024-09-13 08:32本頁面
  

【正文】 = (( ), ( )) + 1 + temp1 + temp2。再判斷它是否是活棋。否則,反之。 if ( != ) yPlus = ( ) / ( )。 i length 4。 y = temp1 * yPlus + i * yPlus。 sum = 0。 j 4。 else if (points[x + j * xPlus, y + j * yPlus] == qzcolor+1) { sum = 0。 } } if (0 x amp。 0 = y yPlus amp。 y yPlus = 14) { if (sum == count amp。 points[x xPlus, y yPlus] == 2 amp。 points[x + 4 * xPlus, y + 4 * yPlus] == 2) return true。代碼如下: if (!ActiveConnectqp(qzcolor, count, point1, point2)) return false。 else if (count == 4) return true。 points[x, y] = qzcolor+1。 points[x, y] = qzcolor。 } 10 9) 查看 是否是最好的點 —— FindBestPoint 首先,查看有沒有最佳點,并形成棧元素。當棧非空時,將棧元素彈出,如果棧中的 pointNumber 小于 pointCount 時,在棋盤上下一棋。如果和棋的話,也不再繼續(xù)探測,并在棋盤上退一棋。如果棧頂元素無點,彈出后棧必非空,并在棋盤上退一棋。實現的代碼如下: 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(, [umber])) {//贏棋,不在繼續(xù)探測 [] = 。 //在棋盤上退一棋 points[[tempStackElement.pointNumber].X, [umber].Y] = 2。 (tempStackElement)。 [r] = M。 ++。 } else {//另一方繼續(xù)下棋向下探測 ++。 FindBestFivePointsAndFormAStackElement(tempStackElemen+1, ref tempStackElement)。 } }//end if else//棧頂元素無點或點均已試過 { if ( == 0)//棧頂元素無點,且彈出后棧必非空 { tempStackElement = (StackElement)()。 [r 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 == 14 [i] amp。 bestStepNumber [i]) bestStepNumber = [i]。 [ 1] = (result)(0 totalresult)。 //在棋盤上退一棋 points[[tempStackElement.pointNumber 1].X, [umber 1].Y] = 2。 } } } } for (i = 0。 i++) if (totalresult == [i] amp。 bestStepNumber == [i]) break。 return true。如果找到,返回 true;否則。要找 最佳點,就是找權值最大的點。代碼如下: 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。 } 16 } if ( == 0) return false。 = 0。 } 11) 求權值 —— GetqpPower 定義八個方向:左,右,上,下,左上,右下,左下,右上。 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)。然后看這個點各個方向黑棋子的數目是多少,并看是否是活棋,再作出處理。表示這點沒有下棋子。然后看這個點各個方向白棋子的數目是多少,并在此放一白棋破壞黑棋,再做出相應的處理 。就將tempActive3自加 1。表示這點沒有下棋子。代碼如下 : 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)) { 18 [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]
點擊復制文檔內容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1