No BSD License  

Highlights from
MATLAB Golf Contest Test Suite

from MATLAB Golf Contest Test Suite by Mike Thomas
Generates the test suites for the MATLAB Golf Contest.

createinfection
function holes = createinfection

holes = [];

% typical infection 
a={'lmLMAlm','bonopa','zzzzFzzzz','CBeqqqfQQQ','RED',...
'gds','xxxICGGGGggggH','Viwiji','Juk','TkH','YyYyY'};
b=1;
c=[1     2     3     4     5     7];


holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% infects all except the isolated 11 
a={'lmLMAlm','bonopa','zzzzFzzzz','CBeqqqfQQQ','RED',...
'gds','xxxICGGGGggggH','Viwiji','Juk','TkH','YyYyY'};
b=7;
c=[1     2     3     4     5     6     7     8     9    10];

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% infects no one 
a={'lmLMAlm','bonopa','zzzzFzzzz','CBeqqqfQQQ','RED',...
   'gds','xxxICGGGGggggH','Viwiji','Juk','TkH','YyYyY'};
b=11;
c=[11];

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% other cases 
a={'lmLMAlm','bonopa','zzzzFzzzz','CBeqqqfQQQ','RED',...
'gds','xxxICGGGGggggH','Viwiji','Juk','TkH','YyYyY'};
b=8;
c=[2     3     4     5     6     7     8     9    10];


holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

a={'lmLMAlm','bonopa','zzzzFzzzz','CBeqqqfQQQ','RED',...
   'gds','xxxICGGGGggggH','Viwiji','Juk','TkH','YyYyY'};
b=9;
c=[4     6     7     8     9    10];

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% will add some connections so it infects all in two spreads 
a={'WlmLMAlm','bonopa','zzzzFzzzz','CBeqqqfQQQ','RED',...
'gds','xxxICGGGGggggH','Viwiji','Juk','TkH','YyYyYW'};
b=7;
c=1:11;

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% will add a common letter to all so all get infected in the first 
a={'WlmLM1Alm','bonXopa','xzzzzFzzzz','CBeqqqfQQQX','RxED',...
'gdXs','xxxICGGGGggggH','Vixwiji','XJuk','TkHX','YyYxyYW'};
b=1;
c=1:11;

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% same as before with other with other start 
a={'WlmLM1Alm','bonXopa','xzzzzFzzzz','CBeqqqfQQQX','RxED',...
'gdXs','xxxICGGGGggggH','Vixwiji','XJuk','TkHX','YyYxyYW'};
b=11;
c=1:11;

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% company of one person
a={'alone'};
b=1;
c=1;

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

% company of two unconnected persons
a={'abcde','FGHI'};
b=2;
c=2;

holes(end+1).a = a;
holes(end).b = b;
holes(end).c = c;

Contact us at files@mathworks.com