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

正文內(nèi)容

基于c的五子棋游戲的設(shè)計(jì)與實(shí)現(xiàn)-資料下載頁

2024-08-31 18:24本頁面

【導(dǎo)讀】五子棋是起源于中國古代的傳統(tǒng)黑白棋種之一?!按椤薄ⅰ拔迥俊?、“五目碰”、“五格”等多種稱謂。五子棋既有現(xiàn)代休閑的明顯特征“短、平、快”,又有古典哲學(xué)的高深學(xué)問“陰陽易理”;它既有簡單易學(xué)的特性,“場”的概念,亦有“點(diǎn)”的連接。它是中西文化的交流點(diǎn),是。古今哲理的結(jié)晶。用來表示當(dāng)前玩家選擇游戲的情況,當(dāng)m_renren為false時(shí),表示人機(jī)對戰(zhàn);為true時(shí),表示人人對弈。示玩家需要聲音,否則的話,玩家不需要聲音。當(dāng)first為true時(shí),表示人。先下,否則,電腦先下。points[i,j]=2表示此處無子,points[i,j]=1表示此處。為黑子points[i,j]=0表示此處為白子。它還可以用來顯示當(dāng)前棋子的圖片。用來記錄鼠標(biāo)經(jīng)過后點(diǎn)的位置。用枚舉類型來表示結(jié)局。初始化棋子的背景顏色。將棋子的sizemode設(shè)置為CenterImage. 將棋子的可見性設(shè)置為false. 將棋子添加到form上。

  

【正文】 ) amp。amp。 ConnectqpCount(1, left, right) = 3) ++。 if (ActiveConnectqp(1, 3, top, down) amp。amp。 ConnectqpCount(1, top, down) = 3) ++。 if (ActiveConnectqp(1, 3, leftTop, rightDown) amp。amp。 ConnectqpCount(1, leftTop, rightDown) = 3) ++。 if (ActiveConnectqp(1, 3, leftDown, rightTop) amp。amp。 ConnectqpCount(1, leftDown, rightTop) = 3) ++。 points[x, y] = 2。 /// ///處理白棋連子情況 /// //if (x == 6 amp。amp。 y == 9) //x = 6。 points[x, y] = 0。 //左右方向 connectCount = ConnectqpCount(0, left, right)。 [connectCount]++。 if (ActiveConnectqp(0, connectCount, 24 left, right)) { [connectCount]。 [connectCount]++。 } //上下方向 connectCount = ConnectqpCount(0, top, down)。 [connectCount]++。 if (ActiveConnectqp(0, connectCount, top, down)) { [connectCount]。 [connectCount]++。 } //左上 _右下方向 connectCount = ConnectqpCount(0, leftTop, rightDown)。 [connectCount]++。 if (ActiveConnectqp(0, connectCount, leftTop, rightDown)) { [connectCount]。 [connectCount]++。 } //左下 _右上方向 connectCount = ConnectqpCount(0, leftDown, rightTop)。 [connectCount]++。 if (ActiveConnectqp(0, connectCount, leftDown, rightTop)) 25 { [connectCount]。 [connectCount]++。 } points[x, y] = 2。 // //開始求權(quán)值 // if ([5] 0) return 150000。 else if ([5] 0) return 140000。 else if ([4] 0 || [4] 1) return 130000。 else if ([4] == 1 amp。amp。 [3] 0) return 120200。 else if ([4] == 1 || [4] 1) return 110000。 else if ([4] == 1 amp。amp。 [3] 0) return 100000。 else if ([4] 0 amp。amp。 == 1) return 90000。 else if ([3] 1) return 80000。 else if ([4] 0 amp。amp。 [3] 0) return 70000。 else { totalPower = 26 ([4] + [3]) * 6250 + ([3] + [2]+[4] + [3]) * 1250 + ([2] + [3] + [2]) * 250 + [1] * 50 + ([1] + [2] + [1]) * 10 + [1] * 2。 return totalPower。 } } } 12) 判斷輸贏 —— Win 如果得到的權(quán)值大于等于 150000,表明贏了。代碼如下: bool isWin。 points[x, y] = 2。 if (GetqpPower(qzcolor, x, y) = 150000) isWin = true。 else isWin = false。 points[x, y] = qzcolor。 return isWin。 實(shí)現(xiàn)菜單功能的函數(shù) 13)開始 —— kaishi_Click 當(dāng)單擊“開始”時(shí),如果是人人對弈,界面上應(yīng)什么都沒有,調(diào)用 start 函數(shù)就行了。如果是人機(jī)對弈,人先下的話,界面和人人對弈一樣,并讓人下黑棋子。否則,在棋盤中心下一個(gè)黑棋子。 14) 重新開始 —— restart_Click 如果你玩到中途不想玩這一局了。你可以單擊“重新開始”。將 begin 設(shè)為 false。調(diào)用 start 函數(shù)。 15) 換方 —— huanfang_Click 27 如果你不想先下,你可以單擊“換方”。這只對人機(jī)對弈有效。代碼如下: first = !first。 begin = false。 start()。 if (first) { qzcolor = 1。 } else { qzcolor = 1。 putqz(qzcolor, 7, 7)。 } 16) 悔棋 —— hqi_Click 如果你覺得前面的棋子下錯(cuò)了,你可以按“悔棋”鍵。代碼如下: int i。 Point tempPoint = new Point()。 if (begin) { if (sound) { SoundPlayer sndPing = new SoundPlayer(global::五子棋 .)。 ()。 } if ( 1) { for (i = 0。 i 2。 i++) { tempPoint = (Point)()。 qz[, 28 ].Visible = false。 points[, ] = 2。 } if ( 0) { tempPoint = (Point)()。 if (points[, ] == 1) qz[, ].Image = global::五子棋 .。 else qz[, ].Image = global::五子棋 .。 (tempPoint)。 } } } 17) 音效 —— shengyin_Click 如果你在下棋過程中想要聲音或者不要,你都可以按“音效”鍵。如果有聲音,音效前應(yīng)有個(gè)小鉤。否則,沒有。同時(shí)工具欄上的圖片也會隨之變化。代碼如下: = !。 sound = !sound。 if (sound) { = global::五子棋 .。 // = true。 } else { = global::五子棋 .。 29 // = false。 } 18) 退出 —— tuichu_Click 按“退出”鍵,退出整個(gè)應(yīng)用程序。 19) 人機(jī)對弈 —— diannao_Click 單擊“人機(jī)對弈”時(shí),它前面的小鉤出現(xiàn),而“人人對弈”沒有。并且工具欄上的“換方”和菜單上的“換方“都可用。代碼如下: = true。
點(diǎn)擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1