View on GitHub

marymafa.github.io


layout: post title: Tic Tac Toe date: 2018-01-30 —

Tic Tac Toe project

Last i didn’t finish my tic tac toe game because i did html and css only. Now i’m continuing with my project following the user stories , for me to fulfill the user stories i should also include javascript.

Javascript

I created three variable called playchoice for the user to choose whether to be character X or character O, another variable is called computerchoice like the computer will choose to play as character X or character O and the last variable is called computer player like if is player one only, then that player wil play with the computer. Each variable will store it’s own data.

I created a function titled one player that will allow the user to choose player choice which is character X or character O and after choosing will alert a message that says “You want to play as one play”. I have another function that titled two player will throw an alert message that says”You want to play as two player” and also choose player choice.

I created another function titled go back, that will allow the user to go back and also have another function called characater X like when ever the user choose to play as X then computer will play as character O and will also throw a message that says “you chose to play as X” then click ok. I have another function titled character O that like when the user choose to play as O then the computer will play as X and throw a message that says “YOu chose to play as O” then click okay.