0% found this document useful (0 votes)
32 views

Vimarshana Miniproject

The document describes a mini-project to represent a maze as a 10x10 array populated with 100 input values of -1 or 0, with the first and last being 0. Values of 0 represent open cells and -1 represent blocked cells. The problems are to: 1) Find and print a path from the start cell [1,1]/[0][0] to the end cell [10,10]/[9][9] 2) Find and print ALL paths from start to end 3) Find and print the SHORTEST path from start to end

Uploaded by

Louis Walker
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Vimarshana Miniproject

The document describes a mini-project to represent a maze as a 10x10 array populated with 100 input values of -1 or 0, with the first and last being 0. Values of 0 represent open cells and -1 represent blocked cells. The problems are to: 1) Find and print a path from the start cell [1,1]/[0][0] to the end cell [10,10]/[9][9] 2) Find and print ALL paths from start to end 3) Find and print the SHORTEST path from start to end

Uploaded by

Louis Walker
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Mini-Project:

(Note: Do the following in C or in vTalk... your choice)

Declare a 10 x 10 array. This is supposed to represent a maze puzzle


data.
Read 100 values from input. (You can develop the algorithm to solve
for 4x4 array first and then change the size and the input)
Each value will be -1 or 0. The first and the last value must be 0
(read below to know why).
0 means that cell is open.
-1 means that cell is blocked.

e.g. for a 4x4 array the input can be:


0 -1 -1 -1
0 0 0 -1
-1 0 0 -1
-1 -1 0 0

Problem-1: Find and print a path from the start-cell { [1,1] in vTalk
or [0][0] in C } to the end-cell { [10,10] in vTalk or [9][9] in C }.

Problem-2: Find ALL paths from the Start-cell to the End-cell.

Problem-3: Find and print the shortest path from the Start to End-
cell.

Hint: A path can be printed by printing the input array as it is with


the path can been shown in it by using numbers from 1, 2, 3, ... etc
to indicate which cell to goto first, second, third etc. on the path.
E.g.
0 -1 -1 -1
1 2 3 -1
-1 0 4 -1
-1 -1 5 6

You might also like