<s> from Move import Move <EOL> class MoveNode : <EOL> def __init__ ( self , move , children , parent ) : <EOL> self . move = move <EOL> self . children = children <EOL> self . parent = parent <EOL> pointAdvantage = None <EOL> depth = <NUM_LIT:1> <EOL> def __str__ ( self ) : <EOL> stringRep = "<STR_LIT>" + str ( self . move ) + "<STR_LIT>" + str ( self . pointAdvantage ) + "<STR_LIT>" + str ( self . move . checkmate ) <EOL> stringRep += "<STR_LIT:\n>" <EOL> for child in self . children : <EOL> stringRep += "<STR_LIT:U+0020>" * self . getDepth ( ) * <NUM_LIT:4> <EOL> stringRep += str ( child ) <EOL> return stringRep <EOL> def __gt__ ( self , other ) : <EOL> if self . move . checkmate and not other . move . checkmate : <EOL> return True <EOL> if not self . move . checkmate and other . move . checkmate : <EOL> return False <EOL> if self . move . checkmate and other . move . checkmate : <EOL> return False <EOL> return self . pointAdvantage > other . pointAdvantage <EOL> def __lt__ ( self , other ) : <EOL> if self . move . checkmate and not other . move . checkmate : <EOL> return False <EOL> if not self . move . checkmate and other . move . checkmate : <EOL> return True <EOL> if self . move . stalemate and other . move . stalemate : <EOL> return False <EOL> return self . pointAdvantage < other . pointAdvantage <EOL> def __eq__ ( self , other ) : <EOL> if self . move . checkmate and other . move . checkmate : <EOL> return True <EOL> return self . pointAdvantage == other . pointAdvantage <EOL> def getHighestNode ( self ) : <EOL> highestNode = self <EOL> while True : <EOL> if highestNode . parent is not None : <EOL> highestNode = highestNode . parent <EOL> else : <EOL> return highestNode <EOL> def getDepth ( self ) : <EOL> depth = <NUM_LIT:1> <EOL> highestNode = self <EOL> while True : <EOL> if highestNode . parent is not None : <EOL> highestNode = highestNode . parent <EOL> depth += <NUM_LIT:1> <EOL> else : <EOL> return depth </s>
