作业帮 > 综合 > 作业

C++老鼠迷宫1.做了什么2.算法思路(程序框图)3.设计的类

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/15 09:39:07
C++老鼠迷宫
1.做了什么
2.算法思路
(程序框图)
3.设计的类
源程序如下:
#include
#include
#include
#include
using namespace std;
const int East = 0;
const int South = 1;
const int West = 2;
const int North = 3;
const int pause = 50; //老鼠走一步需要的毫秒数
class MouseMaze
{
public:
MouseMaze(int h,int w);
MouseMaze();
void display()const;
bool hasCrossOver();
private:
const int row;
const int col;
char **p;
void Init();
};
MouseMaze::MouseMaze(int h,int w):row(h),col(w){
p = new char *[row];
for (int i=0; i