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

正文內(nèi)容

java課程設計--騎士游歷程序的開發(fā)-資料下載頁

2025-06-05 10:24本頁面
  

【正文】 { return xpos[ arrayPos ]。 } public int getYpos(){ return ypos[ arrayPos ]。 } public int getAccessibility(){ return accessibility[ arrayPos ]。 } public int getTotalAccessible(){ return countAccessibility。 } //冒泡排序法 .冒泡排序的基本概念是:依次比較相鄰的兩個數(shù),將大數(shù)放在前面,小數(shù)放在后面。 private void sortAll (){ for ( int begin = 0 。 begin countAccessibility 1 。 begin ++ ){ for ( int i = begin + 1。 i countAccessibility 。 i ++ ){ if ( accessibility [ begin ] accessibility [ i ] ){ 22 swapAll( begin, i )。 }//end of if }// end of inner for }// end of outer for }// end of sortAll //交換兩個數(shù) private void swapAll ( int i , int j ){ int temp 。 temp = xpos [ i ]。 xpos [ i ] = xpos [ j ]。 xpos [ j ] = temp。 temp = ypos [ i ]。 ypos [ i ] = ypos [ j ]。 ypos [ j ] = temp。 temp = accessibility [ i ]。 accessibility [ i ] = accessibility [ j ]。 accessibility [ j ] = temp。 } //進行移動操作 public void domoving(){ for ( int i = 0 。 i countAccessibility 。 i ++ ){ [ xpos [i] ][ ypos[i] ] 。 } //直到?jīng)]有路徑了 [ ownxpos ][ ownypos ] = 0 。 } //撤消移動操作 public void undomoving(){ for ( int i = 0 。 i countAccessibility 。 i ++ ){ [ xpos [i] ][ ypos[i] ] ++ 。 } [ ownxpos ][ ownypos ] = ownAccessibility 。 } } //MyPanel函數(shù)實現(xiàn)圖形化顯示結果 class MyPanel extends JPanel { /** * */ private static final long serialVersionUID = 1L。 public static final int WHITE = 0 。//用于顯示棋盤 public static final int BLACK = 1 。 public static final int WKNIGHT = 2 。//用于顯示騎士 public static final int BKNIGHT = 3 。 private int chessboard[][]。 private int xrecord [] 。 private int yrecord [] 。 private int displayCount 。 private int lastxpos ,lastypos ,nextxpos ,nextypos 。 ImageIcon images[] 。 public MyPanel() {//MyPanel構造函數(shù) initvariance()。 23 } public MyPanel( int [] newxrecord ,int [] newyrecord ) {//重載構造函數(shù) initvariance()。 initboard( newxrecord , newyrecord )。 } public void initvariance () { chessboard = new int[ 8 ][ 8 ]。 xrecord = new int [ 64 ] 。 yrecord = new int [ 64 ]。 images = new ImageIcon [ 4 ]。 images[ 0 ] = new ImageIcon( )。 images[ 1 ] = new ImageIcon( )。 images[ 2 ] = new ImageIcon( )。 images[ 3 ] = new ImageIcon( )。 } //畫棋盤 ,給棋盤上色 public void initboard ( int [] newxrecord ,int [] newyrecord ){ displayCount = 1 。 for (int row = 0 。 row 8 。row ++){ for ( int column = 0 。 column 8 。 column ++ ){ //0 表示白的, 1 表示黑的 chessboard [ row ][ column ] = ( row + column ) % 2 。 } }//end of outer for for ( int row = 0 。 row newxrecord .length 。 row ++ ) { xrecord [ row ] = newxrecord [ row ] 。 yrecord [ row ] = newyrecord [ row ] 。 } displayCount = 0 。 chessboard [ xrecord [ displayCount ] ][ yrecord [ displayCount ] ] += 2 。 }//end of initboard public void showNext() { if ( displayCount 1 ){ displayCount ++ 。 chessboard [ xrecord [ displayCount ] ][ yrecord [ displayCount ] ] += 2 。 repaint()。 } } public void paintComponent ( Graphics g ) { //用于顯示 運行時態(tài)的顏色 for (int row = 0 。 row 8 。row ++){ for ( int column = 0 。 column 8 。 column ++ ){ images[ chessboard[ row ][ column ] ].paintIcon( this , g, 40 * row,40 * column )。 }//end of inner for }//end of outer for if ( displayCount 0 ){ 24 lastxpos = xrecord [ displayCount 1]。 lastypos = yrecord [ displayCount 1]。 nextxpos = xrecord [ displayCount ]。 nextypos = yrecord [ displayCount ]。 ( )。 ( 40 * xrecord [ displayCount 1 ] + 2, 40 * yrecord [ displayCount 1 ] + 2, 36, 36 )。 ( )。//剛走過的步顯示為綠色 ( 40 * xrecord [ displayCount ] + 2 , 40 * yrecord [ displayCount ] + 2, 36, 36 )。 ( )。//當前步顯示為藍色 ( 40 * ( nextxpos, lastxpos ), 40 * ( nextypos, lastypos ), ( ( nextxpos lastxpos ) + 1 ) * 40, ( ( nextypos lastypos ) + 1 ) * 40 )。 }//end of if ( )。//起始位置顯示為紅色 ( 40 * xrecord [ 0 ] + 2,40 * yrecord [ 0 ] + 2, 36, 36 ) 。 }// end of the method paintComponent }
點擊復制文檔內(nèi)容
畢業(yè)設計相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1