Tic-tac-toe may be a more simplair version of other games. But there are many strategies you have to solve in order to make an ai that cannot be beaten.
There are a total of like 10 or 12 different variations of two way problems.
That yea, if you solve the hard-coded way is easy.
But thats bad programming.
You gotta find algorithms that solve anything thrown at you and it should work on nxn sized boards where n is any given number from 0 to infinity.
My code doesn't do that.
Hard-coding solutions to ai is bad programming and bad ai.
I hard-coded my solutions simply because i just wanted to have it done. Many people solve tic-tac-toe over and over again when practicing artificial intelligence because its easy software to recreate because the game IS simple.
Chess ai and checkers ai, most of it is hardcoded and not really ai.
There are tons of ai you would consider "good" but in reality its terrible.