mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-16 05:55:12 +00:00
[PR #1412] [CLOSED] fix: tic_tac_toe: Both player are filling choice at different time on… #2006
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/1412
Author: @ashvin-parmar
Created: 9/7/2024
Status: ❌ Closed
Base:
master← Head:tic_tac_toe📝 Commits (1)
ec69aa0fix: tic_tac_toe: Both player are filling choice at different time one by one📊 Changes
1 file changed (+17 additions, -15 deletions)
View changed files
📝
games/tic_tac_toe.c(+17 -15)📄 Description
…e by one
Previously/Problem : There are 2 player playing but tic_tac_toe game but preferences for choice filling for 'o' and 'x' are filled at same time, which cause a bug in which same 'x' value are filled 2 times.
Which need to be improved and also at one time only one player can fill thier choice, that why i resolve this problem.
Solution: I used conditional statement in which value of 'x' which are used for first player choice applied when (instance_for_loop%2==0) or else part for other player. on each round thier is checking for any player for win the match or draw and in a manner such that once player data is not assigned to other one.
Description of Change
References
Checklist
Notes:
Both player are filling choice at different time one by one
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.