A classic Tic‑Tac‑Toe game built using HTML, CSS, and JavaScript. This project demonstrates core JavaScript concepts such as DOM manipulation, event handling, game state management, and win-condition checking.
- Two-player game (Player O vs Player X)
- Turn-based gameplay
- Automatic win detection
- Game reset and new game functionality
- Clean and responsive UI
- Message display announcing the winner
- HTML5 – Game structure
- CSS3 – Styling and layout (Flexbox)
- JavaScript (Vanilla) – Game logic
tic-tac-toe/
│
├── index.html # Main HTML file
├── style.css # Styling
├── app.js # Game logic
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/your-username/tic-tac-toe.git
-
Navigate to the project directory:
cd tic-tac-toe -
Open
index.htmlin any modern web browser.
✅ No external libraries or setup required.
- The game starts with Player O.
- Players take turns clicking on empty boxes.
- Each click places an O or X in the selected box.
- After every move, the game checks for a winning pattern.
- If a player matches three boxes in a row (horizontal, vertical, or diagonal), a winner is announced.
- The game can be restarted using Reset Game or New Game.
winPatterns– Stores all possible winning combinationscheckWinner()– Checks the board after every moveshowWinner(winner)– Displays the winner messageresetGame()– Resets the board and game stateenableBoxes()/disableBoxes()– Controls box interaction
- Responsive 3×3 grid layout
- Large, readable symbols (X and O)
- Centered game board
- Modal-style winner message
- Minimal and clean color palette
- Add draw (tie) detection
- Add single-player mode with AI
- Add score tracking
- Add animations and sound effects
- Improve mobile responsiveness
(Add screenshots or a GIF of the gameplay here)
Contributions are welcome!
- Fork the repository
- Create a new branch (
feature/new-feature) - Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License.
Your Name GitHub: Doremon-tech-svg(https://github.com/Doremon-tech-svg)
⭐ If you found this project helpful, please give it a star!