Question: PYTHON A maze can be defined as a 2 dimensional matrix. Values 0 in the matrix represent the walkable zone, 1 their values represent the

PYTHON

A maze can be defined as a 2 dimensional matrix. Values 0 in the matrix represent the walkable zone, 1 their values represent the walls.You start walking from the upper left corner of the maze and which turns whether a walk you plan to get out of the lower right corner will take place Write the function (True or False).

For Example

is_exit([ [0, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1, 1], [1, 1, 1, 1, 0, 0, 1], [1, 1, 1, 1, 1, 0, 0] ]) true

is_exit([ [0, 1, 1, 1, 1, 1, 1], [0, 0, 1, 0, 0, 1, 1], [1, 0, 0, 0, 0, 1, 1], [1, 1, 0, 1, 0, 0, 1], [1, 1, 0, 0, 1, 1, 1] ]) false

* Ask the user for the number of rows and columns of the maze and their values.

* Check that the values are 0 or 1.

* You don't need to use any smart algorithms for this question.

* You can perform a rule-based check by trying the possibilities.

Hint: Your labyrinth is mxn in size and when you start walking at point [0,0], exit is at point [m-1, n-1] will be.

PYTHON A maze can be defined as a 2 dimensional matrix. Values

asus@asus-X550VX :-/Masast/homework/hw3$ python3 3 4 0 1 1 0 1 1 1 true asus@asus-X550VX:-/Masast/homework/hw3$ python3 7 9 @ 1 1 1 0 0 1 0 1 @ 0 1 1 1 1 1 1 1 0 0 0 0 1 1 @ 1 1 1 1 1 @ @ 0 0 0 0 1 1 1 1 1 @ 1 0 1 1 0 0 0 1 1 1 0 false @ asus@asus -X550VX:-/Masast/homework/hws$ python3 Q 4 6 1 1 1 0 0 6 1 1 1 0 0 D 0 1 1 3 1 0 0 invalid 1 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!