Skip to content

Instantly share code, notes, and snippets.

@kaievns
Created February 24, 2019 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaievns/3b6fabeab3378a38f3b2965090b96679 to your computer and use it in GitHub Desktop.
Save kaievns/3b6fabeab3378a38f3b2965090b96679 to your computer and use it in GitHub Desktop.
let solution = 'a'...'z'; // <- the end solution;
let currentSolution = 'z'...'a';
while (grade(currrentSolution) < '100%') {
let generation = randomlyMutate(currentSolution, { times: 10 });
let bestInGeneration = pickBestSolutionIn(generation);
currentSolution = bestInGeneration;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment