一个简单的迷宫程序与C# [英] a simple maze program with C#

查看:56
本文介绍了一个简单的迷宫程序与C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想制作一个简单的迷宫程序。它会读取一个txt(txt包含1和0)

如果程序读取1会有墙,如果程序读数为0,则会有一扇门。

最后程序将显示从进入退出的方式。(最短的方式没有必要)



你能帮我吗?(紧急)


I want to make a simple maze program.It will read a txt(txt contains 1 and 0)
if program reads 1 there will be wall,if program reads 0, there will be a door.
At the end program will show a way from enter to exit.(shortest way not necessary)

can you help me?(emergency)

推荐答案

我们这里不做作业。我们会帮忙,但我们不会为你编写你的程序。

好​​的,我们把它分解成小块。



使用StreamReader类用于从文本文件中检索数据:从文本文件中读取。 [ ^ ]

将1和0放入一个数组(逐行):将字符串转换为字符数组。 [ ^ ]

遍历数组:通过arra迭代y。 [ ^ ]

使用最短路径解决迷宫: Maze Solver(最短路径查找器) [ ^ ]



与任何程序一样,这是一系列较小的问题需要解决,组装成更大的结构。学习将它们放在程序流程中正确的顺序或位置是编程的一个非常非常重要的部分。你需要学习这项技能,否则你将不会成为一名优秀的程序员。



现在开始,你几乎没有时间。
We don't do homework here. We will help, but we won't write your progam for you.
Ok, let’s break it down into smaller pieces.

Use the StreamReader class to retreive the data from your text file: Read from text file.[^]
Put the 1s and 0s into an array (line by line): Convert string to char array.[^]
Iterate through the arrays: Iterating through an array.[^]
Solve the maze using shortest path: Maze Solver (shortest path finder)[^]

As with any program, it is a series of smaller problems that need to be solved assembled into a larger structure. Learning to put them together in the right order or location in the program flow is a very, very important part of programming. You need to learn this skill or you will not become a good programmer.

Now get going, you have little time.


是的,我们可以帮到你。但是你应该自己开始编码并在这里询问具体问题。
Yes, we could help you. However you should start coding yourself and ask here just specific questions.


http://www.overclock.net/t/1370505/c-help-simple-maze-game [ ^ ]



http://msdn.microsoft.com/en-us/library/dd492162(v=vs。 110).aspx [ ^ ]



问候,

Praveen Nelge
http://www.overclock.net/t/1370505/c-help-simple-maze-game[^]

http://msdn.microsoft.com/en-us/library/dd492162(v=vs.110).aspx[^]

Regards,
Praveen Nelge


这篇关于一个简单的迷宫程序与C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆