Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

I need an idea to start writting a program

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.

Comments

  • LundinLundin Posts: 3,711Member
    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).
  • thedeath1990thedeath1990 Posts: 5Member
    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.
  • LundinLundin Posts: 3,711Member
    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.
  • thedeath1990thedeath1990 Posts: 5Member
    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.
Sign In or Register to comment.