genetical algorithm to generate perfect nim AI