The TicTacToe Web Game is a classic game implemented using HTML, CSS, and JavaScript. This project provides a web-based version of the popular Tic-Tac-Toe game, where two players take turns marking spaces on a 3x3 grid to achieve a winning pattern.
The project structure includes the following components:
index.html
: This file contains the HTML code for the game interface.
Inside the TicTacToe
folder, you will find the following subfolders:
-
scripts
folder: This folder contains the JavaScript files responsible for the game's functionality.app.js
: This file defines variables and function calls using event listeners to handle user interactions.config.js
: This file contains the function logic required for setting up the game playing environment before starting a game.game.js
: This file contains the game logic, including changing player turns, checking for a winner, and displaying the game result.
-
styles
folder: This folder contains the CSS files responsible for styling different sections of the game.configuration.css
: This file defines the styling for the configuration section of the game.game.css
: This file contains the styling rules for the game board and its elements.overlays.css
: This file provides styling for overlays and pop-up messages.styles.css
: This file contains general styles that are applied throughout the game.
To install and run the TicTacToe Web Game locally, follow these steps:
- Clone the repository:
- Navigate to the project directory:
- Open the
index.html
file in your preferred web browser.
-
When you open the
index.html
file, you will see options to set the names of the two players. -
Enter the names of the players in the designated input fields.
-
After entering the player names, click the "Confirm" button.
-
Click the "Start New Game" button to begin the game.
-
A game board will appear, allowing players to take turns marking spaces on the 3x3 grid.
-
To make a move, click on an empty space on the grid.
-
The game will automatically switch turns between the players.
-
If a player achieves a winning pattern (a row, column, or diagonal filled with their marks), a section will appear displaying the winner's name.
-
If the game ends in a tie (all spaces filled without a winning pattern)
For any questions, suggestions, or feedback, feel free to reach out to me:
- Email: [email protected]
Thank you for your interest in the TicTacToe Web Game project!