Begin *
It looks like an open contest, and so it is indeed.
The input to this puzzle consists of all English letters contained between two asterisks.
Please ignore all the spaces, punctuation marks, digits and special characters like #,&,@ etc and use the remaining letters to create valid English words of 3,4,5, or 6 letters without repeating any word twice or more.
Suppose you end up with A words of 6 letters, B of 5, C of 4 and D of 3. The leftover letters are of no value.
Consider your goal is to maximise the value of 7A+5B+4C+D.
What is your score?
*end
There are 415 letters.
415/6 is over 69, but the highest number of 6-letter words found by the below program selecting random 6-letter words was 66.
rslt=fopen('c:wordswords6.txt')
aline=fgetl(rslt);
rslt2=fclose(rslt)
txt=fopen('c:\vb5 projectslooble\TO6LE~1.TXT')
chars=fgetl(rslt)
rslt2=fclose(txt)
maxi=0
n6=0
while n6<66 % this was the result of trial and error
for i=1:26
ct(i)=0;
end
letct=0;
for i=1:length(chars)
c=lower(extractBetween(chars,i,i));
psn=strfind('abcdefghijklmnopqrstuvwxyz',c);
if psn>0
ct(psn)=ct(psn)+1;
letct=letct+1;
end
end
%for i=1:26
% fprintf('%c %d ',extractBetween("abcdefghijklmnopqrstuvwxyz",i,i),ct(i))
%end
words=length(aline)/6;
psn=0;
let6=['']; n6=0; r=0;
while psn<words-r
r=randi(100);
psn=psn+r;
if psn>words
break
end
w=extractBetween(aline,6*psn-5,6*psn);
wd=char(w(1,1));
for i=1:26
lct(i)=0;
end
good=true;
for i=1:size(wd,2)
c=lower(extractBetween(wd,i,i));
psnl=strfind('abcdefghijklmnopqrstuvwxyz',c);
if psnl>0
lct(psnl)=lct(psnl)+1;
if lct(psnl)>ct(psnl)
good=false;
end
end
end
if good
for i=1:size(wd,2)
c=lower(extractBetween(wd,i,i));
psnl=strfind('abcdefghijklmnopqrstuvwxyz',c);
if psnl>0
ct(psnl)=ct(psnl)-1;
end
end
let6=[let6 w];
n6=n6+1;
end
end
if n6>maxi maxi=n6;
end
disp([n6,maxi])
end
let6
n6
for i=1:26
if ct(i)>0
fprintf('%c %d ',extractBetween("abcdefghijklmnopqrstuvwxyz",i,i),ct(i))
end
end
The output shows the words, the count of those 6-letter words, and the count of each of the remaining letters, left over.
Columns 1 through 5
{'abated'} {'acting'} {'adorns'} {'aglets'} {'alamos'}
Columns 6 through 10
{'alarms'} {'almuds'} {'amount'} {'anears'} {'aortal'}
Columns 11 through 15
{'arbute'} {'arroyo'} {'attach'} {'audial'} {'awning'}
Columns 16 through 20
{'bagman'} {'cagier'} {'canoed'} {'carrot'} {'casked'}
Columns 21 through 25
{'cellar'} {'chinks'} {'chores'} {'cloddy'} {'codify'}
Columns 26 through 30
{'coedit'} {'copier'} {'crenel'} {'cretin'} {'deeply'}
Columns 31 through 35
{'defuse'} {'depths'} {'devils'} {'dinger'} {'divers'}
Columns 36 through 40
{'elopes'} {'enokis'} {'erenow'} {'extent'} {'fester'}
Columns 41 through 45
{'filles'} {'footer'} {'footie'} {'furies'} {'gillie'}
Columns 46 through 50
{'heezes'} {'hereto'} {'hewers'} {'hosels'} {'lifers'}
Columns 51 through 55
{'noesis'} {'onions'} {'onsets'} {'otters'} {'outfit'}
Columns 56 through 60
{'pokies'} {'ponton'} {'pushup'} {'snipes'} {'solion'}
Columns 61 through 64
{'tenuto'} {'tiptop'} {'velvet'} {'whiten'}
n6 =
64
h 2
i 3
k 1
l 1
o 2
s 1
t 12
u 3
w 5
z 1
louts, wit and out leave
h 2
i 2
k 1
t 9
u 1
w 4
z 1
we can get twit, whit, hut and zit
k 1
t 4
w 2
with no vowels left.
64*7 + 5 + 2*4 + 4 = 465
Another run finds
Columns 1 through 5
{'abatis'} {'acedia'} {'adores'} {'agnate'} {'agrafe'}
Columns 6 through 10
{'algoid'} {'alumin'} {'amidic'} {'anergy'} {'apathy'}
Columns 11 through 15
{'arctic'} {'armlet'} {'arseno'} {'artels'} {'atlatl'}
Columns 16 through 20
{'avisos'} {'avoids'} {'bagnio'} {'banyan'} {'caddie'}
Columns 21 through 25
{'caftan'} {'censes'} {'chiels'} {'chitin'} {'churls'}
Columns 26 through 30
{'cleome'} {'clover'} {'coffin'} {'cogito'} {'coleus'}
Columns 31 through 35
{'dewool'} {'dhooly'} {'diploe'} {'dovish'} {'ensoul'}
Columns 36 through 40
{'etudes'} {'filets'} {'filter'} {'fisted'} {'foehns'}
Columns 41 through 45
{'fourth'} {'gentoo'} {'hokums'} {'kernel'} {'ketone'}
Columns 46 through 50
{'kilter'} {'losses'} {'nellie'} {'peewit'} {'pouted'}
Columns 51 through 55
{'ptosis'} {'purine'} {'pursue'} {'reests'} {'repent'}
Columns 56 through 60
{'reshow'} {'rowths'} {'seiser'} {'sestet'} {'setter'}
Columns 61 through 65
{'sexpot'} {'tittup'} {'triter'} {'uproot'} {'worded'}
Column 66
{'zenith'}
n6 =
66
k 1
n 5
o 3
t 5
w 4
z 1
We can add wont, ton and tow. 66*7 + 4 + 2*1 = 468
Added later: replace ton with wonk and make the score 471.
Or better, kowtow is another 6-letter word and you can still use wont: 67*7 + 4 = 473
Edited on January 17, 2021, 12:17 pm
Edited on January 17, 2021, 12:18 pm
|
Posted by Charlie
on 2021-01-17 12:08:48 |