You don't need to do anything, really. This is a little machine learning test (As the title says). Every purple square is an AI with a "random" brain pattern, and the green square is the best of the last generation. After gen. 1, every purple square follows the same pattern the best of the last generation followed, but adds in a few random "mutations." This allows the AI to adapt and change.
Basically, machine learning is one way that artificial intelligences learn and adapt. This program uses the genetic algorithm to pass "good" traits on to the next generation, and over time, "bad" traits are removed from the species. As the AIs get further in the level, they learn the terrain and gradually get faster at completing it. I allowed the AIs only a few "moves" each generation as well. This means that they need to learn how to maximize their moves before they are allowed more. Finally, the program chooses the best AI based on how far each one got based on a "fitness" score. TL;DR, the AIs learn from themselves, and slowly get better. However, before you say they're "terrible," imagine learning to play a platformer as a newborn. That's about how intelligent they are.