A simple Tic Tac Toe game, you can only play yourself. Page layout is divided to 3 parts.
Live Code https://frankda.github.io/tic-tac-toe/
Two functions are used to generate gaming board:
createGamingBoard()
is used to build the overall gaming board
createCell()
is used to build cells inside gaming board.
cellClicking(_this)
is the function bound to each cell generated in 1st step. There are also some functions built in this function to check who is winner and when the game is over
playClickSound()
: when a cell is clicked, browser will play a clicking sound
Controllers are wrapped in control panel, each controller is made of 2 input: 1 text input and 1 range input. There are 2 functions bound to each input.
matchSliderValueWithInputText(_this)
so two input’s value can match each other.
resetBoard()
: Every time change the value will resetBoard.