mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-04 05:44:35 +00:00
[PR #1429] [CLOSED] Update tic_tac_toe.c #2024
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/1429
Author: @shrivalidutt
Created: 10/8/2024
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
b645351Update tic_tac_toe.c📊 Changes
1 file changed (+121 additions, -375 deletions)
View changed files
📝
games/tic_tac_toe.c(+121 -375)📄 Description
Description of Change
The input validation in placex() and placey() now uses a loop that continuously prompts for valid input until a valid move is made, preventing infinite loops.
The checkwin() function has been rewritten such that it eliminates repetitive code. It uses an array to define win conditions, making the logic cleaner and easier to maintain.
References
Checklist
Notes:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.