Skip to main content

Posts

Showing posts from July, 2018

CuriousTacToe - Devlog

Hey guys! Thanks for checking out my version of the simple ‘tic-tac-toe’ game. This is the first app I’ve ever made in Kotlin (Android Studio)and would like to tell you a little bit about how it works.
Just incase you didn't land up here after trying the app, you can download the apk here.
So, how does it work?
To start with, each time the player clicks on the box, the computer plays a move according to a sweet tiny algorithm, that makes the computer play the almost-best-possible move.

This is how the 'sweet tiny algorithm' thinks-
Oh okay, the player has played his chance, now its my chance.Let’s see if I can win the game in the next move, if yes, I must play that move.If not, let me check if the player can win in the next move, if yes, then I’ll block it.And surprisingly, that's all that the comp does to defeata human opponent in almost every match!

As you may notice, The last two points are practically useless for the first move, since no one can win in just two moves.
But …