This repository contains the source code for a modern and responsive Tic-Tac-Toe game built using React, Vite bundler, and styled with Tailwind CSS. The game includes two exciting modes: Player vs Player (PvP) and Player vs Bot.
-
Two Game Modes:
- PvP Mode: Play with a friend on the same device.
- Player vs Bot Mode: Play against an AI bot with customizable difficulty levels.
-
Responsive Design: The game is fully responsive and works seamlessly on desktop and mobile devices.
-
Beautiful UI/UX: The interface is intuitive, dynamic, and visually appealing, crafted with Tailwind CSS.
Bot AI: In Player vs Bot mode, the bot uses a simple algorithm to make moves and provide a challenging experience.
-
Difficulty Levels for Bot: Choose from three difficulty levels for the bot – Easy, Medium, and Hard, to adjust the bot's challenge.
-
Game Reset and Mode Switching: Easily reset the game or switch between PvP and Player vs Bot modes with a button click.
- React: JavaScript library for building the user interface.
- Vite: Next-generation front-end build tool and bundler.
- Tailwind CSS: Utility-first CSS framework for fast and responsive styling.
-
Clone the repository:
git clone https://github.com/ShahiCodes/Tic-Tac-Toe.git cd tic-tac-toe -
Install dependencies:
npm install
-
Run the app locally:
npm run dev
Visit
http://localhost:3000in your browser to play the game.
- Choose between PvP Mode and Player vs Bot Mode from the main menu.
- In PvP Mode, two players take turns to place their marks (X or O) on a 3x3 grid, aiming to get three of their marks in a row (horizontally, vertically, or diagonally).
- In Player vs Bot Mode, the player competes against an AI bot, with the bot making strategic moves based on its difficulty setting.
You can play the game live here: Tic-Tac-Toe Game
- Fork the repository.
- Create your feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-name). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- React for building the user interface.
- Vite for fast and efficient bundling.
- Tailwind CSS for designing the responsive layout.
Feel free to customize the link to your repository and any other details you want to add.