Skip to content

Tic Tac Toe Game is a simple and interactive web-based Tic Tac Toe game where a single player competes against an AI opponent. Built with HTML, CSS, and JavaScript, the game features dynamic turn indicators, win/draw detection, and a responsive design.

License

Notifications You must be signed in to change notification settings

rahul-prasad04/Tic-Tac-Toe-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Tic Tac Toe Game is a simple and interactive web-based Tic Tac Toe game where a single player competes against an AI opponent. Built with HTML, CSS, and JavaScript, the game features dynamic turn indicators, win/draw detection, and a responsive design.

Resources

License

Stars

Watchers

Forks