Skip to content

Tic Tac Toe announces "None wins!" when the game is a draw #7

Description

@pushpam2404

Context

Fill the board without either side getting three in a row, and the game
cheerfully announces:

  None wins!

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

  • A draw prints a clear message such as "It's a draw."
  • A player win says the player won, not "X wins!"
  • A computer win says the computer won
  • None never appears in any message
  • A test in tests/test_tictactoe.py covers the draw board
  • python3 -m pytest passes

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething is brokendifficulty: beginnerNo prior knowledge of the codebase neededdomain: os-devxOpen Source & Developer Experiencegood first issueGreat for your very first pull requesthacktoberfestCounts toward Hacktoberfest 2026status: claimedAssigned to a contributor — do not start work on this

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions