From a0210ffe839fdd3b25f9003e1f51ae93a1564c7f Mon Sep 17 00:00:00 2001 From: Thomas Kwashnak Date: Thu, 6 Jan 2022 09:55:01 -0500 Subject: [PATCH] Forgot board isn't booleans Maybe I should make it booleans? --- 48_High_IQ/python/High_IQ.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/48_High_IQ/python/High_IQ.py b/48_High_IQ/python/High_IQ.py index d80b95a4..52aff04c 100644 --- a/48_High_IQ/python/High_IQ.py +++ b/48_High_IQ/python/High_IQ.py @@ -61,8 +61,8 @@ def is_game_finished(board): for pos in board.keys(): if board[pos] == "X": for space in [1,9]: - nextToPeg = ((pos + space) in board) and board[pos + space] - hasMovableSpace = (not ((pos - space) in board and board[pos - space])) or (not ((pos + space * 2) in board and board[pos + space * 2])) + nextToPeg = ((pos + space) in board) and board[pos + space] == "X" + hasMovableSpace = (not ((pos - space) in board and board[pos - space] == "X")) or (not ((pos + space * 2) in board and board[pos + space * 2] == "X")) if nextToPeg and hasMovableSpace: return False