Question: WRITE IN PYTHON:We now need to allow the Vacuuminator to move around the world. Write a function make _ move ( world , direction )

WRITE IN PYTHON:We now need to allow the Vacuuminator to move around the world. Write a function make_move(world, direction). The direction may be one of 'u','d','l', or 'r' as described on the Background slide. Your function return a list of lists representing the world after the move has been made.
Note that a move may not be possible either because:
It would take the Vacuuminator off the edge of the world
It would take the Vacuuminator into a wall
If an impossible move is requested, the Vacuuminator should not attempt to make it and should instead return the current state of the world.
Example Calls
>>> make_move([['E','W'],['E','X']],'l')
[['E','W'],['X','E']]
>>> make_move([['E','W'],['E','X']],'r')
[['E','W'],['E','X']]
>>> make_move([['E','W'],['E','X']],'u')
[['E','W'],['E','X']]

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 Programming Questions!