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

This topic is 4783 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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.

##### Share on other sites
Great! I kept racking my brains for several hours wondering if that was right or not.. Great to see that it was :)

##### Share on other sites
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.

1. 1
2. 2
3. 3
Rutin
19
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633657
• Total Posts
3013197
×