文件名称:maze
介绍说明--下载内容来自于网络,使用问题请自行百度
完成迷宫程序的设计
输入
从maze.txt文件读入迷宫,格式如下
其中第一行为迷宫的阶数N,接下来是一个N*N的矩阵代表迷宫,0为路径,1为障碍物。
实验要求
要求自学查询技术文档,利用STL 的stack 类,完成以下要求的功能:
1. 打印迷宫: DisplayMaze()或者重载<<
其中(1,0)位置和(N-2,N-1)位置打印“=>,其余的1的位置打印“##”,0的位置打印“ ”(两
个空格),注意每个位置都是两个字符。
打印示例:
2. 寻找走出迷宫的路径并输出 FindPath()
输出格式为:
(1,1)->(2,1)->(2,2)->……
并输出需要的步数。
3. 动态打印走迷宫的路径 WalkPath()
动态显示出走出迷宫的过程,每一次移动时都相应地修改显示状态。为了能让用户看清显示过程,必须使代码减速,做到大约每秒钟移动一次。为此,可在代码中插入等待语句,每次等待0.25秒的时间,即每秒钟走’4步。
你可能用到的语句:
Sleep(250) 程序睡眠(in <windows.h>)
system(“cls”) 清屏-Completed the design of the maze procedure
Enter
From maze.txt file read into the maze, the following format
Wherein the first maze behavior order N, followed by a N* N matrix representing maze, path 0, and 1 is an obstacle.
Experimental requirements
Requires self-query technical documentation, use of STL stack class, complete the following requirements:
Print maze: DisplayMaze or overloaded <<
Wherein the position of the (1,0) and position (N-2, N-1) Print "=> the rest position 1 Print"## ", the print position" (two
Space), pay attention to each location are two characters.
Print examples:
Looking out of the labyrinth the path and the output FindPath ()
The output format is:
(1,1)-> (2,1)-> (2,2)-> ......
And output the number of steps required.
3 Print dynamic Maze the path WalkPath (and)
Dynamic display out of the labyrinth, every move to modify the display. Order to allow the user to see the display process, you must make the code deceleration do ab
输入
从maze.txt文件读入迷宫,格式如下
其中第一行为迷宫的阶数N,接下来是一个N*N的矩阵代表迷宫,0为路径,1为障碍物。
实验要求
要求自学查询技术文档,利用STL 的stack 类,完成以下要求的功能:
1. 打印迷宫: DisplayMaze()或者重载<<
其中(1,0)位置和(N-2,N-1)位置打印“=>,其余的1的位置打印“##”,0的位置打印“ ”(两
个空格),注意每个位置都是两个字符。
打印示例:
2. 寻找走出迷宫的路径并输出 FindPath()
输出格式为:
(1,1)->(2,1)->(2,2)->……
并输出需要的步数。
3. 动态打印走迷宫的路径 WalkPath()
动态显示出走出迷宫的过程,每一次移动时都相应地修改显示状态。为了能让用户看清显示过程,必须使代码减速,做到大约每秒钟移动一次。为此,可在代码中插入等待语句,每次等待0.25秒的时间,即每秒钟走’4步。
你可能用到的语句:
Sleep(250) 程序睡眠(in <windows.h>)
system(“cls”) 清屏-Completed the design of the maze procedure
Enter
From maze.txt file read into the maze, the following format
Wherein the first maze behavior order N, followed by a N* N matrix representing maze, path 0, and 1 is an obstacle.
Experimental requirements
Requires self-query technical documentation, use of STL stack class, complete the following requirements:
Print maze: DisplayMaze or overloaded <<
Wherein the position of the (1,0) and position (N-2, N-1) Print "=> the rest position 1 Print"## ", the print position" (two
Space), pay attention to each location are two characters.
Print examples:
Looking out of the labyrinth the path and the output FindPath ()
The output format is:
(1,1)-> (2,1)-> (2,2)-> ......
And output the number of steps required.
3 Print dynamic Maze the path WalkPath (and)
Dynamic display out of the labyrinth, every move to modify the display. Order to allow the user to see the display process, you must make the code deceleration do ab
(系统自动生成,下载前可以参看下载内容)
下载文件列表
maze.txt
实验五.cpp
实验五.pdf
实验五.cpp
实验五.pdf
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.