Context
Fill the board without either side getting three in a row, and the game
cheerfully announces:
None is Python's way of saying "no value", and it is leaking into the message
the player sees.
Steps to reproduce
python3 -m arcade
# choose Tic Tac Toe, and play to a draw
What to change
File: arcade/games/tictactoe.py
Function: play() — the last few lines
print(render(board))
print(f" {result} wins!\n")
When nobody has won, result is None and that f-string prints it literally.
Handle the three outcomes separately: player wins, computer wins, draw.
There is already an is_full() helper in the same file — use it.
Acceptance criteria
How to verify locally
python3 -m arcade # play Tic Tac Toe to a draw
python3 -m pytest
Difficulty
Beginner.
New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.
Stuck at any point? Comment here saying what you have tried, or come to a PR Debug Clinic (Oct 12 or Oct 21). Getting stuck is the normal experience of learning this, not a sign you are doing it wrong.
Context
Fill the board without either side getting three in a row, and the game
cheerfully announces:
Noneis Python's way of saying "no value", and it is leaking into the messagethe player sees.
Steps to reproduce
python3 -m arcade # choose Tic Tac Toe, and play to a drawWhat to change
File:
arcade/games/tictactoe.pyFunction:
play()— the last few linesWhen nobody has won,
resultisNoneand that f-string prints it literally.Handle the three outcomes separately: player wins, computer wins, draw.
There is already an
is_full()helper in the same file — use it.Acceptance criteria
Nonenever appears in any messagetests/test_tictactoe.pycovers the draw boardpython3 -m pytestpassesHow to verify locally
python3 -m arcade # play Tic Tac Toe to a draw python3 -m pytestDifficulty
Beginner.
New here? Comment
/claimon this issue and a bot will assign it to you. Then read CONTRIBUTING.md.Stuck at any point? Comment here saying what you have tried, or come to a PR Debug Clinic (Oct 12 or Oct 21). Getting stuck is the normal experience of learning this, not a sign you are doing it wrong.