Skip to content

[Bug]: Fix gameplay logic, move announcement display, and replay loop in Tic_Tac_Toe #516

Description

@Prayas340

Description

The Tic_Tac_Toe script contains multiple gameplay, logic, display, and execution issues:

  1. Move Announcement Cleared Immediately: print('computer placed an o on position', move, ':') was immediately followed by CleanScreen(), wiping the move information before the player could see it.
  2. Turn and Game Over Sequence: The win/loss and tie checking sequence in GamePlay() checked computer win conditions with a turn delay and did not announce tie games immediately upon reaching a full board on move 9.
  3. Broken Replay Loop: The replay loop in while True: invoked StartTheGame() recursively inside the else: branch, causing redundant replay prompts and tie checks on an already finished board.
  4. Encoding Issues on Windows: Console emoji outputs can trigger UnicodeEncodeError in standard cp1252 Windows terminal environments.
  5. README Execution Casing: README.md listed python Tic_Tac_Toe.py which causes a FileNotFoundError on case-sensitive operating systems (actual filename is ic_tac_toe.py).

Type of issue

  • Feature (New Script)
  • Bug
  • Documentation

Checklist:

  • I have read the project guidelines.
  • I have checked previous issues to avoid duplicates.
  • This issue will be meaningful for the project.
  • I have added steps to reproduce the bug
  • I have proposed a possible solution for the bug

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