Tic-Tac-Toe - Can we create a impossible to win algorithm?
Hope everyone had came across this classic game of Tic Tac Toe, Yes? If you are one of the rare species who says I have no idea.. Don't worry I also didn't have any idea that such a thing existed before I got to know about it from a friend. Just type Tic Tac Toe in Google and you can play it instantly in single player mode against an algorithm in different levels from Easy to Impossible... Fun fact here is, the impossible isn't actually impossible as my friend was able to beat it in 1/7 th of the games.. That's when I thought, "Why not create an impossible version?" When I decided to create it, within few moments of looking at how my friend played, the logic behind it seemed evident. We just have to fill along a row, column or the diagonal with X, while at the same time opposing our opponents moves. The strategy of logic I came up with was just few functions -> check_risk(), next_win(), next_move(),win_move().. (The link for my version of Tic ...