X score

O score

Choose AI

Card image cap
smart AI

minimax algorithm is use to calculate the each move possibilities for each tiles that makes the AI unbeatable, good luck!

Card image cap
fool AI

don't worry, this ai just pick a random tiles to choose, beat him up!

test

minimax algorithm is use to calculate the each move possibilities for each tiles that makes the AI unbeatable, good luck!

test

don't worry, this AI is just pick a random tiles to choose, beat him up!

how does it work?

smart AI

The SmartAI use minimax algorithm to predict which next move who gains higher/lower score. in this case, i use the lower score for the O turn, which is required for second turn. minimax algorithm use recursive function to predict next moves and evaluated board by evaluation function(check who winner function) and then the score is returned. the minimax algorithm create exponential branch to predict each moves, which is why it's so unefficient when you use this algorithm for more complex game, like chess and go for example. so you must use other algorithm or more preferably by other people is to add some other algorithm like alpha-beta pruning.

fool AI

this ai is just pick a random tiles to chose which next move. nothing interesting though.

Source Code: https://github.com/NGC-1512/NGC-1512.github.io