?? maze.java
字號:
public class Maze {
private MazeElement[][] element = new MazeElement[10][10];
public Maze(){
}
public Maze(String[] s){
for(int y = 0; y < 10; y++){
for(int x = 0; x < 10; x++){
element[y][x] = new MazeElement(s[y].charAt(x)=='1');
}
}
}
public MazeElement GetElement(int x, int y){
return element[y][x];
}
public void FoodPrint(int x, int y){
element[y][x].visited = true;
}
public void reset(){
for(int y = 0; y < 10; y++){
for(int x = 0; x < 10; x++){
element[y][x].visited = false;
}
}
}
}
class MazeElement{
public boolean visited = false;
public boolean iswall;
public MazeElement(){
iswall = false;
}
public MazeElement(boolean w){
iswall = w;
}
public void FoodPrint(){
visited = true;
}
}
class Posetion{
public int x;
public int y;
public Posetion(){
x = 0;
y = 0;
}
public Posetion(int a, int b){
x = a;
y = b;
}
public String toString(){
return "("+x+","+y+")";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -