Golfing A Weasel Program 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 &quot;METHINKS IT IS LIKE A WEASEL&quot;, 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!
APL (143)

0{⍵≢T←'METHINKS IT IS LIKE A WEASEL':c∇⍨1+⍺⊣⎕←(⍕⍺),':'c'-- score:',s⊣c←⊃c/⍨G=s←⌈/G←{+/⍵=T}¨c←{⍵{⍵:⍺⋄C[?27]}¨9≠?28/20}¨100⍴⊂⍵}⊃∘(C←27↑⎕A)¨?28/27


Explanation:


0{...}⊃∘(C←27↑⎕A)¨?28/27: set C to the first 27 capital letters. There are only 26, so the 27th element will be a space. Select 28 random items from C. This will be the first ⍵. The first ⍺ (generation) will be 0.
⍵≢T←'METHINKS IT IS LIKE A WEASEL: set T to the string 'METHINKS IT IS LIKE A WEASEL'. As long as ⍵ is not equal to T:


{...}¨100⍴⊂⍵: Make 100 copies of ⍵. For each of these...

9≠?28/20: select 28 random numbers from 1 to 20. Make a bitmask where each 1 means that the random number was not equal to 9. (This means 5% chance of a 0). 
⍵{⍵:⍺⋄C[?27]}¨: for each letter in ⍵, if the corresponding bit was 1, keep that letter, otherwise replace it with a randomly chosen element from C.

c←: store the 100 mutated strings in c.
G←{+/⍵=T}¨c: for each element in c, calculate the score (amount of characters that match T) and store the scores in G.
s←⌈/G: find the maximum score and store that in s.
c←⊃c/⍨G=s: select the first item from c whose score is equal to s (the maximum), and store it in c again.
⎕←(⍕⍺),':'c'-- score:',s: print the generation in the given format (⍺ is current generation, c is current best string, s is score)
c∇⍨1+⍺: Increment the generation and run the mutation again using the current best string (c) as input.