Skip to content

Commit

Permalink
- Started implementing engine into GUI. (just added import and print …
Browse files Browse the repository at this point in the history
…statement)
  • Loading branch information
AngelVI13 committed May 3, 2019
1 parent 92a2b43 commit 13eb51d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gui/gui_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from functools import partial
from itertools import cycle, chain

from engine.uct import uct_multi
from gui.gui_board import *


Expand Down Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 13eb51d

Please sign in to comment.