Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

A few small points that strengthen the explanation even more:

State management is clear
Tracking the current player with a variable and switching it after every valid move keeps the logic simple and predictable. Good choice for a beginner project.

Win checking is logically structured
Covering all 8 winning combinations (rows, columns, diagonals) after each move is the right approach. It reinforces how pattern checking works in games.

Draw condition is correctly ordered
Checking for a win first, then checking if all cells are filled avoids false draws. That’s an important detail many beginners miss.

Reset without reload is a plus
Clearing the grid and resetting variables instead of reloadi…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jhanhvi1008
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub Education All things GitHub Education including website, documentation and events. Question Ask and answer questions about GitHub features and usage Verification Help & Guidance Guiding users through their Education verification rejection reasons. Welcome πŸŽ‰ Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
3 participants