aboutsummaryrefslogtreecommitdiffstats
path: root/python/alphaBeta.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/alphaBeta.py')
-rw-r--r--python/alphaBeta.py5
1 files changed, 3 insertions, 2 deletions
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