Domanda

I am new in AI and I am trying to implement tic tac toe game with minimax algorithm but before get into that I want to check my understanding about implementation:

first at each step of the move according to current state of my grid I create decision tree and after the decision tree is made I will apply minmax to mark the tree and then choose according to that marks find the best next move then again make the decision tree for the chosen move from scratch and apply the minmax again and choose the best move. Here is the pseudo-code that I designed:

move(current state)
{
  tree=make_decision-tree(current state);
  maxminalg(tree);
  choose the best move according to the returned max or min from the tree
  foreach (choice in choosen state)
    move(choice)        
}
make_decision-tree(current state)
{
    ....
}
maxminAlg(decisiontree t)
{
   return max or min
}

My question is if this procedure that I designed is correct (because if it is correct then I can start coding that) and if not what is your suggestion?

È stato utile?

Soluzione

minimax gets SO complicated so fast.

This post really sheds a lot of light on the topic: Simple tic-tac-toe AI

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top