py/arena.py
def log_draw_reason(self):
        '''Logs the reason of a draw for manual inspection'''

        if self.board.is_stalemate(): 
            reason = 'Stalemate.'
        elif self.board.is_insufficient_material(): 
            reason = 'Insufficient material.', 
        elif self.board.is_seventyfive_moves(): 
            reason = 'Seventyfive moves without capture or pawn move.'
        elif self.board.is_fivefold_repetition(): 
            reason = 'Fivefold repetition.'
        else:
            reason = 'Unknown reason for draw?'

        log_entry = {
            'reason': reason,
            'move_stack': ','.join([str(move) for move in self.board.move_stack])
        }

        with open('../log/%i_draw' % self.game_count, 'w') as f:
            f.write(json.dumps(log_entry, indent=4))
Logs the reason of a draw for manual inspection
Logs the reason of a draw for manual inspection
Logs the reason of a draw for manual inspection
def log_draw_reason(self):
        if self.board.is_stalemate(): 
            reason = 'Stalemate.'
        elif self.board.is_insufficient_material(): 
            reason = 'Insufficient material.', 
        elif self.board.is_seventyfive_moves(): 
            reason = 'Seventyfive moves without capture or pawn move.'
        elif self.board.is_fivefold_repetition(): 
            reason = 'Fivefold repetition.'
        else:
            reason = 'Unknown reason for draw?'
        log_entry = {
            'reason': reason,
            'move_stack': ','.join([str(move) for move in self.board.move_stack])
        }
        with open('../log/%i_draw' % self.game_count, 'w') as f:
            f.write(json.dumps(log_entry, indent=4))
def log_draw_reason ( self ) : if self . board . is_stalemate ( ) : reason = 'Stalemate.' elif self . board . is_insufficient_material ( ) : reason = 'Insufficient material.' , elif self . board . is_seventyfive_moves ( ) : reason = 'Seventyfive moves without capture or pawn move.' elif self . board . is_fivefold_repetition ( ) : reason = 'Fivefold repetition.' else : reason = 'Unknown reason for draw?' log_entry = { 'reason' : reason , 'move_stack' : ',' . join ( [ str ( move ) for move in self . board . move_stack ] ) } with open ( '../log/%i_draw' % self . game_count , 'w' ) as f : f . write ( json . dumps ( log_entry , indent = 4 ) )
Logs the reason of a draw for manual inspection
Logs the reason of a draw for manual inspection
'''Logs the reason of a draw for manual inspection'''
self