BukkieSho / TicTacToe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic Tac Toe

Tic-Tac-Toe is a simple and fun game for 2 players, X and O. It is played on a 3x3 grid. Each player's goal is to make 3 in a row.

Game Objective

Fill 3 squares in a row vertically, horizontally or diagonally.

Game Rules

Players take turns placing their X or O, on an open square in the grid. The first player to make 3 of their own mark in a row vertically, horizontally, or diagonally wins the game. If all 9 squares are filled and neither player has 3 in a row, the game is considered a Tie.

Pseudocode

  1. Define the required variables used to track the state of the game:

  2. Store cached element references on the page that will be accessed in code more than once in variables to make code more concise, readable, and performant:

  3. Upon loading, the app should: 3.1) Call an initialize function to initialize the state variables 3.2) Render those values to the page 3.3) Wait for the user to click a square

  4. Define the required constants

  5. Handle a player clicking a square

  6. Handle a player clicking the replay button

About


Languages

Language:JavaScript 57.8%Language:CSS 28.1%Language:HTML 14.1%