While researching and writing a completely different tutorial, I came across a really fun video by a YouTuber named Code Bullet. In the video, he shows viewers how to teach an A.I. agent to learn how to play Flappy Birds using a genetic algorithm named NeuroEvolution of Augmenting Topologies, or better known as NEAT. Now, I'd never heard of NEAT let alone genetic algorithm, but after watching the video, I was very curious about how it worked.
In this tutorial, you're going to work through a writing the code for a very basic genetic algorithm using Swift. The final project uses SwiftUI to help illustrate the point.