/WDI_Projects

All Projects that are built at WDI

Primary LanguageCSS

WDI_Projects

Project 0 - TIC TAC TOE

Tic-tac-toe (or Noughts and crosses, Xs and Os) is a paper-and-pencil game for two players, X and O, who takes turns marking the spaces in a 3×3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game.

The project is built using the HTML5 Canvas

Separate HTML, CSS, and JavaScript files haven been used in this Project

The game begins with the 3 x 3 game grid drawn and starting with the first click on the canvas element, the game alternates from player 1 who marks X on the cell to player 2 who marks O on the cell until there is a win or a draw.

checkpoints

  1. if the user clicks on the same cell more than once, an alert message pops up
  2. if there is a win by either player , an alert pops up with the message of the win
  3. if the game ends in a draw, an alert pops up with a draw message
  4. The game automatically resets after the win/draw condition for the next game.

What can be improved

  • usage if Images instead of plain drawing
  • check for the wierd thing that is happening when i have more than three clicks