Advertisement

AI for my game (help)

Started by October 15, 2007 07:32 AM
5 comments, last by hydrogen 17 years, 1 month ago
I'm trying to make TicTacToe and have AI. The problem is, I know nothing about it. Does anyone know any good tutorials, articles, resources and theory of AI? Thanks in Advance. PS: Please move it if you think I should post it in the beginner's section.
This type of game, i.e. two players making a single move in turn, is best handled using the minimax algorithm. Google for it, its one of AI's most basic, but most important to know, algorithm.
Advertisement
Minimax is the best option for this case.
good luck man.
Thanks for your replies.

I have read about it on WikiPedia. I couldn't find a very simple example using it though. Does anyone know where to find a simple tutorial(?) with C++ source code?

Cheers.
This is the pseudocode on Wikipedia:

function minimax(node, depth)    if node is a terminal node or depth = CutoffDepth        return the heuristic value of node    if the adversary is to play at node        let beta := +infinite        foreach child of node            beta := min(beta, minimax(child, depth+1))       return beta    else {we are to play at node}        let a := -infinite        foreach child of node            a := max(a, minimax(child, depth+1))       return a


My questions are:
1. What is 'node' ?
2. What does 'CutoofDepth' means?
3. What's beta's purpose?

Those were my main questions, can someone explain how does this algorithm work in simple Engish? (I didn't understand it on Wikipedia)

Thanks, Minas.
Welcome to the freakin' internet, dude.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Advertisement
tic-tac-toe? Just hard code it

This topic is closed to new replies.

Advertisement