A simple genetic algorithm written in Scala