# 5 Favorite Letters

The challenge is actually extremely simple. Pick 5 distinct letters (you can just pick the 5 that allow you the shortest code if you like) and output them to the console. However, the twist is that they must be from the following list:

 AAA      BBBB       CCCC     DDDD      EEEEE     FFFFF      GGG      H   H
A   A     B   B     C         D   D     E         F         G         H   H
AAAAA     BBBB      C         D   D     EEEE      FFFF      G  GG     HHHHH
A   A     B   B     C         D   D     E         F         G   G     H   H
A   A     BBBB       CCCC     DDDD      EEEEE     F          GGG      H   H

IIIII         J     K   K     L         M   M     N   N      OOO
I           J     K  K      L         MM MM     NN  N     O   O
I           J     KKK       L         M M M     N N N     O   O
I       J   J     K  K      L         M   M     N  NN     O   O
IIIII      JJJ      K   K     LLLLL     M   M     N   N      OOO

PPPP       QQQ      RRRR       SSSS     TTTTT     U   U     V   V     W   W
P   P     Q   Q     R   R     S           T       U   U     V   V     W   W
PPPP      Q   Q     RRRR       SSS        T       U   U     V   V     W   W
P         Q  QQ     R  R          S       T       U   U      V V      W W W
P          QQQQ     R   R     SSSS        T        UUU        V        W W

X   X     Y   Y     ZZZZZ
X X       Y Y         Z
X         Y         Z
X X        Y        Z
X   X       Y       ZZZZZ


• 5 of the same letter is not allowed, no repeat choices.
• Each letter must use the capital of itself as the ascii-character to draw it.
• Each letter output must be on the "same line" and have 5 spaces between each letter.
• You may choose any 5 letters that you want, this will allow you to reuse some code and lower your byte count. Figuring out which letters will allow you to do this most efficiently is part of the challenge.
• Trailing spaces are acceptable.
• A single trailing newline is acceptable, no more than one trailing newline though.
• This is code-golf, lowest byte-count wins.

# Examples:

A B C D E

 AAA      BBBB       CCCC     DDDD      EEEEE
A   A     B   B     C         D   D     E
AAAAA     BBBB      C         D   D     EEEE
A   A     B   B     C         D   D     E
A   A     BBBB       CCCC     DDDD      EEEEE


E F L I P

EEEEE     FFFFF     L         IIIII     PPPP
E         F         L           I       P   P
EEEE      FFFF      L           I       PPPP
E         F         L           I       P
EEEEE     F         LLLLL     IIIII     P


C R A Z Y

 CCCC     RRRR       AAA      ZZZZZ     Y   Y
C         R   R     A   A        Z       Y Y
C         RRRR      AAAAA       Z         Y
C         R  R      A   A      Z          Y
CCCC     R   R     A   A     ZZZZZ       Y


Don't be afraid to submit more than one answer with different letters or different strategies each time, this can be accomplished various different ways.

• I like that you get to choose which letters to output; that adds another layer to the golfing. Minor issues with the ASCII art: there's a ton of trailing spaces, and two Js. – ETHproductions Nov 15 '16 at 15:16
• @ETHproductions Rofl, the 2 J's got past both ME and the sandbox, fixing. – Magic Octopus Urn Nov 15 '16 at 15:17
• Can you add a bonus for taking 5 letters as input? – Mukul Kumar Nov 15 '16 at 18:22
• Bonuses are frowned upon and there are too many answers to make a drastic change such as that. But I will give you an upvote ;). – Magic Octopus Urn Nov 15 '16 at 19:05
• @Titus I don't know why you'd need them; trailing makes more sense. If you can logically explain how a limitation of the language you are using and not the logic you've written is causing a leading \n, I will allow it. – Magic Octopus Urn Nov 18 '16 at 14:26

# Jelly,  40  39 bytes (FSLIC)

- Yep, the United States' Federal Savings & Loan Insurance Corporation!

“=;⁻ʋ®Ʋ\⁸d°5ġ$SƲ!ėɠẈvr’ḃ13s9“Ƭß»K¤żⱮŒṙY  Try it online! ### How? A similar method to my other answer (LICTE) but "FSLIC" is in Jelly's dictionary*, making up for the lack of vertical symmetry of the three middle rows which I made use of there. “...’ḃ13s9“Ƭß»K¤żⱮŒṙY - Link: no arguments “...’ - (base 250) number 56608997404020628145427517841908851108342355529865 ḃ13 - to bjective base 13 [5,6,4,5,1,9,5,6,4,1,9,1,9,1,11,1,7,1,4,7,3,6,1,11,1,7,1,1,13,1,5,1,11,1,7,1,1,9,4,6,5,5,5,6,4] s9 - split into nines [[5,6,4,5,1,9,5,6,4],[1,9,1,9,1,11,1,7,1],[4,7,3,6,1,11,1,7,1],[1,13,1,5,1,11,1,7,1],[1,9,4,6,5,5,5,6,4]] ¤ - nilad followed by link(s) as a nilad: “Ƭß» - list of characters "FSLIC" K - join with spaces "F S L I C" Ɱ - map across (the lists of numbers) applying: ż - zip [[['F',5],[' ',6],['S',4],[' ',5],['L',1],[' ',9],['I',5],[' ',6],['C',4]],...] Œṙ - run-length decode ["FFFFF SSSS L IIIII CCCC",...] Y - join with newline characters  * In fact it is the only dictionary entry with five (or more) distinct capital letters with single runs on every row (CEFILSTZ, as required by the method), and it also happens to start with one which is also a flat-left letter (EFL, again as required for the method). # brainfuck, 380 371 351 bytes Edit: -9 bytes by switching to multiples of 17 and combining printing the first line with correcting the offsets Edit: -20 by just using one cell to store the letters, you moron past me +[[-<+>>++<]>]<<<++....<.......>+....<.....>++.....<......>++...<......>-.....----<<------.>>.<...>.<.....>+.<.........>++.<.........>++.<.........>-.----<<.>>.....<.....>+.<.........>++....<......>++.<..>..<.....>-....----<<.>>.<...>.<.....>+.<.........>++.<.........>++.<...>.<.....>-.----<<.>>....<.......>+....<.....>++.....<......>++...<......>-.  Try it online! The best thing about this code is that it vaguely represents the actual letter themselves when the appropriate whitespace is added. # How It Works Sets up the tape in the format: 1 2 4 8 16 32 64 128 0 0' +[[-<+>>++<]>] ....<. ..... .>+.... <..... >++..... <..... .>++...<. ..... >-..... ----<<------.>> .<...>.<.....>+.<.... ..... >++.<.... ..... >++.<.... ..... >-. ----<<.>> ..... <..... >+.<.... ..... >++....<. ..... >++.<..>..<.....>-.... ----<<.>> .<...>.<.....>+.<.... ..... >++.<.... ..... >++.<...>.<..... >-. ----<<.>> ....<. ..... .>+....< ..... >++.....< ..... .>++...<. ..... >-.  ## PHP, 246 bytes (EFOIH) $q='~([A-Z';$r='preg_replace';$c=$r.'_callback';$m=' 7I 7O"';$v='E 9F 9H"'.$m;echo $r("$q])\"~", '$1$1', $c("$q\s])([1-9])~",function($m){return str_repeat($m[1],$m[2]);},'E5 5F5 5H" 5I5 6O3 '.$v.'
E4 6F4 6H5'.$m.' '.$v.'
E5 5F 9H" 5I5 6O3'));


Which prints:

EEEEE     FFFFF     H   H     IIIII      OOO
E         F         H   H       I       O   O
EEEE      FFFF      HHHHH       I       O   O
E         F         H   H       I       O   O
EEEEE     F         H   H     IIIII      OOO


# Scala, 122 bytes (DIOCL)

()=>{val t="DDDDgIIIIIgOOOhCCCCfL"
val m="DdDhIhOdOfCjL\n"
t+"\n"+m+m+m+t+"L"*4 map(c=>if(c<90)c else " "*(c-97))mkString}


Explanation:

()=>{                          //define an anonymous function with no args
val t="DDDDgIIIIIgOOOhCCCCfL"  //define these strings
val m="DdDhIhOdOfCjL\n"
t+"\n"+m+m+m+t+"L"*4           //return this string
map(c=>                        //map each char...
if(c<90)                       //if it's an uppercase letter
c                              //...to itself
else                           //else
" "*(c-97)                     //...to a space repeated (the index of c in the latin alphabet) times
)mkString}                     //and join the mix of chars and strings together


# PHP, 124 bytes (ABCDE+FHOPSTU)

This version works for all characters where the middle three pixels are either all set or all empty, except for J, which would require an additional case for the ternary mapping.

for(;$x="2636755454764565545456367"[$i];)echo strtr(sprintf("%5b     ",($x&7)+($x>5?24:12)),[" ",ABCDE[$i%5]]),"\n"[++$i%5];


The string contains octal representations of the character lines; the middle bit is used three times: ($x&7)+($x>5?24:12) is short for (4&$x)*4|($x&2)*7|$x&1, but that does not work for 001. sprintf converts to binary (it is shorter here to add the 5 spaces literally than shifting the number (that would require additional parentheses); and strtr replaces 0 with space and 1 with the letter, like in my other answer. Again, looping through a string saves a couple of bytes from looping through an array of integers, in this case 20 bytes. # PHP, 123 bytes (TIDOC) I wanted a purely calculating variant ... ITDOC would have cost another 7 bytes, unfortunately. for(;$i<25;)echo strtr(sprintf("%10b",$i>4&$i<21?$p>1?18.5-$p/2:4:($p>2?$p+11:31.5-$p/2)),[" ",TIDOC[$p]]),"\n"[$p=++$i%5];


the .5s ruin it all ... nothing saved from the partly mapping version:

for(;$i<25;)echo strtr(sprintf("%10b",($i>4&$i<21?[4,4,17,17,16]:[31,31,30,14,15])[$p=$i++%5]),[" ",TIDOC[$p]]),"\n"[$p<4];  # PHP, 109 bytes (LHKNM+BDEFP) Talking about looping over a single value ... take a hex string as value (LHKNM): for(;$i<25;)echo strtr(decbin(16+hexdec("011110129b0fc5501231f1111"[$i])<<5),[" ",LHKNN[$i%5]]),"\n"[++$i%5];  ## PHP, 122 bytes foreach([4369,4763,64597,4657,987409]as$x)for($i=5;$i--;$x>>=4)echo strtr(decbin(512|32*$x&480),[" ",LHKMN[$i]]),"\n"[$i];


This exploits that all used letters have all pixels set in the first column:

The integer array holds the values for the other pixels converted from binary to decimal.
I didn´t test, but I think I have the shortest decimals possible.

In the loop body, the missing first column and the 5 spaces are added to the value before converting it back to binary; after that, 0 is replaced with space and 1 with space the letter (MNKHL).

I just noticed: If I had a 128 bit system; I could do a single loop over just one value :D

# CJam, 46 bytes, FPLHB

"\x1ca-8
6"512b4b{2bEbG+32*2b}%5/"FPLHB"f.f{S?}N*


Replace \x1c with the actual byte.

Try it online!

Output:

DDDDD     PPPP      L         H   H     BBBB
D         P   P     L         H   H     B   B
DDDD      PPPP      L         HHHHH     BBBB
D         P         L         H   H     B   B
D         P         LLLLL     H   H     BBBB


This seems golfable.

# Python 3, 153138136133 130 bytes

for l in"ffffbjfff blbhblbhb eibhblbhe blbhblbhb bjfffhbhf".split():print("".join("F I L T E"[i]*(ord(l[i])-97)for i in range(9)))


or for 128 bytes

for l in"           ".split(" "):print("".join("F I L T E"[i]*ord(l[i])for i in range(9)))


this uses the first 11 characters instead, which don't show up on stackoverflow, this does compile and run though.

## Output:

FFFFF     IIIII     L         TTTTT     EEEEE
F           I       L           T       E
FFFF        I       L           T       EEEE
F           I       L           T       E
F         IIIII     LLLLL       T       EEEEE


This is a quick attempt, I was thinking of seeing if I could generate the numbers in the list without just writing them out. I picked letters which didn't had any "gaps" horizontally (e.g. H wouldn't work) which are FILTECZ.

Annoyingly it's lengthened by some of the gaps being 11 (two characters), not sure if there's a combination with makes it only gaps 9 and less, would shorten it to 125 chars

saved some bytes by using adding i%2*3

saved 2 bytes by using split() instead of a list

saved 3 bytes by using ord instead of i%2*3, would be great if I didn't have to -97 but using the first characters doesn't seem to work with split() well

saved 2 bytes by using range instead of enumerate

can save 2 bytes by using the first characters, to generate the string required you can use the following code snippet, but I'm not sure if this is allowed!

alpha="".join(chr(i) for i in range(20))
def convert(s):
new_s = ""
for c in s:
if c == " ":
new_s += c
else:
n = 11
if c != "x": n = int(c)
new_s += alpha[n]
return new_s
print(convert("555519555 1x171x171 48171x174 1x171x171 195557175"))

• L before Move L after T and all 11 gaps are removed. – Magic Octopus Urn Nov 21 '16 at 14:32
• @carusocomputing second row F to I would still be 11 – Billyoyo Nov 21 '16 at 17:08
• Errr, I know there's a combination of those letters that does accomplish it. My initial strategy was the exact same as yours. – Magic Octopus Urn Nov 21 '16 at 17:11
• there are combinations that would allow for this, but due to the way I've done it, the first character has to have a straight vertical edge at the start, so there are no leading spaces (like F). Because of this I don't think it's possible to get below 11. – Billyoyo Nov 21 '16 at 18:27

# Jelly, 43 bytes

Bs5ŒḄ;ÆP$× “BỊ“z£“qġ“z¤“Eḃ’ç"5R¤o-51+83ỌẎZY  Try it online! Maybe this could be shorter, I'm not good at compressing stuff in Jelly. Bs5 Convert to binary, split into three 5-bit chunks. ŒḄ Bounce: turn [α, β, γ] into [α, β, γ, β, α]. ;ÆP$             Concat by is-prime. This turns our 5×5 binary matrix
into a 10×5 binary matrix, padding with zeroes.
×            Multiply by the right argument.

“BỊ“z£“qġ“z¤“Eḃ’      The list 16927,30753,28737,30754,17732.

…ç"5R¤                Do the above with those numbers and [1, 2, 3, 4, 5].
o-51+83Ọ        Map the resulting matrices to spaces and “TUVWX”.
ẎZY     Stitch them together, and join by newlines.


I thought to make use of the fact that TUVWX is an adjacent run of letters where each letter has horizontal symmetry, making it easy to encode (15 bits per letter).

# C (gcc), 124 bytes

Chose symmetrical letters to try and exploit that somehow. Haven't quite found a way yet.

f(i,j){for(i=0;i<25;printf("%5c",++i%5?32:10))for(j=5;j--;)printf("%c",("QQQQQQQQJJQQQDDQJUJDNDJQD"[i]-64>>j&1)?85+i%5:32);}


Try it online!

• Suggest putchar() for the second printf() and you can ditch the parens before the ?: – ceilingcat Aug 6 '18 at 7:40

# Stax, 4845 44 bytes(DOXHI)

ü⌠_Δs☺₧╞i╥⌂6⌂╤°qû╬╛∟|▀Ig‼£=U╣♪'q÷k╘îî♀P<ç)n½


Run and debug it

Thanks @recursive for -1 byte.

Chosen letters have two (in-plane) 2-fold axes except for "D". If there were another letter with two 2-fold axes the answer would be shorter.

• 0]5* is z5(, which saves a byte even after packing. – recursive Mar 25 '18 at 18:44
• This actually exposes a bug. If I assign the D after palindromizing, it still works while it shouldn't. Maybe the subarrays aren't copied properly upon palindromization. I think we had this issue with transposition, I don't know whether there are more instructions with this issue. – Weijun Zhou Mar 26 '18 at 1:02
• I've found a bunch of inappropriate mutation bugs so far. There are probably many more to go. – recursive Mar 26 '18 at 1:45

# R, 175 or 215

The size to beat is 9×5×5=225 bytes, so...

The obvious (and... surprisingly efficient!) solution in 175 bytes is just to hard-code the lines, noticing that two are identical:

e="        "
y=c(" T",e,"I        C",e,"E",e,"L    \n")
cat(gsub(0,s,c("TTTTT0IIIII0 CCCC0EEEEE0L    \n",y," T    0I  0C    0EEEE 0L    \n",y," T0  IIIII0 CCCC0EEEEE0LLLLL")))


If one needs to prove that he has a Ph.D. in programming, (s)he may use the slightly longer version, still beating the original string length, with the help of run-length encoding (215 bytes).

v=el(strsplit(" T I C E L \n",""))
j=c(2,1,9,1,7,1,9)
f=rep(5,3)
m=matrix(c(0,f,6,4,f,1,4,1,j,1,9,1,4,1,j,4,6,1,4,1,2,1,7,5,6,4,f,5,0,1),4,,T)
m=m[c(1:3,2,4),]
for(r in 1:5)for(i in 1:12)cat(rep(v[i],m[r,i]),sep="")


Premature optimisation is the root of all evil. (D. E. K.)

# Python 2, 171 bytes

Best I could get after 2 hours:

E,s,I,L,T,U,n="E ILTU\n"
S,b,B,D,u=s*5,s*11,s*9,s*7,"U   U"
C,Z=u+n+E,I+D+L+b+T+D
print E*5+S+I*5+S+L+B+T*5+S+C+b+Z+C+E*3+s*8+Z+C+b+Z+U+s*3+U+n+E*5+S+I*5+S+L*5+D+T+s*8+U*3

Try it online!

Outputs:

EEEEE     IIIII     L         TTTTT     U   U
E           I       L           T       U   U
EEEE        I       L           T       U   U
E           I       L           T       U   U
EEEEE     IIIII     LLLLL       T        UUU

# Java 8, 218 bytes (CHLTU)

v->{String s="     ",n="\n",c="C    ",h="H   H",l="L    ",t="  T  ",u="U   U";return" CCCC"+s+h+s+l+s+"TTTTT"+s+u+n+c+s+h+s+l+s+t+s+u+n+c+s+"HHHHH"+s+l+s+t+s+u+n+c+s+h+s+l+s+t+s+u+n+" CCCC"+s+h+s+"LLLLL"+s+t+s+" UUU";}


Explanation:

Try it online.

v->{                 // Method with empty unused parameter and String return-type
String s="     ",  //  String containing five spaces
n="\n",     //  String containing new-line
c="C    ",  //  String for three repeated parts in C
h="H   H",  //  String for four repeated parts in H
l="L    ",  //  String for four repeated parts in L
t="  T  ",  //  String for four repeated parts in T
u="U   U";  //  String for four repeated parts in U
return" CCCC"+s+h+s+l+s+"TTTTT"+s+u+n        //  Line 1
+c+s+h+s+l+s+t+s+u+n                   //  Line 2
+c+s+"HHHHH"+s+l+s+t+s+u+n             //  Line 3
+c+s+h+s+l+s+t+s+u+n                   //  Line 4
+" CCCC"+s+h+s+"LLLLL"+s+t+s+" UUU";}  //  Line 5


At first I was using letters that looked similar and used a replace function with if-checks. This ended up over 400 bytes however, so I dropped it completely instead of trying to golf it.

I then looked at letters with repeated parts. There are four letters with four repeated parts on their five lines: H, L, T and U.
And although I already had them in alphabetic order, it is also the best order for these five letters, because I can omit the trailing space in the bottom part of the U (" UUU "" UUU").

# Powershell, 89 bytes

Inspired by the AdmBorkBork's nice trick.

$d="DDDD5 OOO5 CCCC5IIIII5L" "$d
$("D D5O O5C55 I5 L "*3)$dLLLL"-replace5,'     '


Output:

DDDD       OOO       CCCC     IIIII     L
D   D     O   O     C           I       L
D   D     O   O     C           I       L
D   D     O   O     C           I       L
DDDD       OOO       CCCC     IIIII     LLLLL


# Powershell (without tricks), 106 bytes

Any 5 letters, 25 chars with 5 lower bits as mask:

0..4|%{-join(0..4|%{0..4|%{(' ','GOLFA'[$i%5])[(+'NNA_NAQAAQYQAG_QQAAQNN_AQ'[+$i]-shr$_)%2]}$i++
' '*5})}


Output:

 GGG       OOO      L         FFFFF      AAA
G         O   O     L         F         A   A
G  GG     O   O     L         FFF       AAAAA
G   G     O   O     L         F         A   A
GGG       OOO      LLLLL     F         A   A


# FEU, 83 bytes, DOCIL

a/4\n5554LLLL
m/5/D1D2O1O2C0020I03\n/4/DDDD02OOO02CCCC2IIIII3/3/2L/2/10/1/0 /0/  /g


Try it online!

## Explanation

0, 1, and 2 are for spacing. They're 2, 3, and 5 spaces respectively.

3 starts the letter L.

4 is line 1, and line 5 is just line 1 with 4 extra L's.

5 is line 2, 3, and 4.

# APL (Dyalog Classic), 87 bytes

Decodes 45 vertical lines of 5 types from 15 characters. Converts them to binary matrix and then multiplies it by a coefficient matrix. The final matrix contains indices of letters in a string.

' DILOC'[1+(⊃,/{9\⍪5⍴⍵}¨⍳5)×(⍉5 5⍴(25⍴2)⊤47679)[;1+∊(5 5 5⊤⊢)¯6+⎕AV⍳'ÏSSS9i⌶⌶⌶⌶RSÐSS']]


Output:

DDDD      IIIII     L          OOO       CCCC
D   D       I       L         O   O     C
D   D       I       L         O   O     C
D   D       I       L         O   O     C
DDDD      IIIII     LLLLL      OOO       CCCC


Try it online!

# MAWP, 700 bytes

It would've been real dandy if this question was about 4 characters.

499WA;48W!!;;;499WA;48W!!!!!;;;;;;188WM!!;;;48W!!!!!!;;;;;;;299WA!!;;;48W!!!!!;;;;;;699WM;48W!!;;;699WM;48W!!!!;;;;;199WA!!!;;;;25W;499WA!;;48W;499WA!;;48W!!!!;;;;;188WM;48W!!;;;188WM;48W!!!!;;;;;299WA;48W!!;;;299WA;48W!!!!;;;;;699WM;48W!!;;;699WM;48W!!!!;;;;;199WA;48W!!;;;199WA;25W;499WA;48W;499WA;48W;499WA;48W!!!!;;;;;188WM!!!!;;;;;48W!!!!;;;;;299WA;48W!!;;;299WA;48W!!!!;;;;;699WM;48W!!;;;699WM;48W!!!!;;;;;199WA!!!;;;;25W;499WA;48W!!;;;499WA;48W!!!!;;;;;188WM;48W!!;;;188WM;48W!!!!;;;;;299WA;48W!!;;;299WA;48W!!!!;;;;;699WM;48W;699WM;48W;699WM;48W!!!!;;;;;199WA;25W;499WA;48W!!;;;499WA;48W!!!!;;;;;188WM;48W!!;;;188WM;48W!!!!!;;;;;;299WA!!;;;48W!!!!!!;;;;;;;699WM;48W;699WM;48W!!!!!;;;;;;199WA;


Made with the help of Kevin Cruijssen's MAWP string generator and a lot patience and exclamation marks.

## Output:

M   M      AAA       OOO      W   W     PPPP
MM MM     A   A     O   O     W   W     P   P
M M M     AAAAA     O   O     W   W     PPPP
M   M     A   A     O   O     W W W     P
M   M     A   A      OOO       W W      P
`

Try it!

• I can view transcript, but I can't access the chatting page. (Any ideas?) – null Aug 14 '20 at 6:12
• i meant cookies – Razetime Aug 14 '20 at 12:53