#NEWLINE# def isTerminal( self , s = None ) : #NEWLINE# #INDENT# if ( s is None ) : #NEWLINE# #INDENT# s = self . state #NEWLINE# #UNINDENT# if ( self . map [ ( s [ 0 ] , s [ 1 ] ) ] == self . GOAL ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if ( self . map [ ( s [ 0 ] , s [ 1 ] ) ] == self . PIT ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# return False