Skip to content

Latest commit

 

History

History
74 lines (48 loc) · 2.13 KB

README.md

File metadata and controls

74 lines (48 loc) · 2.13 KB

Tic Tac Toe Game

Overview

Tic Tac Toe is a simple and interactive game built using HTML, CSS, and JavaScript. This project demonstrates a classic gameplay experience where a single player competes against a basic AI opponent, with dynamic turn indicators and win/draw detection.


Features

  • Player vs. AI Mode: Challenge yourself against a responsive AI opponent with strategic logic.
  • Interactive 3x3 Grid: A clickable grid for gameplay.
  • Winner/Draw Detection: Highlights the winning line or indicates a draw.
  • Restart Button: Resets the game for a fresh start.
  • Responsive Design: Optimized for desktop and mobile devices.
  • About Modal: Provides additional information about the game.

Technologies Used

  • Frontend: HTML5, CSS3, JavaScript.
  • Libraries: Font Awesome for icons.

How to Run the Project

Follow these steps to run the project locally:

  1. Clone the Repository:
    git clone https://github.com/rahul-prasad04/Tic-Tac-Toe-Game.git
  2. Navigate to the Project Directory:
    cd Tic-Tac-Toe-Game
  3. Open the index.html File: Double-click index.html or open it in any modern browser.

How to Play

  1. Click on any box in the grid to place your mark (X).
  2. The AI (O) will take its turn automatically after yours.
  3. The first to align three marks in a row, column, or diagonal wins.
  4. If all boxes are filled without a winner, the game ends in a draw.
  5. Click the "Play Again" button to reset the game.

Code Structure

  • index.html: Contains the layout and structure of the game.
  • style.css: Provides styling for the game, including responsiveness and animations.
  • script.js: Implements game logic, turn handling, and AI behavior.

Game Board Screenshot

screenshot png

Winning State Screenshot

winning_screenshot png


License

This project is licensed under the MIT License. See the LICENSE file for details.