g0v1ndN / tic-tac-toe

Tic Tac Toe game made using HTML, CSS & JS ❌⭕

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tic-tac-toe

About:

This interactive web app recreates the beloved Tic Tac Toe game. It features a 3x3 grid for classic gameplay and employs arrays, loops, and event listeners for user interaction.

Features:

  1. A div tag to contain the game board and eight divs with the class "box" and unique IDs to represent the individual squares.
  2. Pseudo-classes to remove the right and bottom borders from the third and sixth boxes, respectively.
  3. An array to represent the game board, initially filled with null values.
  4. A function to add a click event listener to each box element and an event handler function to handle clicks on the boxes.
  5. Conditional statements to check if the box has already been clicked.
  6. Statements to update the game board, display the symbol of the current player, and check if the game has been won.
  7. A variable to store an array of winning combinations.
  8. A function to restart the game when the restart button is clicked.

Usage Instructions:

Prerequisites:

  • Basic HTML, CSS, and JavaScript Knowledge: Familiarity with HTML, CSS, and JavaScript concepts is essential for understanding the structure, styling, and interactivity of the project.
  • Text Editor or Integrated Development Environment (IDE): You'll need a code editor to make changes to the project files. Popular choices include Visual Studio Code, Sublime Text, or Atom.
  • Web Browser: You'll need a modern web browser (such as Google Chrome, Mozilla Firefox, or Microsoft Edge) to view and test your changes.

Downloading or Cloning the Repository:

  1. Click on the "Code" button on the top right corner of this repository page.
  2. Click on "Download ZIP" to download a compressed zip file of the repository.
  3. Extract the contents of the zip file to a folder on your computer.

OR

  1. Open your terminal or command prompt and navigate to the directory where you want to clone the repository.
  2. Run the command git clone https://github.com/g0v1ndN/tic-tac-toe to clone the repository to your local machine.

Note

You need to have Git installed on your computer. If you don't have it installed, please download and install Git from the official website.

Opening the HTML File in a Web Browser:

  1. Open the folder where you downloaded or cloned the repository.
  2. Find the HTML file named 'index.html' within the folder.
  3. Double-click on the HTML file to open it in your default web browser. Alternatively, you can right-click on the file and select "Open With" to choose a specific web browser to open the file.

Screenshots:

Screenshot

License:

This project is licensed under the terms & conditions (T&Cs) of the MIT license. If you're interested in reading more about it, please take a look at the LICENSE document.

About

Tic Tac Toe game made using HTML, CSS & JS ❌⭕

License:MIT License


Languages

Language:JavaScript 47.9%Language:CSS 29.1%Language:HTML 23.0%