The weasel program or Dawkins' weasel is a thought experiment and a variety of computer simulations illustrating it. Their aim is to demonstrate that the process that drives evolutionary systems—random variation combined with non-random cumulative selection—is different from pure chance. Click Flag to begin
What the code does 1. Start with a random string of 28 characters. 2. Make 100 copies of the string (reproduce). 3. For each character in each of the 100 copies, with a probability of 5%, replace (mutate) the character with a new random character. 4. Compare each new string with the target string "METHINKS IT IS LIKE A WEASEL", and give each a score (the number of letters in the string that are in the correct position). 5. If any of the new strings have a perfect score (28), halt. Otherwise, take the highest-scoring string, and go back to step 2 Credits: Thought experiment and original simulation by Richard Dawkins. I recommend his book, The Blind Watchmaker - https://www.amazon.com/Blind-Watchmaker-Evidence-Evolution-Universe/dp/0393351491 All code in this version was written by me. Although I have credit to give to people for their ideas which made this possible Credit to Credit to Ben* for the idea of a {string generated so far} variable. https://scratch.mit.edu/users/ChessGrandmaster10/ for the idea of using a list variable. Without these ideas the code would have been close to 10,000 blocks, likely more than scratch can handle. Thus I am indebted to these people for this codes ability to run. Thank you. Credit to Wikipedia for the description of the code. *Name changed for privacy See this project's sister project attempting to create the target phrase by random chance alone. https://scratch.mit.edu/projects/760783667/