feat: He implementado un componente React Tic-Tac-Toe game#12
Open
ernestcr wants to merge 1 commit into
Open
Conversation
This commit introduces a complete Tic-Tac-Toe game implemented as a single React component in `TicTacToe.tsx`.
Key features include:
- Title: "Juego de Michi del Prof. Ernesto Cancho."
- A clear 3x3 grid with high-contrast borders.
- Player vs. Player (PvP) mode.
- Player vs. Computer (PvC) mode with basic AI:
- AI attempts to win.
- AI blocks your winning moves.
- AI prioritizes center, then corners, then sides.
- All AI logic is implemented locally within the component.
- Interactive clickable cells that display 'X' or 'O'.
- Clear indicators for player turns, wins, and draws.
- A "Play Again" button to restart the game in the current mode.
- All UI and game logic are self-contained in the single .tsx file, using inline styles.
I followed a structured plan, adding features incrementally:
1. Initial file creation and basic UI.
2. Cell click and mark placement.
3. Player turn alternation.
4. Win condition logic.
5. Draw condition logic.
6. "Play Again" functionality.
7. Player vs. Computer mode with AI.
8. Final code review and verification of requirements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a complete Tic-Tac-Toe game implemented as a single React component in
TicTacToe.tsx.Key features include:
I followed a structured plan, adding features incrementally: