TIC TAC TOE
Update 03/16/05
I have changed the GA so that it evolves the weights of the patterns instead
of the patterns themselves. I also have changed the evaluation of 'almost
wins' so that they are determined by moves contributing to a win, instead
of explicitly defining all of them. I have re - organized the code so that
I can now evolve against my minimax player. The code is here .
I am also about 1/3 through Blondie24
Update 03/09/05
I have spent some time analyzing how I learn to play games. Its available Here
Update 03/02/05
I have stand alone code that does a minimax tree for the tic tac toe
game. It plays to a draw. I need to get the code integrated into the
existing GA code.
Current code:
patterns.h
MinMax.cpp
MinMaxNodes.cpp
MinMaxNodes.h
Makefile
Update 02/24/05
Co-Evolution is working. However it seems as though there is an eval problem.
I believe this to be that when checking for a placement that results in 2
tokens contributing to a win, I am not checking to see if there is another
player in the remaining space.
Current code:
patterns.h
main.cpp
TicTacToe.cpp
TicTacToe.h
Makefile
Update 02/21/05
Now I can evolve a strategy. Co-Evolution is not taking place. Against my
Hand coded perfect player, I acheive an average score of 95239 against the
player who just choses a random place. Evolving the strategy for the player
gives an average score of 86329. The average score for rand vs rand is right
around 50000.
Current code:
patterns.h
main.cpp
TicTacToe.cpp
TicTacToe.h
The goal here is to co-evolve a tic tac toe player. Currently, I have
a tic tac toe game that plays against itself. It does not really
learn anything, as I have given it weights so it knows what is the
correct move to make. Not surprisingly, it always ends in a draw.
When the game is deciding where to place a piece, it evaluates all
possible moves, and takes the move with the highest score. Scores are as follows:
Make a Win: 10Pts
Block: 8Pts
Get 2 in a row: 6Pts
You can download the source files here