Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,17 @@
target = "METHINKS IT IS LIKE A WEASEL";
alphabet = Append[CharacterRange["A", "Z"], " "];
fitness = HammingDistance[target, #] &;
mutate[str_String, rate_ : 0.01] := StringReplace[
str,
_ /; RandomReal[] < rate :> RandomChoice[alphabet]
]
mutationRate = 0.02; c = 100;
NestWhileList[
First@MinimalBy[
Thread[mutate[ConstantArray[#, c], mutationRate]],
fitness
] &,
mutate[target, 1],
fitness@# > 0 &
] // ListAnimate