This is a simple Tic-Tac-Toe game built using React. Below, you'll find an overview of the code structure and functionality.
- TicTacToe.js
- Main component that manages the game state and logic.
- Square.js
- Component representing individual squares on the game board.
- EndGame.js
- Component displaying the end game screen with the result and a button to start a new game.
- App.js
- Main entry point where the
TicTacToe
component is rendered.
- Main entry point where the
- The game board is represented by a 1-dimensional array of length 9, initialized with empty values.
- Players take turns to click on squares, and their moves are reflected in the game state.
- The game checks for a win or draw after each move and displays the result when the game is finished.
- The
EndGame
component allows the player to start a new game.
- Clone the repository.
- Install dependencies using
npm install
. - Run the application with
npm start
.
Feel free to explore and modify the code to enhance your understanding of React and game development.
- Multiplayer functionality.
- Animation for a more interactive user experience.
- Enhanced styling for a visually appealing interface.