#define MAZE_LENGTH 8
#define MAZE_WIDTH 8
#define NORTH 3
#define SOUTH 1
#define WEST 4
#define EAST 2
#define START 3
#define END 4
class CreatMap{
public:
CreatMap();
int get_point_map(int ,int ) const;
int get_point_history(int ,int) const;
void write_point_history(int ,int);
int get_point_direction(int ,int) const;
void write_point_direction(int ,int ,int);
private:
static int map_point[MAZE_LENGTH][MAZE_WIDTH];
static int map_history[MAZE_LENGTH][MAZE_WIDTH];
static int map_direction[MAZE_LENGTH][MAZE_WIDTH];
};
int CreatMap::map_point[MAZE_LENGTH][MAZE_WIDTH]=
{{START,0,1,0,0,0,1,0},{0,0,1,0,0,0,1,0},{0,0,0,0,1,1,0,0},{0,1,1,1,0,0,0,0},{0,0,0,1,0,0,0,0},{0,1,0,0,0,1,0,0},{0,1,1,1,0,1,1,0},{1,0,0,0,0,0,0,END}};
int CreatMap::map_history[MAZE_LENGTH][MAZE_WIDTH]={0};
int CreatMap::map_direction[MAZE_LENGTH][MAZE_WIDTH]={0};
CreatMap::CreatMap()
{
}
int CreatMap::get_point_map(int x,int y) const
{
return map_point[x][y];
}
int CreatMap::get_point_history(int x, int y) const
{
return map_history[x][y];
}
void CreatMap::write_point_history(int x, int y)
{
map_history[x][y]=1;
}
int CreatMap::get_point_direction(int x, int y) const
{
return map_direction[x][y];
}
void CreatMap::write_point_direction(int x, int y, int direction)
{
if(direction!=NORTH||direction!=SOUTH||direction!=WEST||direction!=EAST) exit(1);
map_direction[x][y]=direction;
}