Last active
February 4, 2017 10:04
-
-
Save ahmaxed/e471a28245565df0dc11ef1df2c75446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// checks for the terminal states such as win, lose, and tie | |
//and returning a value accordingly | |
if (winning(newBoard, huPlayer)){ | |
return {score:-10}; | |
} | |
else if (winning(newBoard, aiPlayer)){ | |
return {score:10}; | |
} | |
else if (availSpots.length === 0){ | |
return {score:0}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment