### Thread: Tic-Tac-Toe -(MinMax) Play Of The Computer

1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Dec 2012
Posts
2
Rep Power
0

#### Tic-Tac-Toe -(MinMax) Play Of The Computer

Hello!!! I'm a problem how does it algorithm correct for play of the computer ? Where can I change?
Code:
2. Hi! Look at your post. Is it readable? The code tags are good. All on one line is bad.

Here's tic-tac-toe with min/max algorithm.
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Dec 2012
Posts
2
Rep Power
0
I wanted to know how to improve play of the computer . Because when I raise the level of play on the computer instead it should play your best, which does not occur. I put the move on a list of tree increasing it each interaction according to the current board and the level of difficulty. For example, if the level increases it generates more occurrences to measure.

main functions

* Arguments: tab (input) - the board that represents the root of the game tree
* Current
* profundidade (input) - the depth of the game tree
*jogador (input) - the player whose turn
* NovoTab (output) - original board changed to contain the best play

* ConstroiArvore (): Returns a pointer to a game tree

* Arguments: tab (input) - the board that represents the root of the tree depth (input) - the depth of the tree

* Return: pointer to the root of the tree created

* Expands (): Expands a node of the game tree, creating all positions that can be obtained from the board of the node received as argument. The generated we become children of the node received as argument. So, this function is called recursively generated using the nodes as arguments until the desired depth is reached.

* Arguments: p (input / output) - Pointer to the node to be expanded
* Level (entry) - node level
* profundidae (in) - depth expansion

* GeraFilhos (): Returns a pointer to a list of nodes that are children of the node whose board is passed as argument.

* Arguments: tab (input) - the board of which will be generated nodes
* Return: pointer to the list of nodes generated

* AcrescentaNaLista (): Adds a node to the list we received as an argument and returns a pointer to the list plus
* Arguments: list (input / output) - Pointer to the beginning of the list of nodes
* Tab (input) - the board before the move
* Row, column (input) - the row and column where the play will be
* Move (input) - the move to be made (X or O)
*
* Return: pointer to the list node resulting from increased play

* ProcuraMelhorLance (): Looking for the best move in the tree whose root is