#36 Mutating the Mutation of Strings into Weasels (methinks_meta.rb)

This script uses the previous one, methinks.rb, so make sure you understand how that one works before trying this one, methinks_meta.rb. This script uses techniques similar to those used in methinks.rb to find the “best” input parameters for methinks.rb.

The previous script’s performance (the number of generations it takes to match the target) can vary greatly from one run to the next. Two major factors affect that variation in our results: The first factor is the set of arbitrary starting parameters. We saw that a target of hello was much easier to reach quickly than a target of methinksitislikeaweasel. Using other values for :mutation_rate or the other parameters also has an ...

Get Ruby by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.