these two task are all about \"maze\" exploring.. i have done the first three pa
ID: 3641347 • Letter: T
Question
these two task are all about "maze" exploring..i have done the first three parts those where about load maze, Getting an Adjacent Position and Make a Move.
but caouldnt go anyfurther with these two tasks:
2.2.4 Where can I go
get_legal_directions(maze, position) takes, as arguments, the maze
(as a list of lists) and a position of a square and returns a list of legal directions
for that square. You may assume the given position is legal.
For example:
>>> maze = load_maze('maze1.txt')
>>> get_legal_directions(maze, (2,1))
['N', 'S']
>>> get_legal_directions(maze, (3,1))
['N', 'E']
>>>
2.2.5 Check the Command
is_valid_command(command) takes a string of length one and returns True
if and only if the given command is one of the allowed commands. For
example:
>>> is_valid_command('A')
False
>>> is_valid_command('?')
True
>>>