tic tac toe AI
tic tac toe AI - 1.0
benjamin lee (benjamin)
This is an artificial intelligence algorithm that plays tic tac toe. It is not that complicated but it never loses.
The algorithm for the AI is based on the priority of different kinds of moves,
1: if the AI has is 2 in a row, win
2: if the player has 2 in a row block them
3: move in the square that gives the most possible wining combos
It can tell whether there can be 3 in a row with a list of wining combinations which is probably not the most efficient method but it allows both the AI and the interface to check the status easily. If the player goes first then it is possible to beat it because of a bug involving the way it determines the move for step 3, I will hopefully fix this later.
click to view original size
|tic tac toe AI - 1.0 ||- Mar 25, 2012|
Pygame.org account Comments
If you wish to leave a comment with your pygame.org account, please sign in first.
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
Dec 9, 2013
Dec 5, 2013
Dec 3, 2013
Dec 1, 2013
Nov 30, 2013
Nov 28, 2013
Nov 27, 2013
Nov 25, 2013
Nov 19, 2013
Nov 17, 2013
Nov 16, 2013