Visual C++

Moderators: Lundin
Number of threads: 379
Number of posts: 695

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
I need an idea to start writting a program Posted by thedeath1990 on 16 Dec 2008 at 12:59 PM
There is a n*n matrix in this matrix it's a mouse and a cheese in this matrix and some of the cell of the matrix is blocked (random) know we want to find out if the mouse could reach the cheese or not if so showing the way what is the best way to find it in the minimum time.
n and the place of mouse and cheese will be given by the user.
I know so so about programing please don't use professional tools.
thanks for your guide.
Report
Re: I need an idea to start writting a program Posted by Lundin on 17 Dec 2008 at 12:24 AM
It sounds like you need a dynamically allocated two-dimensional matrix of "items", then randomize the output of the blocking cells. Then comes the tricky part of translating the matrix to some sort of graph, on which you can apply a shortest-path algorithm (Google for these unless you don't know one).
Report
Re: I need an idea to start writting a program Posted by thedeath1990 on 17 Dec 2008 at 7:35 AM
yes your right but it isn't important to find the shortest way just a way is enough I will thank you if you can tell me the way of realizing the way.
Report
Re: I need an idea to start writting a program Posted by Lundin on 18 Dec 2008 at 12:15 AM
If you just want to find the way you need Prim's algorithm which is pretty much equally complex as a shortest path algo, in terms of programming.
Report
Re: I need an idea to start writting a program Posted by thedeath1990 on 18 Dec 2008 at 8:38 AM
I will thank you if you give me a brief explanation about what's Prim number and how would it help me
thanks for your replies.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.