diff options
author | Matt Strapp <strap012@umn.edu> | 2021-04-28 19:45:56 -0500 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2021-04-28 19:45:56 -0500 |
commit | 6362cb188bab4c99f863fb9081dc11b94abe4127 (patch) | |
tree | c365edcfa60ac81800f45fdfdb531921c7aa4700 /python | |
parent | Double both iterations and time (diff) | |
download | csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.tar csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.tar.gz csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.tar.bz2 csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.tar.lz csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.tar.xz csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.tar.zst csci4511w-6362cb188bab4c99f863fb9081dc11b94abe4127.zip |
Fix neverending loop
Diffstat (limited to 'python')
-rw-r--r-- | python/alphaBeta.py | 5 |
1 files changed, 5 insertions, 0 deletions
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: |