Skip to content

Commit 2728e7f

Browse files
authored
Update with_person.py
1 parent ebd6d5f commit 2728e7f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

GAMES/Tic-Tac-Bot-Player/with_person.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def script_with_person():
1818
player_1 = 'X'
1919
player_2 = 'O'
2020
current_player = player_1
21-
possibilities = ['X', 'O', 'None']
21+
possibilities = ['X', 'O']
2222
while config.empty_cells:
2323
print("Player 1's turn: ") if current_player == 'X' else print("Player 2's turn: ")
2424

@@ -34,10 +34,12 @@ def script_with_person():
3434
# Checking if there is any win condition for the current board state after the player's move
3535
judgement = common_module.the_judge()
3636

37-
if judgement in possibilities and config.empty_cells == 0:
37+
if judgement in possibilities:
38+
break
39+
elif config.empty_cells == 0:
3840
break
3941

40-
if judgement == 'None':
41-
print(f'The game is a {judgement}\n')
42+
if judgement is None:
43+
print(f'The game is a draw!')
4244
else:
43-
print('Player 1 wins!\n') if judgement == 'X' else print('Player 2 wins!\n')
45+
print('Player 1 wins!\n') if judgement == 'X' else print('Player 2 wins!\n')

0 commit comments

Comments
 (0)