public void FromParent(Keys a, Keys b) { Neat child = null; Neat parent = null; foreach (Neat n in bots) { if (n.Key == a) { child = n; } if (n.Key == b) { parent = n; } if (child != null && parent != null) { break; } } child.FromParents(parent, null); // Print child //Console.WriteLine("---------------------------"); //Console.WriteLine(a); foreach (Gene gene in child.Genes) { Console.WriteLine(gene); } }