C语言迷宫程序代码 具有自动生成迷宫、自动输出路径的功能
2021-05-16 14:53:36 5KB 迷宫 C 代码
1
首先采用三种方式实现了栈结构,其次采用工厂模式根据子类创建对象,最后实现迷宫。完整已测试。
2021-05-13 19:28:45 188KB 迷宫
1
首先实现一个以链表做存储结构的栈类型,然后编写一个求解迷宫的非递归程序。求得的通路以三元组(i,j,d)的形式输出,其中:(i,j)指示迷宫中的一个坐标,d表示走到下一坐标的方向。如:对于下列数据的迷宫,输出的一条通路为:(1,1,1),(1,2,2),(2,2,2),(3,2,3),(3,1,2)……
2021-05-13 16:08:10 227KB c语言 迷宫
1
数据结构 严蔚敏 C语言版 迷宫 status mazePath(seqStack *S, posType start, posType end) { posType curPos; //current positon int curStep; //the ordinary number sElemType e; curPos = start; curStep = 1; do { if(pass(curPos)) //the current position is "accessed" { footPrint(curPos); e.ord = curStep; e.seat = curPos; e.di = 1; push(S, e); if(curPos.xPos == end.xPos && curPos.yPos == end.yPos) { return OK; //arrive at the final } curPos = nextPos(curPos, 1); curStep++; }//end of if(pass(curPos)) else //the current position is not "accessed" { if(!stackEmpty(*S)) //the stack is not empty { pop(S,&e); while(e.di == 4 && !stackEmpty(*S)) { markPrint(e.seat); //the current position must be marked by '#' pop(S,&e); }//end while if(e.di < 4) { e.di++; push(S,e); curPos = nextPos(e.seat, e.di); } }//end of if(!stackEmpty(*S)) }//end of else }while(!stackEmpty(*S)); }
2021-05-11 17:09:14 2KB 数据结构 严蔚敏 C语言版 迷宫
1
使用c语言制作的迷宫小游戏,图像界面使用的是easyx,游戏可以选择难度,有记录时间功能,暂停,刷新地图,可以通过拾取金币直接通关提示,同时设有排行榜。
2021-05-11 12:03:09 2.3MB c语言 课设
1
初学数据结构和C语言,尝试实现了迷宫求解问题。代码组织比较差,改进的地方也有很多,博君一乐而已。希望能够帮助到别人
2021-04-16 21:26:04 17KB 迷宫求解 非递归 栈操作
1
C语言走迷宫源码
2021-04-15 09:04:21 4KB C语言走迷宫源码
运用链表动态申空间,前插法模仿栈,两种算法实现.
2021-04-05 16:27:20 238KB C语言 数据结构 递归 回逆
1
在一个一元数组中用1和0表示迷宫的各个路线连通情况,1表示可以通,0表示不通。有实验报告。
2021-04-04 21:51:56 76KB C语言 迷宫程序
1
C++ BFS迷宫.cpp
2021-03-27 20:10:14 906B c++
1