Tic-Tac-Toe [Archive] - C Board

PDA

View Full Version : Tic-Tac-Toe


CodeMonkey
06-17-2005, 10:29 PM
I've written two logical algorithms for tictactoe. One is if the computer is going first, and the other is for if the user player is going first. The way I formed them (not dealing with a computer yet) was in a basic "do this, then base next move on what they do" basis. I'm wondering how I can get that to translate into a function that accepts a boardstate and acts upon at any state. It's not a translation I can make directly, do you know what I mean? Any suggestions would be helpful. I don't want to use another algorithm.

IfYouSaySo
06-20-2005, 03:29 PM
why would you avoid using minimax. It is exactly the algorithm you are looking for. I have a full implementation already in the AI threads. You could just take the minimax implementation, and provide your own board representation.

Ruski
06-23-2005, 11:51 AM
ugh.. I'm new to this stuff.. but what exactly is minimax?

The Brain
06-23-2005, 12:40 PM
faq. (http://www.cprogramming.com/tutorial/AI/minimaxtree1.html)