Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e73a0d

Browse files
committed
fix for kyclark#16
1 parent 0a1216a commit 0e73a0d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

22_itictactoe/solution1.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ def main() -> None:
2828
elif state.winner:
2929
print(f'{state.winner} has won!')
3030
break
31-
32-
state = get_move(state)
33-
34-
if state.quit:
31+
elif state.quit:
3532
print('You lose, loser!')
3633
break
3734
elif state.draw:
3835
print("All right, we'll call it a draw.")
3936
break
4037

38+
state = get_move(state)
39+
4140

4241
# --------------------------------------------------
4342
def get_move(state: State) -> State:

22_itictactoe/solution2_typed_dict.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ def main() -> None:
3333
elif state['winner']:
3434
print(f"{state['winner']} has won!")
3535
break
36-
37-
state = get_move(state)
38-
39-
if state['quit']:
36+
elif state['quit']:
4037
print('You lose, loser!')
4138
break
4239
elif state['draw']:
4340
print('No winner.')
4441
break
4542

43+
state = get_move(state)
44+
4645

4746
# --------------------------------------------------
4847
def get_move(state: State) -> State:

0 commit comments

Comments
 (0)