mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 15:37:51 -08:00
Merge pull request #190 from danielpiron/issue-188-vertical-wins
Center and left hand vertical wins correctly detected
This commit is contained in:
@@ -127,7 +127,7 @@ def determine_winner(board, g):
|
|||||||
return Winner.PLAYER
|
return Winner.PLAYER
|
||||||
|
|
||||||
# Check for matching vertical lines
|
# Check for matching vertical lines
|
||||||
for i in range(Space.TOP_LEFT.value, Space.TOP_LEFT.value + 1, 1): # Second third of Line 1115
|
for i in range(Space.TOP_LEFT.value, Space.TOP_RIGHT.value + 1, 1): # Second third of Line 1115
|
||||||
if board[i] != board[i+3] or board[i] != board[i+6]: # Last third of Line 1115
|
if board[i] != board[i+3] or board[i] != board[i+6]: # Last third of Line 1115
|
||||||
continue # First third of 1150
|
continue # First third of 1150
|
||||||
elif board[i] == OccupiedBy.COMPUTER: # Line 1135
|
elif board[i] == OccupiedBy.COMPUTER: # Line 1135
|
||||||
|
|||||||
Reference in New Issue
Block a user