From 6362cb188bab4c99f863fb9081dc11b94abe4127 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Wed, 28 Apr 2021 19:45:56 -0500 Subject: Fix neverending loop --- python/alphaBeta.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/alphaBeta.py b/python/alphaBeta.py index f9d735f..0a24ebc 100644 --- a/python/alphaBeta.py +++ b/python/alphaBeta.py @@ -45,7 +45,12 @@ class AlphaBeta(object): State = deepcopy(State) start = ABNode(State) possiblemoves=State.get_moves() + if len(possiblemoves) < 3: + for x in possiblemoves: + return x for x in possiblemoves: + if len(possiblemoves) < 3: + return x if (x[0],x[1],x[2]) not in start.children: start.Make(x[0],x[1],x[2]) # if Ply_num < 2: -- cgit v1.2.3