diff --git a/gui/gui_app.py b/gui/gui_app.py index f68ec3c..4aa7880 100644 --- a/gui/gui_app.py +++ b/gui/gui_app.py @@ -2,6 +2,7 @@ from functools import partial from itertools import cycle, chain +from engine.uct import uct_multi from gui.gui_board import * @@ -90,6 +91,9 @@ def click_random_cell(self): self.subcell_clicked(random_cell) time.sleep(0.2) # sleep 1s so output can be checked + def get_best_engine_move(self): + print(uct_multi(self.board, itermax=10000, verbose=False)) + def do_nothing(self): pass # todo remove this later @@ -99,7 +103,7 @@ def get_game_input(self, game_type, mouse_pos): if mouse_pos is not None: self.click_cell_under_mouse(mouse_pos) else: - self.click_random_cell() # replace with AI + self.click_random_cell() # todo replace with AI elif game_type == GameType.MULTI_PLAYER: if mouse_pos is not None: @@ -141,6 +145,7 @@ def game_loop(self, game_type): self.draw_results() self.draw_allowed_moves(highlight) self.draw_side_to_move(-self.board.playerJustMoved) + pygame.display.update() self.clock.tick(FRAMES_PER_SECOND)