資源簡介
完全原創迷宮求解
借助棧實現
類C書寫
借助棧實現
類C書寫
代碼片段和文件信息
typedef????struct
{
????int???XY;???????????????????????????//表示點的方位
????int???Live;?????????????????????????//Live=1該點可走,Live=0該點不可走
????int???direction=10;?????????????????//direction?表示當前點探索的方向direction?初始10表示該點未探索任何方向
????int???count=1;??????????????????????//count表示當前點探索方向次數
}frame????frame[M*N];
typedef????struct
{
????int????self;????????????????????????????????//self表示點的探索方向North,South,West,East
????int????next;
}MoveDirection????MD[4];
Status????InitMoveDirection(MD)???????????????//North=0South=1West=2East=3
{
????for(k=0;k<=2;k++)
????{
????????MD[k].self=k;
????????MD[k].next=k+1;
????}
????MD[3].self=3;
????MD[3].next=0;
????return?ok;
}
int????Transform(int?Gone)??????????????????????//轉變方向
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2497??2010-02-04?23:28??mazepath.c
-----------?---------??----------?-----??----
?????????????????2497????????????????????1
- 上一篇:VS2010之MFC入門到精通教程
- 下一篇:Keil+C51程序
評論
共有 條評論