Skip to content

paulobelucci/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tic-tac-toe

Tic Tac Toe

How to run?

Just clone the repo and open the index.html file.

Steps:

1 -> I create the function "createBoard", it should create the empty positions inside the board.

2 -> After that when clicking on Play Button it start the game and it use the function "whoShouldStart" to decide randomly wich player will start playing.

3 -> When the player is selected it will check the positions available to make a move using the function "areThereOptionsToMake", and if there is any place to play it will make a move using the function "makeMove".

4 -> When each line is completly full, it will check if we have a winner already, calling the functino "checkWinner". If we don't have a winner, it will restart the process with the next player, while it remains a field to be filled.

5 -> If there is a winner it will show a success message and change the style of the winner "row". If there isn't a winner it will show a DRAW message.

It should start like this:

image

Just hit the play button and wait for the results!!!

image

image

Releases

No releases published

Packages

No packages published