TicTacToe

A local two-player TicTacToe game built with plain HTML, CSS, and JavaScript. The board, marks, and controls follow the site's Everforest light and dark themes.

Rules

  • The game is played on a 3×3 board. X always moves first.
  • Players alternate placing their mark in an empty square.
  • The first player to get three marks in a row horizontally, vertically, or diagonally wins.
  • If all nine squares are filled without a winner, the game is a tie.
  • Restart clears the board and starts a new game with X.

Source Code









Output

Sandbox tic-tac-toe
Game