Question: Can you send me the original code which I can Copy and paste, please. Thank you so much Plot Grid In this assignment, you will

Can you send me the original code which I can Copy and paste, please. Thank you so much

Plot Grid

In this assignment, you will write a function called plot_grid() which will take a grid, an iterable of open nodes, and an iterable of closed nodes. The grid will be of the format described in the first assignment of HW5. This function should print out a representation of the graph with a pipe (|, shift+\) on each side of each cell (only 1 between each cell). If the cell is in the closed set, print an x in it, if it is an open cell, print an o (lowercase letter o), if it is a wall, print w, and otherwise, print an underscore (_). Each row of the grid should be printed on its own line

Expected behavior:

graph = [

[0, 0, 1, 0, 0],

[0, 1, 1, 0, 0],

[0, 0, 0, 0, 0],

[0, 1, 1, 1, 0],

[0, 0, 0, 1, 0],

]

closed = {
(0, 0),
(0, 1), 

(1, 0),

(0, 2),

(0, 3),

} 

open_list = [

(1, 2), (0, 4),

]

plot_grid(graph, open_list, closed)

|x|x|w|_|_|

|x|w|w|_|_|

|x|o|_|_|_|

|x|w|w|w|_| 

|o|_|_|w|_|

#use this below

def plot_grid(graph, open_nodes, closed_nodes):

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!