This project features two classic games—Tic-Tac-Toe and Memory—built using React and Vite.
-
Tic-Tac-Toe: An interactive game where two players can enter their names before starting and take turns marking spaces in a 3×3 grid to achieve three in a row.
-
Memory Game: A concentration game with a dynamic board size, allowing players to select the grid dimensions before starting. Players flip over pairs of matching cards to test and improve memory skills.
Play Now.
Ensure you have the following installed:
-
Node.js: Version 14 or higher.
-
npm: Version 6 or higher.
-
Clone the repository:
git clone https://github.com/dee-raj/tic-tac-toe-memory.git
-
Navigate to the project directory:
cd tic-tac-toe-memory
-
Install dependencies:
npm install
To start the development server:
npm run dev
Open your browser and navigate to http://localhost:5173
to access the application.
To create an optimized production build:
npm run build
The build output will be located in the dist
directory.
-
Enter Player Names: Before starting, input the names of Player 1 and Player 2.
-
Start Game: The game begins with an empty 3×3 grid.
-
Gameplay: Players take turns clicking on empty squares to place their respective marks (X or O).
-
Winning: The first player to align three of their marks horizontally, vertically, or diagonally wins.
-
Reset: Click the "Reset" button to start a new game.
-
Select Board Size: Choose the desired grid dimensions (e.g., 4×4, 6×6, 8×8) before starting the game.
-
Start Game: The game presents a grid of facedown cards based on the selected dimensions.
-
Gameplay: Click on two cards to flip them over. If they match, they remain face up; if not, they flip back down.
-
Winning: Continue matching pairs until all cards are face up. The game ends when all pairs are found.
-
Reset: Click the "Reset" button to shuffle the cards and start a new game.
-
React: A JavaScript library for building user interfaces.
-
Vite: A fast build tool and development server.
This project was inspired by various tutorials and examples available online.
This project is licensed under the MIT License.