文件名称:maze

  • 所属分类:
  • 数据结构常用算法
  • 资源属性:
  • [C/C++] [源码]
  • 上传时间:
  • 2013-05-28
  • 文件大小:
  • 202kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • l*
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

完成迷宫程序的设计

从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

迷宫

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org