googly1030 / TIC-TAC-TOE

BUILT AN TIC-TAC-TOE GAME USING JAVASCRIPT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic-Tac-Toe Game in JavaScript

This is a simple Tic-Tac-Toe game implemented in JavaScript, HTML, and CSS. It can be played by two players, one taking the role of X and the other taking the role of O.

How to Play

To play the game, open the index.html file in a web browser. You will see a 3x3 grid with empty cells. To make a move, click on an empty cell. The first player will be X, and the second player will be O.

The game will automatically detect when a player has won, and will display a message indicating which player has won. If the game ends in a tie, a message indicating a draw will be displayed.

To start a new game, simply click reset

Implementation Details The game is implemented using object-oriented programming principles in JavaScript. The Game class represents the game, and contains methods for making moves and checking the game state.

The game state is represented as a two-dimensional array of integers, where a value of 0 represents an empty cell, a value of 1 represents an X, and a value of 2 represents an O.

The user interface is implemented using HTML and CSS, with event handlers in JavaScript to handle user input.

License This project is licensed under the MIT License. See the LICENSE file for more information.

About

BUILT AN TIC-TAC-TOE GAME USING JAVASCRIPT


Languages

Language:JavaScript 58.7%Language:CSS 28.2%Language:HTML 13.1%