Tic-Tac-Toe & min-max algorithms..

Started by
2 comments, last by RunningInt 18 years, 5 months ago
Sorry for making another thread, I tried deleting or editing the other thread, but it just won't let me : Here's my question: Tic-Tac-Toe is a zero sum game, correct? That means if all players play to their best, there'll be no winner, right? Well, I'm just wondering if it's normal behaviour for my min-max function to return the value of '0' as the best move when the computer is making the first move? (Winning boards are +100 and losing boards -100) It usually ends up in move 1 (the upper left) and while I still haven't been able to beat my AI, doesn't mean it's right.. Any input?
Advertisement
A zero sum game means that the sum of the player results at the end of the game must total to zero. That doesn't mean that if all players play their best there will be no winner. It is possible to have a zero sum game where one player has an advantage and will always win if both players play their best.

Anyways, for Tic Tac Toe, the first move will always have a 0 value if solved by min-max because there is no way to make a first move that will guarantee a win.
Great! I kept racking my brains for several hours wondering if that was right or not.. Great to see that it was :)
I once wasted a two hour maths class working through every possible line of that game

Hint: If you are starting put your mark in one of the corners. If your opponent does not respond by putting theirs in the center then you can force a win.

This topic is closed to new replies.

Advertisement