TicTacToe_JavaScript

This repository contains a simple implementation of the classic Tic-Tac-Toe game using JavaScript, HTML, and CSS. The game allows two players to take turns placing their respective symbols (X and O) on a 3x3 grid. The first player to align three of their symbols either horizontally, vertically, or diagonally wins the game.

Youtube Tutorial Link: https://youtu.be/GUOisFZP_Fg

Live Preview: https://constgenius.github.io/TicTacToe_JavaScript/

Tic Tac Toe

How to Play

  1. Clone or download the repository to your local machine.
  2. Open the index.html file in your web browser.
  3. The game will start, and you will see a 3x3 grid displayed on the screen.
  4. Player 1 will be assigned the symbol "X," and Player 2 will be assigned the symbol "O."
  5. The players take turns clicking on an empty cell in the grid to place their symbol.
  6. The game will automatically detect a win or draw condition and display the result accordingly.
  7. To start a new game, simply click on Restart or refresh the page.

Features

  • Simple and intuitive user interface.
  • Real-time feedback on the game status (win, draw, or ongoing).
  • Automatic detection of winning conditions.
  • Easy to play and understand for all ages.

Files and Directory Structure

  • index.html: The main HTML file containing the game board and user interface.
  • styles.css: A CSS file to style the appearance of the game.
  • script.js: The JavaScript file containing the game logic and functionality.

Technologies Used

  • JavaScript: The game's logic is written in JavaScript for handling user interactions and determining the game's outcome.
  • HTML: The structure of the game is defined using HTML elements.
  • CSS: The game's visual styling is accomplished with CSS.

Contributions

Contributions to this project are welcome! If you find any bugs or have ideas for improvements, please create an issue or submit a pull request.