Answered step by step
Verified Expert Solution
Question
1 Approved Answer
def find_land(map, r, c, dir): Given a map and location, as well as a direction to look (one of [N,NE,E,SE,S,SW,W,NW]), indicate how many spaces we
def find_land(map, r, c, dir): Given a map and location, as well as a direction to look (one of ["N","NE","E","SE","S","SW","W","NW"]), indicate how many spaces we must travel on the map to reach land. If we're on land, the answer is zero. If there's no land in that direction on this map, we return None. Assume: map is a map as defined above, r and c are int values, and dir is one of the strings above. find_land(map4,2,2,"S") 2 find_land(map4,4,1,"NE") None find_land(map5,7,0,"N") 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started