文件名称:maze
-
所属分类:
- 标签属性:
- 上传时间:2013-05-28
-
文件大小:202.38kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
完成迷宫程序的设计
从maze.txt文件读入迷宫。格式如下:
其中第一行为迷宫的阶数N,接下来是一个N*N的矩阵代表迷宫,0为路径,1为
障碍物。
实验要求 :
1. 打印迷宫: DisplayMaze()或者重载<<
其中(1,0)位置和(N-2,N-1)位置打印“=>,其余的1的位置打印“##”,0的位置
打印“ ”(两个空格),注意每个位置都是两个字符。
打印示例:
2. 寻找走出迷宫的路径并输出 FindPath()
输出格式为: (1,1)->(2,1)->(2,2)->…… 并输出需要的步数。
3. 动态打印走迷宫的路径 WalkPath()
动态显示出走出迷宫的过程,每一次移动时都相应地修改显示状态。为了能让用
户看清显示过程,必须使代码减速,做到大约每秒钟移动一次。为此,可在代码中插入等待语句,每次等待0.25秒的时间,即每秒钟走’4步。-Program is designed to complete the maze from maze.txt file is read into the maze. Format is as follows: The first act of the maze order N, followed by an N* N matrix represents the maze, 0 is the path, one of obstructions. Experimental requirements: 1. Printing Maze: DisplayMaze () or overloaded < < where (1,0) position and the (N-2, N-1) Location Print " => the rest of the 1 position print" ## " 0 position print " " (two spaces), note that each position is two characters. printing examples: 2. Looking out of the maze of paths and output FindPath () output format: (1,1)-> (2 , 1)-> (2,2)-> ...... and outputs the number of steps required. 3 Print Maze dynamic path WalkPath () shows the dynamic process of the maze, and each time when they move accordingly modify the display status In order to allow users to see the display process, you must make the code deceleration, so about once every second move this end, the wait can be inserted in the code st
从maze.txt文件读入迷宫。格式如下:
其中第一行为迷宫的阶数N,接下来是一个N*N的矩阵代表迷宫,0为路径,1为
障碍物。
实验要求 :
1. 打印迷宫: DisplayMaze()或者重载<<
其中(1,0)位置和(N-2,N-1)位置打印“=>,其余的1的位置打印“##”,0的位置
打印“ ”(两个空格),注意每个位置都是两个字符。
打印示例:
2. 寻找走出迷宫的路径并输出 FindPath()
输出格式为: (1,1)->(2,1)->(2,2)->…… 并输出需要的步数。
3. 动态打印走迷宫的路径 WalkPath()
动态显示出走出迷宫的过程,每一次移动时都相应地修改显示状态。为了能让用
户看清显示过程,必须使代码减速,做到大约每秒钟移动一次。为此,可在代码中插入等待语句,每次等待0.25秒的时间,即每秒钟走’4步。-Program is designed to complete the maze from maze.txt file is read into the maze. Format is as follows: The first act of the maze order N, followed by an N* N matrix represents the maze, 0 is the path, one of obstructions. Experimental requirements: 1. Printing Maze: DisplayMaze () or overloaded < < where (1,0) position and the (N-2, N-1) Location Print " => the rest of the 1 position print" ## " 0 position print " " (two spaces), note that each position is two characters. printing examples: 2. Looking out of the maze of paths and output FindPath () output format: (1,1)-> (2 , 1)-> (2,2)-> ...... and outputs the number of steps required. 3 Print Maze dynamic path WalkPath () shows the dynamic process of the maze, and each time when they move accordingly modify the display status In order to allow users to see the display process, you must make the code deceleration, so about once every second move this end, the wait can be inserted in the code st
(系统自动生成,下载前可以参看下载内容)
下载文件列表
迷宫/maze.txt
迷宫/迷宫.cpp
迷宫/迷宫.pdf
迷宫
迷宫/迷宫.cpp
迷宫/迷宫.pdf
迷宫
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.