return """ computer_first = False pygame.mixer.pre_init(44100, 16, 2, 4096) pygame.init() boardWindow = BoardWindow(computer_first) boardPhase = MCTSBoardPhase() #boardPhase = BoardPhase() boardWindow.drawBoard(boardPhase) chessEngine = ChessEngine(3) stop = False train_flag = True while True: if train_flag: pygame.event.pump() ret = boardWindow.computer_move(boardPhase, chessEngine) if not ret: boardPhase.reset() else: if computer_first and boardPhase.getSide() == 0 and not stop: if not boardWindow.computer_move(boardPhase, chessEngine): stop = True game_input(pygame.event.get(), boardWindow, boardWindow, chessEngine) boardWindow.drawBoard(boardPhase) pygame.display.flip() if train_flag: log.info('save engine param.') chessEngine.save()