/ttt.github.io

project

Primary LanguageJavaScript

ttt.github.io

project Tic Tak Toe General Description

  • 1.This is a web appplication deployed on github.
  • 2.The application utilizes HTML, CSS and JavaScript. It maily uses jQuery for DOM manilpulation.
  • 3.Semantic markup for HTML and CSS are used through the codes.
  • 4.A game board with grid of 9 blocks is drawed for the game.
  • 5.The game is designed for two players, while players' name will be required before starting the game. Players' name will be displayed acordingly whild playing.
  • 6.Counter is set and display for calculating how many round player wins.
  • 7.On the end of the game, dialog window will be pop up decide whether playing againg or closing the window.
  • 8.When the winning side appears, the result will be highlighted visually and the winning combination will be shown as well.
  • 9.To play game, please visit: http://bonogit.github.io/
Main function List
  • initialGame : set all the variables, buttons and layout back to default value
  • playGame : when player click the button, this function to handle all the actions accordingly
  • endGame : close the game by poping up windows and set up the visual indicators
  • checkWinner : everytime when the button is clicked by the player, this function will compare the value stored in playData to judge if there is a winner and return the result to playGame
  • showPopup : show the pop up window by making it display when there is a winner
  • gameReset : repond to reset button in the pop up for re-initiate the game
  • endDrawGame : show the pop up window when the game is draw
  • drawGameReset : repond to reset button in the pop up for re-initiate the game
Variable List
  • playsData : array for storing the data in every button
  • winnerIndex : array for storing index of winning buttons
  • playerID : number for storing who is playing
  • gameOver : a flag to indicate the game status
  • counter : counter for counting how many moves
  • playName : array for storing the player names
  • winnerCounter : numbers in array to store each players' winning rounds