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

正文內(nèi)容

網(wǎng)絡(luò)對弈課程設(shè)計(jì)說明書(參考版)

2025-06-08 12:28本頁面
  

【正文】 (yPos * 20 == chessWhite_YPOS[chessToCompareIndex])) {// 判斷當(dāng)前下的棋子的右邊 4個棋子是否都為白棋 chessLinkedCount++。 chessToCompareIndex++) { if (((xPos + closeGrid) * 20 == chessWhite_XPOS[chessToCompareIndex]) amp。 closeGrid++) { for (chessToCompareIndex = 0。 for (closeGrid = 1。 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 chessLinkedCompare = 1。 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 34 頁 共 55 頁 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 chessLinkedCompare = 1。 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 chessLinkedCompare = 1。 } else { break。 if (chessLinkedCount == 5) { return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 } else {// 若中間有一個棋子非黑棋,則會進(jìn)入此分支,此時無需再遍歷 break。 // 連接數(shù)加 1 if (chessLinkedCount == 5) { // 五子相連時,勝利 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 31 頁 共 55 頁 return true。amp。 chessToCompareIndex = chessBlackCount。 closeGrid = 4。 // 相鄰網(wǎng)格的位置 if (chessColor == 1) { // 黑棋時 chessLinkedCount = 1。 // 用于比較是否要繼續(xù)遍歷一個棋子的相鄰網(wǎng)格 int chessToCompareIndex = 0。 } } // 判斷當(dāng)前狀態(tài)是否為勝利狀態(tài) public boolean checkVicStatus(int xPos, int yPos, int chessColor) { int chessLinkedCount = 1。 chessWhite_YPOS[chessWhiteCount] = yPos * 20。 chessBlackCount++。 } } // 取得指定棋子的位置 public void setLocation(int xPos, int yPos, int chessColor) { if (chessColor == 1) { // 棋子為黑棋時 chessBlack_XPOS[chessBlackCount] = xPos * 20。 } else if (vicChessColor == 1) { // 白棋 勝 chessWhiteVicTimes++。 if (vicChessColor == 1) { // 黑棋勝 chessBlackVicTimes++。 add(statusText)。 } // 清空棋盤上的黑棋數(shù) chessBlackCount = 0。 i++) { chessWhite_XPOS[i] = 0。 } 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 29 頁 共 55 頁 // 將白棋的位置設(shè)置到零點(diǎn) for (int i = 0。 i++) { chessBlack_XPOS[i] = 0。 // 將黑棋的位置設(shè)置到零點(diǎn) for (int i = 0。 } return false。 return true。 // 取得輸出流 outputData = new DataOutputStream(())。 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 28 頁 共 55 頁 } // 連接到主機(jī) public boolean connectServer(String ServerIP, int ServerPort) throws Exception { try { // 取得主機(jī)端口 chessSocket = new Socket(ServerIP, ServerPort)。 (new Rectangle(40, 5, 360, 24))。 addMouseListener(this)。 setLayout(null)。 public FIRThread firThread = new FIRThread(this)。 public int port = 4331。 public String chessPeerName = null。 public DataOutputStream outputData。 // 套接口 public Socket chessSocket。 // 黑棋獲勝次數(shù) public int chessBlackVicTimes = 0。 // 黑棋數(shù)量 public int chessBlackCount = 0。 // 白棋 x 軸坐標(biāo)位數(shù)組 public int chessWhite_XPOS[] = new int[200]。 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 27 頁 共 55 頁 // 黑棋 x 軸坐標(biāo)位數(shù)組 public int chessBlack_XPOS[] = new int[200]。 // 棋子的 y 軸坐標(biāo)位 public int chessY_POS = 1。 // 是否在下棋中 public boolean isGaming = false。 } } catch (IOException es){} } } 棋盤以及規(guī)則 類: public class FIRPad extends Panel implements MouseListener, ActionListener { // 鼠標(biāo)是否能使用 public boolean isMouseEnabled = false。 try { while (true) { // 等待聊天信息,進(jìn)入 wait 狀態(tài) message = ()。 ( ().length())。 } else if ((/error)) { // 收到信息錯誤 ( 錯 誤 , 退 出 程序 .\n)。 = false。 ()。 // 設(shè)定其為白棋后性 (游戲加入,等待對手 .)。 (黑方下 ...)。 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 25 頁 共 55 頁 if () { // 若用戶為游戲建立者 = 1。 } (true)。 (true)。 (false)。 // 取得用戶本名 (Java 五子棋客戶端 + 用戶名 : + )。 } (0)。// 將用戶信息添加到用戶列表中 (user)。amp。 while (()) { // 當(dāng)收到的用戶信息列表中存在數(shù)據(jù)時 String user = (String) ( )。 // 清空客戶端 用戶下拉框 ()。 int userNumber = 0。 public FIRClientThread(FIRClient firClient) { = firClient。 } } 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 23 頁 共 55 頁 } } 客戶端 客戶端主類即客戶端的運(yùn)行類,用戶通過運(yùn)行該類連接服務(wù)器,也是通過在該類的窗體中與其他玩家對弈。 dealWithMsg(message)。 sendInitMsg()。 synchronized (clientDataHash) { ( 當(dāng)前連接數(shù) : + ())。 } isClientClosed = true。 try { 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 22 頁 共 55 頁 ()。 } sendPublicMsg(getUserList())。 } } synchronized (clientDataHash) { // 刪除客戶數(shù)據(jù) (clientSocket)。 synchronized (chessPeerHash) { //如果是游戲客戶端主機(jī) if (((clientSocket))) { ((String) (clientSocket))。 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 21 頁 共 55 頁 Feedback(注意:命令必須對所有用戶發(fā)送 )。 Feedback(/list 更新用戶列表 )。 Feedback(/yourname + (String) (clientSocket))。 } return null。) { hashKey = (Object) ()。 for (Enumeration enu = ()。 } return userList。 ()。 } } 桂林電子科技大學(xué)課程設(shè)計(jì)說明書用紙 第 20 頁 共 55 頁 } // 取得用戶列表 public String getUserList() { String userList = /userlist。 try { (feedBackMsg)。 } } return true。 }
點(diǎn)擊復(fù)制文檔內(nèi)容
畢業(yè)設(shè)計(jì)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1