From dea5598b51831b89f3f11e84db7d8a6418417590 Mon Sep 17 00:00:00 2001 From: Jack Vehmeier Date: Tue, 27 Apr 2021 13:37:43 -0500 Subject: vehme003 --- python/GameState.py | 1 - python/alphaBeta.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'python') 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 -- cgit v1.2.3