diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/GameState.py | 1 | ||||
-rw-r--r-- | python/alphaBeta.py | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/python/GameState.py b/python/GameState.py index eed8f36..8957f7c 100644 --- a/python/GameState.py +++ b/python/GameState.py @@ -36,7 +36,6 @@ class DotsAndBoxesState(GameState): columns.append({"v": 0, "h": 0}) rows.append(columns) self.board = rows - self.score = {1: 0, 2: 0} self.player = player print("Player: ", player) diff --git a/python/alphaBeta.py b/python/alphaBeta.py index 66040d5..c15f371 100644 --- a/python/alphaBeta.py +++ b/python/alphaBeta.py @@ -41,9 +41,10 @@ class ABNode(object): # A class for Node related operations class AlphaBeta(object): def miniMax(State, Ply_num): # Function for the minimax algorithm + start=ABNode(State) possiblemoves=State.get_moves() for x in possiblemoves: - if (x[0],x[1],x[2]) not in State.children: + if (x[0],x[1],x[2]) not in start.children: State.Make(x[0],x[1],x[2]) if Ply_num < 2: return (i, j) @@ -52,7 +53,7 @@ class AlphaBeta(object): r = 0 c = 0 o = "" - for k, z in State.children.items(): + for k, z in start.children.items(): Result = Algo.Maximum(z, Ply_num - 1, Minimum_Score) if Minimum_Score > Result: Minimum_Score = Result |