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

正文內(nèi)容

連珠五子棋的編程與制作(存儲版)

2025-06-30 15:35上一頁面

下一頁面
  

【正文】 Microsoft174。 下面是五子棋人工智能部分的核心算法。當搜索完整個棋盤后,己方棋型表也就填寫完畢了,然后用同樣的方法填寫棋型表。這樣既可以防守住對方巧妙地攻擊,又能待機發(fā)動反擊。封裝了棋盤的各種可能用到的功能,如繪制棋盤 、初始化、判斷勝負 ,人工智能落子 等。 Drawline(int,int,int,int)畫直線,參數(shù)為起點的 x和 y坐標、終點的 x 和 y 坐標 DrawRect(int,int,int,int)畫矩形,參數(shù)左上角的 x和 y坐標、寬、高 DrawlRoundRect(int,int,int,int, int,int)畫圓角矩形,參數(shù)為參數(shù)左上角的 x和 y坐標、x 寬、 y高、 x深度、 y深度 Drawl3DRect(int,int,int,int, boolean)畫 3D 矩形,參數(shù)為參數(shù)左上角的 x 和 y坐標、 x寬、 y 高、 ture 連珠五子棋的編程與制作 共 31 頁,第 8 頁 DrawOval(int,int,int,int)畫卵形,參數(shù)為起點的 x 和 y 坐標、長軸和短軸 畫填充圖形都是選用當前的顏色來繪制和填充的,黑色是系統(tǒng)默認的顏色,也可以使用 Grapics 類中的 SetColor() 來設定繪圖的顏色。i15。 (25, 455, 455, 455)。 if (board[i][j] == 1){ ()。 具體代碼如下 : public void ptoComputer(){ int x=0,y=0。 } } /** * 選擇最優(yōu)位置落子 */ private void cPutChess(int x,int y){ setRect(x,y)。 else RectY1=0。 // X 軸方向 for(i=RectX1,j=y。 k5。 k5。j++){ if([i][j]!=0){ continue。 continue。 } if([i][j+k]==0){ flag++。flag=0。 break。 } } n=weight(value,flag)。i+k=RectX2 amp。ik=RectX1 amp。 } } } /** * 返回棋子的權(quán)重 */ 連珠五子棋的編程與制作 共 31 頁,第 13 頁 private int weight(int count, int flag) { int weight=0。 else weight=0。 } } return weight。 } } for(int i=0。i15。 arr[x][y]=0。這樣既可以防守住對方巧妙地攻擊,又能待機發(fā)動反擊。 } else { chessBoard[i][j] = chessc[i 1][j 1]。 int i, j。 i 17。 } 連珠五子棋的編程與制作 共 31 頁,第 16 頁 if (tt[tempy 1][tempx] != 0) { uppersign = 0。 if (tt[tempy + 1][tempx] != side) { if (tt[tempy + 1][tempx] == 0) { downsign = 1。 if ( (uppersign + downsign) 0) { if ( (uppersign + downsign) == 2) { mark *= (uppersign + downsign)。 long mark = 0。 tx = x。 } if (tt[ty][tx] != 0) { uppersign = 0。 } if (tt[ty][tx] == 0) { downsign = 1。 } return mark。 int c_count = 1。 ty = y。 } 連珠五子棋的編程與制作 共 31 頁,第 20 頁 if (tt[ty][tx] == 0) { uppersign = 1。 while (tt[ty][tx] == side) { c_count += 1。 } } else if (c_count == 5) { mark *= 4。 int base = BASE。 j++) { tt[i][j] = chessBoard[i][j]。 while (tt[ty][tx] == side) { c_count += 1。 } if (tt[ty + 1][tx 1] != 0) { downsign = 0。 } } mark += pow(base, c_count)。 mark += analyseUd(x, y, side)。 int temp_chess[][] = new int[17][17]。 //標記出權(quán)重最大的點 MAX=MAX1=(225STEPCOUNTER)?MAX1:(225STEPCOUNTER)。 m++) { pq[m].mark = 0。 } for (m = 0。 break。 q++) { temp_chess[p][q] = chess[p][q]。 m++) { pq_temp[m] = new Queue()。 q MAX。 } public int puterDo(){ int position = 0。 } return position。 buf=new BufferedInputStream(file)。 } catch(Exception e){()。 AudioStream audio=new AudioStream(buf)。 BufferedInputStream buf。amp。 } } } pq_final = pq_temp[0]。 p MAX。 for (m = 0。 p++) { for (q = 0。 } pq[m].mark = mark。 j++) { if (chess[i][j] != 0) { mark = 0。 } 連珠五子棋的編程與制作 共 31 頁,第 24 頁 for (m = 0。 int MAX。 char s[] = new char[10]。 } return mark。 } if (tt[ty][tx] == 0) { downsign = 1。 ty = y。 } } else { tx += 1。 i++) { for (j = 0。 int tx, ty。 if ( (uppersign + downsign) 0) { if ( (uppersign + downsign) == 2) { mark *= (uppersign + downsign)。 } } else { tx += 1。 tx。 } } tt[y][x] = side。 int uppersign = 0。 } 連珠五子棋的編程與制作 共 31 頁,第 19 頁 else { mark = 0。 while (tt[ty][tx] == side) { c_count += 1。 連珠五子棋的編程與制作 共 31 頁,第 18 頁 tx。 j++) { tt[i][j] = chessBoard[i][j]。 } /** *判斷左右位置 */ private long analyseLr(int x, int y, int side){ int tt[][] = new int[17][17]。 } if (tt[tempy][tempx] != 0) { downsign = 0。 } } tempx = x。 tempy = y。 int c_count = 1。 } return result。 j = 16。 重新調(diào)用棋型表填寫算法對預測后的棋進行盤面分析,如果出現(xiàn)了“四三”、“雙三”或“雙四”等制勝點,那么己方就可以獲勝了;否則按照同樣的方法向下分析,就可以預測出第二步、 第三步等。 } } } x=temp[0]。 int swt=arr[0][0],tmp=0。j15。 else weight=0。 break。 } } n=weight(value,flag)。 break。flag=0。 } 連珠五子棋的編程與制作 共 31 頁,第 12 頁 if([i+k][j+k]==0){ flag++。 continue。i++,j++){ if([i][j]!=0){ continue。 k5。 k5。 } } //y軸方向 for(i=x,j=RectY1。i+kRectX2 amp。ik=Re
點擊復制文檔內(nèi)容
畢業(yè)設計相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1