if move not in [' '' '' '' ']print('invalid direction enter one of wasor 'continue check if the player can move in that directionif move ='wand maze[(playerxplayery )=emptybreak elif move ='sand maze[(playerxplayery )=emptybreak elif move ='aand maze[(playerx playery)=emptybreak elif move ='dand maze[(playerx playery)=emptybreak print('you cannot move in that direction 'keep moving in this direction until you encounter branch point if move =' 'while trueplayery - if (playerxplayery=(exitxexity)break if maze[(playerxplayery )=wallbreak break if we've hit wall if (maze[(playerx playery)=empty or maze[(playerx playery)=empty)break break if we've reached branch point elif move =' 'while trueplayery + if (playerxplayery=(exitxexity)break if maze[(playerxplayery )=wallbreak break if we've hit wall if (maze[(playerx playery)=empty or maze[(playerx playery)=empty)break break if we've reached branch point elif move =' 'while trueplayerx - if (playerxplayery=(exitxexity)break if maze[(playerx playery)=wallbreak break if we've hit wall if (maze[(playerxplayery )=empty or maze[(playerxplayery )=empty)break break if we've reached branch point elif move =' 'while trueplayerx + if (playerxplayery=(exitxexity)break if maze[(playerx playery)=wallbreak break if we've hit wall if (maze[(playerxplayery )=empty maze runner