Create a new Python file entitled map.py. In that file, create a class called GridMap. Its constructor should start like the code below:
map.py
GridMap
class GridMap: def __init__(self, height: int, width: int, num_obstacles: int): self.height = height self.width = width
num_obstacles
is_open(self, row: int, col: int) -> bool
True
row
col
False
draw(self, stdscr)
stdscr.addstr
*
.
curses
main()
height, width = stdscr.getmaxyx() grid_map = GridMap(height - 1, width - 1, 50)
q
grid_world.py
grid_world_2.py
def blocked_ahead(pose: RobotPose, grid_map: GridMap) -> bool: """ Returns True if the square ahead of pose is not open. """ # Your code here
pose
RobotPose
move
import copy
copy.deepcopy()
w
blocked_ahead()
def right_move(pose: RobotPose, grid_map: GridMap): """ Turns right if blocked; otherwise drives forward. """ # Your code here
turn()
move()
right_move()
x
z
c