A python implementation of Tic Tac Toe using a genetic algorithm to create a lossless game strategy.
The code, prints out an array of 765 pairs of integers. The first column being numbers 1-765 and the second column indicating what state should the player go from the state indicated in the first column. There are other things you could easily print by adding a couple lines to the code. Some of the examples are:
- Individuals from each generation
- Base Case States
- Selected Individuals From Each Generation
This code, implements the algorithm explaind by This Paper basically but changing the selection and mutation functions. It can be better to change crossover functions as well to remove positional bias.
There is also a c++ implementation of this algorithm by @github/SamanKhamesian using a different selection, mutation and crossover but using the same implementation for the game.