A classic two-player Tic-Tac-Toe game with clean UI and smooth gameplay.
- Two-Player Mode - Play with friends on the same device
- Win Detection - Automatically detects winning combinations
- Draw Detection - Recognizes when game ends in a draw
- Reset Options - New Game and Reset Game buttons
- Colorful Design - Vibrant pink theme with yellow title
- Responsive Layout - Works on all screen sizes
- Interactive UI - Hover effects and visual feedback
https://TahirAhmad88.github.io/TicTacToe_Game/
- Player O goes first (auto-selected)
- Click any empty box to place your mark
- Players alternate turns automatically
- First to get 3 in a row wins
- Click New Game or Reset Game to start over
Tic-Tac-Toe Game Interface
text TicTacToe_Game/ ├── index.html # Main HTML file ├── style.css # Styling and animations ├── script.js # Game logic └── README.md # Documentation
- HTML5 - Structure
- CSS3 - Styling, animations, responsive design
- JavaScript - Game logic, DOM manipulation, event handling
8 possible winning combinations:
- 3 rows
- 3 columns
- 2 diagonals
- Turn tracking (Player O starts)
- Box disabling after click
- Win/Draw detection *Message display for results *Game reset functionality
Change Colors /* In style.css */
body { background-color: #ed2596; } /* Change background */
.box { color: #b0413e; } /* Change X/O color */
h1 { color: rgba(255, 255, 44, 0.958); } /* Change title color */
.game { height: 60vmin; width: 60vmin; }
.box { height: 18vmin; width: 18vmin; }
-
Clone the repository git clone https://github.com/TahirAhmad88/TicTacToe_Game.git
-
Navigate to project cd TicTacToe_Game
-
Open index.html in your browser
Tahir Ahmad
@TahirAhmad88
Star this repository if you like it!