Question: def is_open_pos(grid, pos): Determine if a position tuple ( pos ) on a grid is open or not. For a position to be open, it

def is_open_pos(grid, pos): Determine if a position tuple ( pos ) on a grid is open or not. For a position to be open, it must be a valid place on the grid and also set to None .

? Return value: A boolean indicating if the pos is currently open

? Assumptions and Notes: Same as is_valid_pos(( ) .

? Examples: in the following examples,, assume g = [ " J " , None , None], [ " J " , " J " , " J " ]

o is_open_pos (g, ( - 1,0)) ? False # ( - 1,0) is outside the world

o is_open_pos (g, (11,0)) ? True # column 1 in row 0 is set to None

o is_open_pos (g, (00,1)) ? False # column 0 in row 1 is set to " J "

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!