Skip to content

[Bug]: Tic-Tac-Toe game does not handle draw condition correctly #762

@leonagoel

Description

@leonagoel

Description

The Tic-Tac-Toe game does not properly detect or display a draw (tie) condition
when all 9 cells are filled and no player has won. The game either crashes,
freezes, or continues accepting input after the board is full.

Steps to Reproduce

  1. Run the Tic-Tac-Toe game
  2. Play the game such that all 9 cells are filled without either player winning
  3. Observe the behavior after the board is full

Expected Behavior

The game should display a "It's a Draw!" message and prompt the user to
play again or exit gracefully.

Actual Behavior

The game does not handle the draw scenario — it may hang, crash, or
allow further input beyond the filled board.

Possible Fix

  • Add a check after every move to see if all cells are filled
  • If no winner is found and board is full, display draw message
  • Offer replay option

Environment

  • Python 3.x
  • OS: Windows/Linux/Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions