A classic Tic Tac Toe game where two players take turns placing their marks (X or O) on a 3×3 grid. Built with HTML, CSS, and JavaScript.
- General Info
- Screenshots
- Technologies
- Setup
- Code Examples
- Features
- To-Do List
- Project Status
- Contact
Tic Tac Toe is a simple web-based implementation of the classic paper-and-pencil game for two players. Players alternate turns placing either an “X” or an “O” on a 3×3 grid. The first to align three of their marks horizontally, vertically, or diagonally wins the game. The game handles turn switching, win/draw detection, and board resetting through DOM manipulation.
- HTML5
- CSS3
- JavaScript (Vanilla)
- Visual Studio Code (IDE)
-
Clone this repository:
git clone https://github.com/yourusername/tic-tac-toe.git
-
Navigate to the project folder:
cd tic-tac-toe
-
Open index.html in your browser.
placeSymbol(cell, currentClass);
state.inputResults[cell.id] = currentClass;
const winner = hasWinner(state.winningPatterns, state.inputResults);
const draw = isDraw(state.inputResults);
-
Two-player mode (X vs. O)
-
Detects win conditions and draws
-
Message display for game results
-
Board resets for a new game
- Add single-player mode vs. computer
Project is: ✔️ Base project completed
By boba-milktea