Skip to content

dev-himanshu-x/GridLock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

A two-player Tic Tac Toe game built with React and Vite.

Features

  • Two-player local gameplay (X and O)
  • Win detection with highlighted winning cells
  • Draw detection
  • Score tracking across rounds
  • Responsive — works on phones, tablets, and desktops

Tech Stack

  • React 19
  • Vite 7
  • Plain CSS (no UI libraries)

Getting Started

# clone the repo
git clone https://github.com/your-username/tic-tac-toe-reactjs.git
cd tic-tac-toe-reactjs

# install dependencies
npm install

# start the dev server
npm run dev

Open http://localhost:5173 in your browser.

Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run preview Preview the production build
npm run lint Run ESLint

Project Structure

src/
├── App.jsx    # Game logic and UI
├── App.css    # All styles
├── main.jsx   # Entry point
└── index.css  # Global reset

How to Play

  1. X always goes first.
  2. Players alternate clicking empty cells.
  3. First to get three in a row (horizontal, vertical, or diagonal) wins.
  4. If all nine cells are filled with no winner, it's a draw.
  5. Click Play again to start a new round — scores carry over.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors