Skip to content

Instantly share code, notes, and snippets.

View grantmwilliams's full-sized avatar

Grant Williams grantmwilliams

View GitHub Profile
%% Monkey Evolutionary Algorithm
clear;close all;clc;
tic
target = ('MORE GIDDY IN MY DESIRES THAN A MONKEY');
ideal = double(target);
best = inf;
Gen = 0;
phrase = randi([min(ideal) max(ideal)],1,length(target));
for Gen = 1:1e6 %arbitrarily large
% Monkey 1
%% Standard Genetic Algorithm -- Solves For A User Input String
clear;close all;clc; %Clears variables, closes windows, and clears the command window
tic % Begins the timer
%% Select Target String
target = 'Hello, world!';
% *Can Be Any String With Any Values and Any Length!*
%% Parameters