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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)課程設(shè)計迷宮算法的實現(xiàn)_java-wenkub.com

2025-08-03 22:13 本頁面
   

【正文】 主要使用了JAVA AWT包和JAVA SWING包。迷宮運行后如圖紅色數(shù)字部分為其中一條通路。走過的節(jié)點也算作障礙物,知道找到一條通路。 spider(row 1, col)。 // 左 (new Dimension(row, col 1))。 ()。 } // 向四個方向探測,順時鐘 else { // 標記已走過 map[row][col] = false。 } // 找到了 else if ( == row amp。 } // 慢慢走中。[0][0].setForeground(new Color(204, 52, 103))。 // 走完了 if (()) { // 標記正確路線 while (!()) { d = (Dimension) ()。 } // 根據(jù)stack_hasWalk、stack_route演示已經(jīng)的路和正確的路 private void printWalking() { ()。 stack_hasWalk = new Stack()。 = (map)。Timer timer = new Timer(, new ActionListener_Timer())。 // false 為障礙或已走過 private boolean map[][]。 * * 下面用遞歸實現(xiàn),實際上就是用了圖深度優(yōu)先遍歷 走過的格子直接標記為障礙 line 76: 入棧、入遞歸、出棧,為了保持現(xiàn)場,類似于Practice_2_3public class Walking { private int rows。import 。 } }}package 。 ()。 spider(row + 1, col)。 // 右 (new Dimension(row, col + 1))。 == col) { hasFound = true。 [][] .setText((count++))。 ( Bingo ! i find it ! so easy...)。 } if (!hasFound) { ( is there any way to go ? tell me !)。 ()。 spider(, )。 = begin。 } // 初始化,可自定義 起始位置、終點位置 public Walking(boolean[][] map, Dimension begin, Dimension goal) { rows = 。 private boolean hasFound = false。 private Dimension goal。import 。 }}3. Walking模塊package mg。 setSize(700, 400)。 ()。import .*。 setVisible(true)。 add(jPanel, )。 jPanel .setBorder(BorderFactory .createTitledBorder(走迷宮))。import 。 } else if (().equals(blank)) { ()。 (jButton_reset)。//從左到右設(shè)置按鈕 (jSlider)。 //jPanel_control = new JPanel(new FlowLayout())。 (new ActionListener_button())。 jButton_blank = new JButton(Blank)。 (move)。 (new ChangeListener() { public void stateChanged(ChangeEvent e) { = ((JSlider) ()).getValue()。 ()。 static JSlider jSlider。s MainUI /p * * pDescription: /p * * pDate: 20060831 /p */public class UI extends JPanel { private static final long serialVersionUID = 5924032800440919028L。import .*。 } else if (().equals(blank)) { ()。 (jButton_reset)。//從左到右設(shè)置按鈕 (jSlider)。 //jPanel_control = new JPanel(new FlowLayout())。 (new ActionListener_button())。 jButton_blank = new JButton(Blank)。 (move)。 (new ChangeListener() { public void stateChanged(ChangeEvent e) { = ((JSlider) ()).getValue()。 ()。 static JSlider jSlider。s MainUI /p * * pDescription: /p * * pDate: 20060831 /p */public class UI extends JPanel { private static final long serialVersionUID = 5924032800440919028L。import .*。 } } return out。 i row。 } (out, E:/)。 j cols。 for (int i = 0。 readBricks()。 j cols。 j++) { buttons[i][j].setSelected(brick[i][j])。 } // 根據(jù)brick[][]設(shè)置按鈕障礙 public static void setBricks() { for (int i = 0。 (buttons[i][j])。 i rows。 } } ( Move now?)。 j cols。 } // 去掉全部磚 public static void blank() { if (walking != null) { ()。 j cols。 } // 用于清楚已標記上的數(shù)字 public static void clean() { if (walking != null) { ()。 brick = copyBoolean(brick_reset)。 (true)。 (700, 400)。 jFrame = new JFrame( is there any way to go? Maze )。 static boolean[][] brick, brick_reset = { { true, true, true, true, true, false, true, true, true, true, true, true, true, true, }, { true, false, false, false, true, false, true, true, true, true, false, false, false, true, }, { true, false, true, false, true, false, false, false, false, true, true, false, true, true, }, { true, false, true, false, true, false, true, true, true, false, true, false, true, false, }, { true, true, true, false, false, false, true, false, true, false, true, false, true, true, }, { true, false, true, true, true, true, true, false, true, false, true, false, false, true, }, {
點擊復(fù)制文檔內(nèi)容
數(shù)學(xué)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1