Richard Dawkins in his book The Blind Watchmaker, describes a Weasel program. The algorithm can be described as follows:
Start with a random string of 28 characters. Valid characters are all upppercase letters, and space.
Make 100 copies of that string, with a 5% chance per character of that character being replaced with a random character.
Compare each new string with the target "METHINKS IT IS LIKE A WEASEL", and give each a score according to the number of letters in the string which are correct and in the correct position.
If any of the new strings has a perfect score (28), halt.
Choose the highest-scoring string from step 3. How you work out a tie is up to you, but only one string may be chosen. Take the chosen string and go to step 2.
The winner will be the shortest code snippet to get to the correct answer while printing the highest-scoring string of each generation in the following format:
If people could help by checking other peoples answers would be very helpful!