#NEWLINE# def getMove( self , legal ) : #NEWLINE# #INDENT# move = Directions . STOP #NEWLINE# if ( ( self . WEST_KEY in self . keys ) and ( Directions . WEST in self ) ) : #NEWLINE# #INDENT# move = Directions . WEST #NEWLINE# #UNINDENT# if ( ( self . EAST_KEY in self . keys ) and ( Directions . EAST in legal ) ) : #NEWLINE# #INDENT# move = Directions . EAST #NEWLINE# #UNINDENT# if ( ( self . NORTH_KEY in self . keys ) and ( Directions . NORTH in legal ) ) : #NEWLINE# #INDENT# move = Directions . NORTH #NEWLINE# #UNINDENT# if ( ( self . SOUTH_KEY in self . keys ) and ( Directions . SOUTH in legal ) ) : #NEWLINE# #INDENT# move = Directions . SOUTH #NEWLINE# #UNINDENT# return move