Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

❌⭕ Tic Tac Toe Game

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.


📌 Features

  • 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

🛠️ Technologies Used

  • HTML5 – Game structure
  • CSS3 – Styling and layout (Flexbox)
  • JavaScript (Vanilla) – Game logic

📂 Project Structure

tic-tac-toe/
│
├── index.html        # Main HTML file
├── style.css         # Styling
├── app.js            # Game logic
└── README.md         # Project documentation

▶️ How to Run the Project

  1. Clone the repository:

    git clone https://github.com/your-username/tic-tac-toe.git
  2. Navigate to the project directory:

    cd tic-tac-toe
  3. Open index.html in any modern web browser.

✅ No external libraries or setup required.


🎯 How the Game Works

  1. The game starts with Player O.
  2. Players take turns clicking on empty boxes.
  3. Each click places an O or X in the selected box.
  4. After every move, the game checks for a winning pattern.
  5. If a player matches three boxes in a row (horizontal, vertical, or diagonal), a winner is announced.
  6. The game can be restarted using Reset Game or New Game.

🧠 JavaScript Logic Overview

  • winPatterns – Stores all possible winning combinations
  • checkWinner() – Checks the board after every move
  • showWinner(winner) – Displays the winner message
  • resetGame() – Resets the board and game state
  • enableBoxes() / disableBoxes() – Controls box interaction

🎨 UI Highlights

  • Responsive 3×3 grid layout
  • Large, readable symbols (X and O)
  • Centered game board
  • Modal-style winner message
  • Minimal and clean color palette

🚀 Future Improvements

  • Add draw (tie) detection
  • Add single-player mode with AI
  • Add score tracking
  • Add animations and sound effects
  • Improve mobile responsiveness

📸 Preview

(Add screenshots or a GIF of the gameplay here)


🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a new branch (feature/new-feature)
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

📜 License

This project is licensed under the MIT License.


🙌 Author

Your Name GitHub: Doremon-tech-svg(https://github.com/Doremon-tech-svg)


⭐ If you found this project helpful, please give it a star!

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages