The runs will be:
- The mystery for 5 weeks.
- The farce for 8 weeks.
- The historical drama for 3 weeks.
- The musical for 6 weeks.
in that order.
In the program below, m represents musical, d is drama, and y represents mystery.
clc
genres=perms('fmyd');
lengths=perms([3 5 6 8]);
for g=1:length(genres)
genre=genres(g,:);
for l=1:length(lengths)
len=lengths(l,:);
season='';
for i=1:4
season=[season repmat(genre(i),[1,len(i)])];
end
if season(15)~='m'
f=strfind(season,season(13));
if f(end)<17
if season(14)=='d' && season(10)=='f'
if strfind(genre,'m')>strfind(genre,'y')
myst=strfind(genre,'y');
mystl=len(myst);
drama=strfind(genre,'d');
dramal=len(drama);
farce=strfind(genre,'f');
farcel=len(farce);
if mystl>dramal && mystl<farcel
disp(season)
disp('1234567890123456789012')
disp(genre)
disp(len)
end
end
end
end
end
end
end
yyyyyffffffffdddmmmmmm
1234567890123456789012
yfdm
5 8 3 6
|