/tic-tac-toe

Epic.Wk4: A game of toes. and tic tacs

Primary LanguageJavaScript

Naughts and Crosses, Guvnah!

by Luke and Zach

Specifications

Display a board with 9 spaces

  • input:
  • output:

When a space is clicked, an "X" appears in that space

  • input: click a space
  • output: that space now has an "X" on it

Turn swapping

  • input: make a mark
  • output: turn changes

X and O marking based on Turn

  • input: turn changes (because of mark making)
  • output: next mark made is for the opposite player

Clicking on a space that is already marked does nothing

  • input: wha?
  • output: ya

When 3 spaces are marked in a horizontal line, victory commences.

  • input: horizontal tic tac toe
  • output: celebration

When 3 spaces are marked in a vertical line, victory commences.

  • input: vertical tic tac toe
  • output: celebration

When 3 spaces are marked in a diagonal line, victory commences.

  • input: diagonal tic tac toe
  • output: celebration

Every space is full

  • input: full grid but no tic tac toe
  • output: game over

Restart the game

  • input:
  • output: