File tree 1 file changed +7
-5
lines changed 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def script_with_person():
18
18
player_1 = 'X'
19
19
player_2 = 'O'
20
20
current_player = player_1
21
- possibilities = ['X' , 'O' , 'None' ]
21
+ possibilities = ['X' , 'O' ]
22
22
while config .empty_cells :
23
23
print ("Player 1's turn: " ) if current_player == 'X' else print ("Player 2's turn: " )
24
24
@@ -34,10 +34,12 @@ def script_with_person():
34
34
# Checking if there is any win condition for the current board state after the player's move
35
35
judgement = common_module .the_judge ()
36
36
37
- if judgement in possibilities and config .empty_cells == 0 :
37
+ if judgement in possibilities :
38
+ break
39
+ elif config .empty_cells == 0 :
38
40
break
39
41
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! ' )
42
44
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 ' )
You can’t perform that action at this time.
0 commit comments