At this point I know that I should make 3*3 string grid and then computer will put for example O at random spot. (I can't solve this).
Getting a random spot to start is easy:
Just because I'm bored, I tried some of the games available online. Most of them use pretty terrible algorithms. This is the best I found:
https://www.mathsisfun.com/games/tic-tac-toe.html
If you play against Computer (Hard), and have not had too much to drink, you get winni's solution.
The fun part will working out the AI.
Enjoy,
VTwin
The experiece says:This is exactly how my AI chooses. Not sure why, something is wrong with my heuristic or terminal function maybe. It thinks the corner is the best place to start and despite I never succeed to win against it, I still question why it didn't follow the textbook we used. The center is clearly a better choice as it closes many possibilities for the second player to win.
Start in a corner - otherwise you are lost.