mazeworld.java
来自「控制移到机器人的例子程序」· Java 代码 · 共 32 行
JAVA
32 行
import java.lang.*;
import java.util.*;
import java.io.*;
/* leave the Serializable comment in here. In a week, you'll use it to read and write
MazeWorlds as files!!!! */
public class MazeWorld extends java.lang.Object implements Serializable
{
static final long serialVersionUID = 112;
public int maze[][][];
public int height; /* aligned with north, direction 0 */
public int width;
public Vector inits; /* each state is an array: {x,y,direction} */
public Vector goals;
public int maxDepth; /* max depth to which you should search */
/* constructor: give it a maze to create a mazeworld */
public MazeWorld(int maze[][][]) {
this.maze = maze;
this.inits = new Vector();
this.goals = new Vector();
}
/* another constructor: give it a maze and the inits and goals */
public MazeWorld(int maze[][][], Vector inits, Vector goals) {
this.maze = maze;
this.inits = (Vector) inits.clone();
this.goals = (Vector) goals.clone();
}
} /* end of class MazeWorld */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?