Experience the classic game of Tic-Tac-Toe brought to life with HTML, CSS, and JavaScript. This interactive web application allows you to play against a friend, providing an engaging and fun experience.
-
Interactive Board: Click on the cells to make your move. The game alternates between 'X' and 'O' with each click.
-
Winning Conditions: The game checks for winning conditions after each move. If a player forms a line horizontally, vertically, or diagonally, they win the game.
-
Draw Detection: If the board is full and no player has won, the game declares a draw.
-
Restart and Reset: Start a new game or reset the current game with the click of a button.
- Open the web app in your browser.
- Click on the cells of the board to make your move.
- The game alternates between 'X' and 'O'.
- The game declares a winner or a draw based on the moves.
- Restart or reset the game as needed.
-
HTML: Provides the structure and layout of the game board.
-
CSS: Enhances the visual appeal of the game with styling.
-
JavaScript: Implements the game logic, checks for winning conditions, and updates the UI dynamically.
-
The JavaScript code handles the game logic, checking for winning conditions, and managing the state of the game board.
-
CSS styling ensures a visually pleasing and responsive game board.
Open the index.html
file in your preferred web browser to start playing the Tic-Tac-Toe game. Have fun strategizing and competing with your friends!
Feel free to explore the code and make enhancements or customize the game to suit your preferences.