Skip to content

teochewthunder/tictactoe-vday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Tic-tac-toe Valentine's Day Edition

This is a more intelligent version of the previous Tic-tac-toe code. Normally, I would simply make another branch, but since this is new functionality rather than a "patch", a new repository seems more appropriate.

CSS and Flavor Text

These are not really essential upgrades, but fun to have for the Valentines Day theme.

Intelligence

This comes in the form of more checks. Initially, when the computer takes its turn, it simply places its marker on a random unclaimed square on the board. Now, the priosirites have shifted.

Firstl Priority: WIN

Now, it checks through the winPatterns array for win conditions where a taken turn would immediately win the game.

Second Priority: STOP YOU FROM WINNING

If no win condition exists, it checks for a win condition for you, and places its marker there to "block".

Last Priority

If the above is false, then it randomly chooses a square to play.

Note: Again, this does not work on Internet Explorer and Safari

About

Valentine's Day Edition of Tic-tac-toe, with simulated intelligence

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages