//迷宫类相关
【相关文章:《Effective Java》读书笔记】using system; 【扩展阅读:语音识别系统,你试过了吗?】
【扩展信息:哲学家就餐问题的C#实现】using system.drawing;using system.drawing.drawing2d; using system.collections;namespace mazedemo
{ /// <summary> /// 迷宫类 /// </summary> public class cmaze { bool[,] mg; //地图格子 stack stack; //堆栈 point in_p; //入口点 point out_p; //出口点 point start_p; //绘制迷时候的起始点 size boxsize; //每个格子的大小 int step_count; //共走多少步public cmaze()
{ stack=new stack(); this.start_p=new point(0,0); this.boxsize=new size(50,50); step_count=0; }public cmaze(bool[,] _mg):this()
{ this.mg=_mg; }public cmaze(bool[,] _mg,point _in,point _out):this()
{ this.mg=_mg; this.in_p=_in; this.out_p=_out; stack way=this.test(this.in_p,_in); stack.push(new ccoor(this.in_p,way)); this.step_count++; } /// <summary> /// 绘制迷宫时窗口的起始坐标 /// </summary> public point startpoint { set{this.start_p=value;} get{return this.start_p;} }/// <summary>
/// 当前迷宫共走多少步 ... 下一页