Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

Explain walter's model of dividend policy.

Answered: 1 week ago

Question

5. Arranging for the training facility and room.

Answered: 1 week ago