Skip to content

frankda/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

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/

Main Game

1. Create Gaming Board

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.

2. Bind Clinking Function to Cells

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

Control Panel

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published