# The Challenge:

Print every 2 letter word acceptable in Scrabble using as few bytes as possible. I have created a text file list here. See also below. There are 101 words. No word starts with C or V. Creative, even if nonoptimal, solutions are encouraged.

AA
AB
...
ZA


# Rules:

• The outputted words must be separated somehow.
• Case does not matter, but should be consistent.
• Trailing spaces and newlines are allowed. No other characters should be outputted.
• The program should not take any input. External resources (dictionaries) cannot be used.
• No standard loopholes.

Wordlist:

AA AB AD AE AG AH AI AL AM AN AR AS AT AW AX AY
BA BE BI BO BY
DE DO
ED EF EH EL EM EN ER ES ET EX
FA FE
GO
HA HE HI HM HO
ID IF IN IS IT
JO
KA KI
LA LI LO
MA ME MI MM MO MU MY
NA NE NO NU
OD OE OF OH OI OM ON OP OR OS OW OX OY
PA PE PI
QI
RE
SH SI SO
TA TI TO
UH UM UN UP US UT
WE WO
XI XU
YA YE YO
ZA

• Do the words have to be outputted in the same order? – Sp3000 Aug 13 '15 at 3:26
• @Sp3000 I'll say no, if something interesting can be thought up – qwr Aug 13 '15 at 3:29
• Please clarify what exactly counts as separated somehow. Does it have to be whitespace? If so, would non-breaking spaces be allowed? – Dennis Aug 13 '15 at 14:14
• Ok, found a translation – Mikey Mouse Aug 13 '15 at 15:16
• Vi isn't a word? News to me... – jmoreno Aug 15 '15 at 15:23

# Python 2, 202 200 bytes

for s in'AABALIFEN KITOELOPE LAYAINUNEREMI AMANAHI MOHMYEX UPI UTAGOFAWOWETI BY OR BI ZAXI PAS BE AD AEDEHAT QI UMMUS JOIDONOSHOYOD BOMESISOXUHEF KAR'.split():
for i in range(len(s)-1):print s[i:i+2]


Try it online!

Try to join up overlapping pairs; i.e. ZAXI encodes ZA, AX, XI. Looks like 140 bytes of encoded text is about the best possible with this approach.

• 140 bytes is the theoretical limit for this approach. – Joel Aug 30 '19 at 2:43

# F#, 205 bytes

Seq.iteri(fun i s->Seq.iter(printf"%c%c "((char)i+'A'))s;printfn"")("ABDEGHILMNRSTWXY AEIOY  EO DFHLMNRSTX AE O AEIMO DFNST O AI AIO AEIMOUY AEOU DEFHIMNPRSWXY AEI I E HIO AIO HMNPST  EO IU AEO A".Split())


scala, 223 bytes

print(("AABDEGHILMNRSTWXY BAEIOY DEO EDFHLMNRSTX FAE GO HAEIMO IDFNST JO KAI LAIO MAEIMOUY NAEOU ODEFHIMNPRSWXY PAEI QI RE SHIO TAIO UHMNPST WEO XIU YAEO ZA".split(" ").flatMap(a=>a.tail.map(a(0).toString+_))).mkString(" "))


Not especially compact, but vaguely idiomatic .. eval with

scala -e '...'


# Java, 288

class E{public static void main(String[]a){a="ABDEGHILMNRSTWXY,AEIOY,,EO,DFHLMNRSTX,AE,O,AEIMO,DFNST,O,AI,AIO,AEIMOUY,AEOU,DEFHIMNPRSWXY,AEI,I,E,HIO,AIO,HMNPST,,EO,IU,AEO,A".split(",");for(int i=26,j;i-->0;)for(j=0;j<a[i].length();)System.out.println((char)('A'+i)+""+a[i].charAt(j++));}}


By just stringing together the second letters of each word (plus a delimiter), you just loop through while keeping track of the first. Not as fancy as the base-encoded versions, but much simpler and a good score for Java. Prints in order by descending-first-letter (ZA YA YE YO XI XU), one word per line.

With line breaks:

class E{
public static void main(String[]a){
a="ABDEGHILMNRSTWXY,AEIOY,,EO,DFHLMNRSTX,AE,O,AEIMO,DFNST,O,AI,AIO,AEIMOUY,AEOU,DEFHIMNPRSWXY,AEI,I,E,HIO,AIO,HMNPST,,EO,IU,AEO,A".split(",");
for(int i=26,j;i-->0;)
for(j=0;j<a[i].length();)
System.out.println((char)('A'+i)+""+a[i].charAt(j++));
}
}


# Python 239 bytes

import re;f=lambdax:''.join(re.findall('..',x));a,b='ABAHALAMANATAYDEDOEFEHEMENERHOISITMOMUNONUOSOWOY','AAADAEAGAIARASAWAXBEBIBOBYELESETEXFAGOHIHMIDIFINJOKAKILILOMIMMMYOEOFOIOPOROXPAPEPIQISHTOUHUPUSUTWEXIXUYEZA';print f(a),f(a[::-1]),f(b)


This is a bit long, but I've given it a try. I've counted all the patterns that also have the reversed counterparts. Ex) 'AB'/'BA' and so on.

## Python 3, 248 bytes

e=enumerate
[print(*(chr(x+65)+chr(j+65)+" "for j,i in e(bin(k)[2:])if int(i)))for x,k in e([30292443,16793873,0,16400,9320616,17,16384,20753,794664,16384,257,16641,17846545,1064977,29798840,273,256,16,16768,16641, 831616,0,16400,1048832,16401,1])]


The numbers were generated by an additional script
I'm sure that it can be optimized further

# Retina, 167 bytes (non-competing)


¶AABDEGHIcWXY¶BbOY¶DEaEDFHcX¶FAE¶GaHbMaIDFNST¶JaKAI¶LAIaMbMOUY¶NAEOU¶ODEFHIMNPRSWXY¶Pb¶QI¶RE¶SHIaTAIaUHMNPST¶WEaXIU¶YAEaZA
c
LMNRST
b
AEI
a
O¶
+(¶(.)\S+)(\S)
$1$2$3  Try it online! # C# (Visual C# Interactive Compiler), 208 bytes ()=>"ABDEGHILMNRSTWXY,AEIOY,EO,DFHLMNRSTX,AE,O,AEIMO,DFNST,O,AI,AIO,AEIMOUY,AEOU,DEFHIMNPRSWXY,AEI,I,E,HIO,AIO,HMNPST,EO,IU,AEO,A".Split(',').SelectMany((x,y)=>x.Select(z=>""+"ABDEFGHIJKLMNOPQRSTUWXYZ"[y]+z))  Try it online! # PHP, 187 bytes for($n=A,$l=ABDEGHILMNRSTWXYAEIOY1EODFHLMNRSTXAEGOAEIMODFNS2TOAIAIOAEIMOUYAEOUDEFFHIMNPRSWXYAEI3IE4HIOAIOHMNPST5EOIUAEOA;$q=$l[$x++];){if($q<A)$n++;else{if($q<$p)$n++;$p=$q;echo"$n\$q
";}}
`

Try it online!

Basically, the list is mostly just the second letters in the word list - I noticed in almost all cases, when incrementing the first letter, the second letter is before the one before it. For example going from AY to BA, A is before Y in the alphabet, and going from QI to RE, E is before I in the alphabet. In the very few cases where the second letter was the same or after the previous one, or to skip C and V, I put a number in the string so it knows to increment the first letter.