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

Additional Rules:

  • 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.



 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


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    


 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.

  • 21
    \$\begingroup\$ 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. \$\endgroup\$ – ETHproductions Nov 15 '16 at 15:16
  • 2
    \$\begingroup\$ Can you add a bonus for taking 5 letters as input? \$\endgroup\$ – Mukul Kumar Nov 15 '16 at 18:22
  • 5
    \$\begingroup\$ 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 ;). \$\endgroup\$ – Magic Octopus Urn Nov 15 '16 at 19:05
  • 1
    \$\begingroup\$ @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. \$\endgroup\$ – Magic Octopus Urn Nov 18 '16 at 14:26
  • 1
    \$\begingroup\$ @Titus then no. The trailing newlines and spaces are due to programmatic limitations of certain languages. \$\endgroup\$ – Magic Octopus Urn Nov 18 '16 at 17:31

46 Answers 46


Jelly, 41 bytes


141D+“ȷɓSɠ’“ðƁ ƥ“JrŀṘ’jḃ11Ç€ŒṙY



Use a run length decode with letters that have as similar middle as possible with only one run length of each "pixel value" per row per letter.

Put a flat start like "L" to avoid different run length decode values for the rows.

Place the one different letter (could not find 5) of the three middle rows at the end so the smallest difference may be added arithmetically.

Output wanted; the run lengths; and these converted from base 11:

                                                  L,  , I,  , C,  , T,  , E   value
L         IIIII      CCCC     TTTTT     EEEEE     1, 9, 5, 6, 4, 5, 5, 5, 5   399633415
L           I       C           T       E         1,11, 1, 7, 1,11, 1, 7, 1   431646160+1
L           I       C           T       EEEE      1,11, 1, 7, 1,11, 1, 7, 4   431646160+4
L           I       C           T       E         1,11, 1, 7, 1,11, 1, 7, 1   431646160+1
LLLLL     IIIII      CCCC       T       EEEEE     5, 5, 5, 6, 4, 7, 1, 7, 5   1179122455

The three values 399633415, 431646160, and 1179122455 in base 250 as Jelly code page indices are then ðƁ ƥ, ȷɓSɠ, and JrŀṘ which can be used to encapsulate the run-length information.

The code

“LICTE”Kż - Link 1, make a run length encoding for a row of the output: row's run lengths
“LICTE”    - list of characters "LICTE"
       K   - join with spaces   "L I C T E"
        ż  - zip with input     e.g. [['L',1],[' ',9],['I',5],[' ',6],['C',4],[' ',5],['T',5],[' ',5],['E',5]]

141D+“ȷɓSɠ’“ðƁ ƥ“JrŀṘ’jḃ11Ç€ŒṙY - Main link
141D                            - 141 as a decimal list: [1, 4, 1]
     “ȷɓSɠ’                     - 431646160
    +                           - add: [431646161, 431646164, 431646161]
           “ðƁ ƥ“JrŀṘ’          - list [399633415,1179122455]
                      j         - join: [399633415, 431646161, 431646164, 431646161, 1179122455]
                       ḃ11      - convert to bijective base 11: [[1, 9, 5, 6, 4, 5, 5, 5, 5], [1, 11, 1, 7, 1, 11, 1, 7, 1], [1, 11, 1, 7, 1, 11, 1, 7, 4], [1, 11, 1, 7, 1, 11, 1, 7, 1], [5, 5, 5, 6, 4, 7, 1, 7, 5]]
                          Ç€    - call last link (1) as a monad for €ach
                            Œṙ  - run-length decode e.g. [['L',1],[' ',9],['I',5],...]
                                                            -> "L         IIIII..."
                              Y - join with line feeds
  • 1
    \$\begingroup\$ You did the idea I had initially that I was not smart enough to do in 05AB1E!!! Amazing job man. \$\endgroup\$ – Magic Octopus Urn Nov 15 '16 at 19:04

Charcoal, 51 49 bytes (ECXKI)



EEEEE      CCCC     X   X     K   K     IIIII
E         C          X X      K  K        I  
EEEE      C           X       KKK         I  
E         C          X X      K  K        I  
EEEEE      CCCC     X   X     K   K     IIIII

Try it online!

Using characters that are vertically symmetrical, draws the top halves and then reflects. Most of these make use of Polygon () and PolygonHollow (GH) to draw a series of connected line segments with a particular character. I can more easily be done with MultiPrint (), using T as the direction.

Note: PolygonHollow just draws the segments specified, without completing the polygon or filling it. Polygon will complete and fill (not what we want) if the polygon can be completed with a simple line in one of the eight cardinal or intercardinal directions. Otherwise, it behaves like PolygonHollow, for a savings of one byte.

The order of characters was chosen to require only horizontal moves from the endpoint of one to the start of the next. Here's how the cursor proceeds:

Cursor movement, drawing top halves of ECXKI

  • 2
    \$\begingroup\$ Nice. I was trying a charcoal solution but the lack of documentation honestly killed me \$\endgroup\$ – Bassdrop Cumberwubwubwub Nov 16 '16 at 8:43
  • 6
    \$\begingroup\$ @Bassdrop Yeah, we're... um... working on that. [goes to add GH to the docs] \$\endgroup\$ – DLosc Nov 16 '16 at 16:31

PowerShell v2+, 138 128 114 112 106 105 bytes (LICTD)

$("L11 I1  C11 T1  D   D
"*3)LLLLL1IIIII1 CCCC1  T1  DDDD"-replace1,'     '

The idea is to maximize the spaces between the letters so we can get repeated compressions.

Borrows the middle-row deduplication trick from Florent's answer. Saved 6 bytes thanks to Ben Owen by using string multiplication for the middle three rows, and an additional byte thanks to Matt.

Output is like the following at 227 bytes, for a 53.7% reduction --

PS C:\Tools\Scripts\golfing> .\5-favorite-letters.ps1
L         IIIII      CCCC     TTTTT     DDDD
L           I       C           T       D   D
L           I       C           T       D   D
L           I       C           T       D   D
LLLLL     IIIII      CCCC       T       DDDD
  • \$\begingroup\$ I love it when the first answer is something you didn't expect at all. Neat method. \$\endgroup\$ – Magic Octopus Urn Nov 15 '16 at 15:43
  • 2
    \$\begingroup\$ How about $("L11 I1 C11 T1 D D`n"*3) instead of the middle 3 lines \$\endgroup\$ – Ben Owen Nov 15 '16 at 16:45
  • \$\begingroup\$ @BenOwen Excellent idea - thanks! \$\endgroup\$ – AdmBorkBork Nov 15 '16 at 16:50

JavaScript, 110 109 bytes (CLOUD)

`,x+x+x} CCCC5LLLLL6OOO7UUU6DDDD`.replace(/\d/g,c=>" ".repeat(c))

`,x+x+x} CCCC5LLLLL6OOO7UUU6DDDD`.replace(/\d/g,c=>" ".repeat(c))

Output is 227 bytes:

 CCCC     L          OOO      U   U     DDDD
C         L         O   O     U   U     D   D
C         L         O   O     U   U     D   D
C         L         O   O     U   U     D   D
 CCCC     LLLLL      OOO       UUU      DDDD
  • 1
    \$\begingroup\$ Nice use of deduplication in the middle three rows. \$\endgroup\$ – AdmBorkBork Nov 15 '16 at 16:21

ES6 (Javascript), 194, 181 bytes (IGOLF/ANY)

This one is long, and is not really optimized (not yet at least), but can be modified to print any particular message, by only changing the bitmap data.

EDIT: Replaced inner reduce with map, use bit shift for padding


[0x1f73a1f,0x484610,0x49c61e,0x48c610,0x1f73bf0].map(r=>[0,1,2,3,4].map(p=>('0000'+(r>>(20-p*5)<<5).toString(2)).substr(-10).replace(/(1|0)/g,b=>' IGOLF'[(p+1)*b])).join``).join`\n`


[0x1f73a1f,0x484610,0x49c61e,0x48c610,0x1f73bf0].map(r=>[0,1,2,3,4].map(p=>('0000'+(r>>(20-p*5)<<5).toString(2)).substr(-10).replace(/(1|0)/g,b=>' IGOLF'[(p+1)*b])).join``).join`\n`

IIIII      GGG       OOO      L         FFFFF     
  I       G         O   O     L         F         
  I       G  GG     O   O     L         FFFF      
  I       G   G     O   O     L         F         
IIIII      GGG       OOO      LLLLL     F         


Take a letter:


convert it to binary matrix (bitmap)


do the same for other 4 letters, scan a line, by taking "top" 5 bits off each

11111 01110 01110 10000 11111

convert to a hexadecimal string (should be using base36 or even printable ASCII here)


apply the same algorithm to other 4 lines, to get the bitmap.

Render in the reverse order.

  • 1
    \$\begingroup\$ You can remove the parentheses in the regex to save 2 bytes :-) \$\endgroup\$ – ETHproductions Nov 16 '16 at 0:04
  • 1
    \$\begingroup\$ [32979487,4736528,4834846,4769296,32979952] is shorter than its hexadecimal representation \$\endgroup\$ – Florent Nov 16 '16 at 7:50
  • \$\begingroup\$ @ETHproductions True, will make use of this, when I'll be back to optimize it. Thx! \$\endgroup\$ – zeppelin Nov 16 '16 at 8:32
  • 1
    \$\begingroup\$ You could replace /(1|0)/g by /\d/g to save a few bytes. Also \n could be replace by an actual new line. \$\endgroup\$ – Florent Nov 16 '16 at 9:27
  • \$\begingroup\$ >is shorter than its hexadecimal representation Yep, that is true (due to 0x), at least for these specific letters, I'll probably compress this into a continuous hex (or even Base32/Base36/ASCII) string, on the next iteration. >You could replace /(1|0)/g by /\d/g to save a few bytes. Also \n could be replace by an actual new line. Yep, thank you for your tips, I will make use of them once I'm back to this one. \$\endgroup\$ – zeppelin Nov 16 '16 at 19:19

PHP, 107 104 102 94 86 bytes

Ok I'm confident I have the smallest possible source with this method now. I wrote a script to generate and then gzip every possible combination of five letters. There are two solutions that match for the shortest compressed -- LODIC and LDOIC. I'm going with the former because it's more fun to say.




% php foo.php
L          OOO      DDDD      IIIII      CCCC
L         O   O     D   D       I       C
L         O   O     D   D       I       C
L         O   O     D   D       I       C
LLLLL      OOO      DDDD      IIIII      CCCC
  • 3
    \$\begingroup\$ you can save 2 bytes by dropping the 's: the string will get treated as a constant with a value of itself. \$\endgroup\$ – user59178 Nov 15 '16 at 17:45
  • \$\begingroup\$ Damnit, I always forget to do that. :) \$\endgroup\$ – Alex Howansky Nov 15 '16 at 18:23
  • \$\begingroup\$ If L was your last letter you'd save more bytes too. \$\endgroup\$ – Magic Octopus Urn Nov 15 '16 at 19:03
  • \$\begingroup\$ Nice exploiting of a loophole. \$\endgroup\$ – Ismael Miguel Nov 17 '16 at 19:58
  • 2
    \$\begingroup\$ Creativity is subjective and immeasurable. The goal of the challenge is to minimize code size and this is the shortest entry for a non-golfing language. \$\endgroup\$ – Alex Howansky Nov 22 '16 at 18:35

05AB1E, 44 bytes

This was a fun one.
I feel like I need to come back and try and golf it some more when I have time.

Uses CP-1252 encoding.
Inspired by carusocomputing's answer.



Try it online!


‘ÓÑOIHH‘ pushes the string "ECOOIHH".

SðýJ3×S joins the string by spaces, repeats it thrice and converts it to a list.
The resulting list is ['E', ' ', 'C', ' ', 'O', ' ', 'O', ' ', 'I', ' ', 'H', ' ', 'H', 'E', ' ', 'C', ' ', 'O', ' ', 'O', ' ', 'I', ' ', 'H', ' ', 'H', 'E', ' ', 'C', ' ', 'O', ' ', 'O', ' ', 'I', ' ', 'H', ' ', 'H'].

•Td<UÕ‘áÓ?¢tWvkÔÚ• pushes the number 564631055513119191317171314619131717500.

S)ø zips the list and the number together.

ü×J does pairwise string repetition and joins them together.
The result is the string EEEEE CCCC OOO IIIII H HE C O O I H HEEEE C O O I HHHHH.

3äû»splits that into 3 pieces, adds the first and second piece in reverse order and joins by newlines.

  • 13
    \$\begingroup\$ "•Td<UÕ‘áÓ?¢tWvkÔÚ• pushes the number 564631055513119191317171314619131717500" because why wouldn't it... \$\endgroup\$ – geisterfurz007 Nov 16 '16 at 10:58
  • 3
    \$\begingroup\$ @geisterfurz007: To be more precise, it's the base-214 representation of the base-10 number :) \$\endgroup\$ – Emigna Nov 16 '16 at 11:10
  • \$\begingroup\$ So potentially if you could go up to a higher base, your string would get shorter? \$\endgroup\$ – geisterfurz007 Nov 16 '16 at 11:12
  • \$\begingroup\$ @geisterfurz007: If we could yes. Unfortunately 214 is the max in 05AB1E. \$\endgroup\$ – Emigna Nov 16 '16 at 11:25
  • 3
    \$\begingroup\$ You can beat Jelly, I believe in you; 3 bytes left to go haha! \$\endgroup\$ – Magic Octopus Urn Nov 16 '16 at 17:33

JavaScript (ES6), 96 bytes (DIOCL)

`,y+y+y+x}LLLL`.replace(/\d/g,d=>" ".repeat(d))

The idea here is to not only make the middle three lines identical, but also make the first line nearly identical to the last. Since there are only 4 letters that perfectly fit this description CDIO, L is the next best option, as it only requires 4 added characters at the end of the string.

As with Florent's answer, this is a snippet that returns the result. Add 3 bytes if it needs to be a function.

Test snippet

`,y+y+y+x}LLLL`.replace(/\d/g,d=>" ".repeat(d)))

  • \$\begingroup\$ You can save a byte by putting the D first. \$\endgroup\$ – Neil Nov 16 '16 at 11:12
  • \$\begingroup\$ @Neil Thanks. I had to move the C past the I and O as well \$\endgroup\$ – ETHproductions Nov 16 '16 at 16:41
  • \$\begingroup\$ Ah, right, you can't have the I immediately after the C, although interestingly doing that improves my Batch solution, for the same reason. \$\endgroup\$ – Neil Nov 16 '16 at 20:20

Bash+coreutils with figlet, 55440 solutions, 112 106 bytes each

 set H E L P D;for l;do figlet -f banner $l|sed "s/.//3;s/.//5;s/#/$l/g;2d;5d">$l;done;paste $@|expand -t10


H   H     EEEEE     L         PPPP      DDDD  
H   H     E         L         P   P     D   D 
HHHHH     EEEE      L         PPPP      D   D 
H   H     E         L         P         D   D 
H   H     EEEEE     LLLLL     P         DDDD  

Hey, we already have a program for ASCII art! The banner font almost does the job, except it outputs 7x7 letters. Hmm, let's just remove the 3rd and 5th columns, and the 2nd and 5th lines, and see what it gives...

It turns out that many letters will be output the required way, namely, B D E F H J L P T U Z.

It suffices to replace the arguments of the first set command with any combination of those letters to still obtain a correct result! Hence, this gives us 11*10*9*8*7=55440 solutions, each of those being 106 bytes long.

  • 1
    \$\begingroup\$ My first thought when reading the challenge was "one has to use figlet to solve this" \$\endgroup\$ – FliiFe Nov 22 '16 at 18:01

05AB1E, 102 90 89 69 bytes (EOIXC)


Try it online!

Output (230 bytes):

EEEEE      OOOO     IIIII     X   X      CCCC
E         O    O      I        X X      C    
EEEE      O    O      I         X       C    
E         O    O      I        X X      C    
EEEEE      OOOO     IIIII     X   X      CCCC

69 / 230 = 70% Compression


The theory was to pick vertically symmetrical letters, then encode the first 3 lines an palindromize them. Basically, I encoded as {#} of {Letter} in 2 byte pairs. I'm sure there's a better way to do this.

                    <decodes to>
"E5 6O4 5I5 5X1 3X1 6C4E1 9O1 4O1 6I1 8X1 1X1 6C1 4E4 6O1 4O1 6I1 9X1 7C1 4"

2ô            # Split into encoded pairs.
  vy   }      # Loop through each letter and number pair.
    `×        # Add the letter X number of times.
       J      # Join together.
        3ä    # Split into 3 parts length.
          û   # Palindromize.
           »  # Print separated by newlines.

-20 bytes thanks to Emigna, I'll be in the chat to ask some questions soon ;).

  • 1
    \$\begingroup\$ You can save 19 bytes by replacing the string with •Cv¶ÉH&9;´ß{ø‰¿šq3d$µ_©Û¶«K>Ò±sÒ9ÍÊC4ÊÚîòvÅr葾)jM•34B2ð:. Hop in the 05AB1E chat if you have questions about encoding. \$\endgroup\$ – Emigna Nov 15 '16 at 19:48
  • 1
    \$\begingroup\$ Also, 45ô can be . \$\endgroup\$ – Emigna Nov 15 '16 at 19:52
  • \$\begingroup\$ @Emigna A is not vertically symmetrical, and neither is F. Going to guess that once you start using G or higher it'll ruin what you're talking about right? Also, with my compression methodology I wanted to avoid letters that had more than 1 occurrence per row. If you want to golf that solution and beat me I'd welcome the example :). \$\endgroup\$ – Magic Octopus Urn Nov 15 '16 at 19:54
  • \$\begingroup\$ There's a 0 in the O (center row, right side) \$\endgroup\$ – ETHproductions Nov 15 '16 at 20:09
  • 1
    \$\begingroup\$ •Cv¶ÉH&9;´ß{ø‰¿šq3d$µ_©Û¶«K>Ò±sÒ9ÍÊC4ÊÚúNÏŒº9¨gÚSÞ• fixes the O at the same byte count. \$\endgroup\$ – Emigna Nov 15 '16 at 20:53

JavaScript ES6, 168 bytes, CHAMP

We can stop looking guys, we have a CHAMP over here

` C3cHaHdA2dMaMcP3
CgH4cA4cM M McP3
 C3cHaHcAaAcMaMcP`.replace(/[a-z\d]/g,(a,i,c)=>+a?c[i-1].repeat(a):' '.repeat(parseInt(a,36)-7))

a.innerHTML = f()
<pre id=a>


Brainf*** 512 411 Bytes

Better redo:

This one does a better job at optimizing the tape, sacrificing setup characters for printing characters. The tape in this one looks like 'C' 'E' ' ' 'F' 'I' 'L' '\n', improving efficiency. I chose these because they lack internal spaces, making it so that they don't have to go back and forth between character and space more than necessary


If you want to read what it's doing:

Set the tape with 67,69,32,70,73,76,10
.<<....>>.....<.....>.....>.....<.....>>.....<<.....>>>.>.<<<<<< First Line
.>>.........<.>.........>.<...........>>.<<.......>>>.>.<<<<<< Second Line
.>>.........<....>......>....<........>>.<<.......>>>.>.<<<<<< Third Line
.>>.........<.>.........>.<...........>>.<<.......>>>.>.<<<< Fourth Line
.<<....>>.....<.....>.....>.<.........>>.....<<.....>>>..... Fifth Line


 CCCC     EEEEE     FFFFF     IIIII     L
C         E         F           I       L
C         EEEE      FFFF        I       L
C         E         F           I       L
 CCCC     EEEEE     F         IIIII     LLLLL

Former Submission:


I chose to go with ABCDE because it make setting up the tape for output much easier, but the time and characters I wasted in going from the letter to ' ' for all the negative space inside the A, B, and D and the placement of the endline at the end of the tape kinda killed me, I think.

I ended up with a tape that had the values 0 0 'A' 'B' 'C' 'D' 'E' ' ' \n and then output from there

++++++++[>++++<-]>[>++>++>++>++>++>+<<<<<<-]>+>++>+++>++++>+++++>>++++++++++     This all sets up the tape as 0 0 A B C D E ' ' '\n'
<.<<<<<...>>>>>......<<<<....>>>>.......<<<....>>>.....<<....>>......<.....>>.<<<<<< First Line
.>>>>>...<<<<<.>>>>>.....<<<<.>>>>...<<<<.>>>>.....<<<.>>>.........<<.>>...<<.>>.....<.>>.<<<<<< Second Line
.....>>>>>.....<<<<....>>>>......<<<.>>>.........<<.>>...<<.>>.....<....>>.<<<<<< Third Line
.>>>>>...<<<<<.>>>>>.....<<<<.>>>>...<<<<.>>>>.....<<<.>>>.........<<.>>...<<.>>.....<.>>.<<<<<< Fourth Line
.>>>>>...<<<<<.>>>>>.....<<<<....>>>>.......<<<....>>>.....<<....>>......<..... Last Line


 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
  • \$\begingroup\$ You can use [<]> on 3 occasions to save 6 bytes. \$\endgroup\$ – Jo King Jan 20 '18 at 11:51

Vim, 116 bytes 99 bytes


Golfed it under 100 with the help of @DrMcMoylex.

E L I T CPqqjx:%s/\d/\=repeat('"',submatch(0))
q8@q3bi  Y7w.PP4rE{wl4r 22wl.2x

This contains unprintable characters, so I've added them in below (Vim style), so you can see them.

E L I T C^[Pqqjx:%s/\d/\=repeat('^R"',submatch(0))
q8@q3bi  ^[Y7w.PP4rE{wl4r 22wl.2x


It basically uses the same run-length decode that the jelly answer does. I used letters where I could (hopefully) repeat the top on the bottom, and the middles would all 3 be the same. Once the tops, bottoms, and middles are created I edit the characters to make them correct:

  1. Add two spaces to the I (more on that below)
  2. Add two spaces to the T
  3. Add the bar of the E
  4. Remove the top of the L
  5. Remove the bottom of the T (and delete the 2 spaces)

I have to add two spaces to the I, because I didn't allow two digit numbers (so I wouldn't need a separator. This leads to a 9 space run where I need 11.

  • \$\begingroup\$ Welcome to PPCG, nice answer :). \$\endgroup\$ – Magic Octopus Urn Nov 16 '16 at 17:30
  • \$\begingroup\$ I was almost begging for a Vim answer. \$\endgroup\$ – Zoltán Schmidt Nov 17 '16 at 18:53
  • 2
    \$\begingroup\$ I always upvote vim. :) Some improvements I see. 1) you don't need the trailing slash on your substitute command. 2) Some useful synonyms: Y instead of Vy, FI instead of ?I<cr>, { instead of gg, w instead of fl. 3) If you use r instead of R, you can remove the <esc>. \$\endgroup\$ – DJMcMayhem Nov 17 '16 at 22:35

MATL, 49 bytes


Try it online!

This produces the letters TIHZN:

TTTTT     IIIII     H   H     ZZZZZ     N   N
  T         I       H   H        Z      NN  N
  T         I       HHHHH       Z       N N N
  T         I       H   H      Z        N  NN
  T       IIIII     H   H     ZZZZZ     N   N


T is relatively easy to build from scratch. I can be obtained essentially as T plus its vertical reflection. H is I transposed. N is Z transposed and vertically reflected.

5:        % Push [1 2 3 4 5]
lyI&(     % Write [1 ;2; 3; 4 ;5] in the third column, filling with zeros.
          % This gives the shape of the 'T'
g84*      % Change nonzeros into 84 (ASCII for 'T'). Zeros will be displayed
          % as spaces
t0*       % Duplicate and multiply by zeros. This gives the separator
y         % Duplicate from below: pushes the 'T' again
tP+       % Duplicate, flip vertically, add. Gives the shape of the 'I'
g73*      % Change nonzeros into 73 (ASCII for 'I')
yy        % Duplicate separator and 'I' array
!         % Transpose. Gives the shape of the 'H'
q         % Subtract 1. Transformss 73 into 72 (ASCII for 'H'), and 0 into -1,
          % which will later be changed back into 0 when converting to char
y         % Duplicate separator
5XyP      % Size-5 identity matrix flipped vertically: gives slash of the 'Z'
l5LY(     % Fill first and last rows with ones. Gives the shape of the 'Z'
90*       % Multiply by 90 (ASCII for 'Z')
yy        % Duplicate separator and 'Z' array
!P        % Transpose and flip vertically. Gives shape of the 'N'
12-       % Subtract 12 to yield ASCII code for 'N'. 0 is converted to -12
&h        % Concatenate the nine arrays horizontally
c         % Convert to char. Implicitly display

V, 62, 53 bytes

iC±  I· D³ Dµ O³ O¸ Z3ñYp$XñS ´Cµ µIµ ´D· ³O¶ µZYHP

Try it online!

This outputs C I D O Z:

 CCCC     IIIII     DDDD       OOO      ZZZZZ
C           I       D   D     O   O        Z
C           I       D   D     O   O       Z
C           I       D   D     O   O      Z
 CCCC     IIIII     DDDD       OOO      ZZZZZ

Perl, 109 bytes (ABCDE)

Note: this contains unprintable characters, escaped for ease of testing here, xxd dump below.

\x11\x1e\x0f\x1e\x1f";s!.!(eval'(sprintf"%5b",ord$&)=~y/01/ '.(A..E)[$i++%5].'/r').$"x5!ge;print

Stores the binary representation of the letter positions as a number, then unpacks back into binary, replacing 0s with spaces and 1s with the corresponding letter, using a lookup. Storing the letter representations is quite easy, but replacing them turned out more tricky than I'd hoped. I'm sure there are better ways to do this so I might well continue to play with this.

To recreate the file, run xxd -r > favourite-letter.pl, paste in the below and press Ctrl+D:

0000000: 245f 3d22 0e1e 0f1e 1f0a 1111 1011 100a  $_="............
0000010: 1f1e 1011 1e0a 1111 1011 100a 111e 0f1e  ................
0000020: 1f22 3b73 212e 2128 6576 616c 2728 7370  .";s!.!(eval'(sp
0000030: 7269 6e74 6622 2535 6222 2c6f 7264 2426  rintf"%5b",ord$&
0000040: 293d 7e79 2f30 312f 2027 2e28 412e 2e45  )=~y/01/ '.(A..E
0000050: 295b 2469 2b2b 2535 5d2e 272f 7227 292e  )[$i++%5].'/r').
0000060: 2422 7835 2167 653b 7072 696e 74         $"x5!ge;print


perl favourite-letter.pl
 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     

Python 2, 124 bytes

d,i,o,c,l,s,n='DIOCL \n'
print T+n,M,M,M,T+l*3

Similar to my other answer, but with better letter choices. Outputs this:

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

Befunge, 120 bytes (CKYTF)




  CCCC     K   K     Y   Y     TTTTT     FFFFF
 C         K  K       Y Y        T       F
 C         KKK         Y         T       FFFF
 C         K  K        Y         T       F
  CCCC     K   K       Y         T       F

Try it online!

In case it matters, I should point out that my output has a leading space on each line. The rules didn't explicitly prohibit that, so I'm hoping that's OK. If not, please just consider this a non-competing entry.


The letters of the word are encoded as a simple sequence of 25 integers, each integer being a binary representation of 5 pixels. Since Befunge requires you to perform a calculation to instantiate any integer greater than 9, the letters were chosen so as to minimize the number of calculations required, and ordered so potential repeating values could be duplicated rather than recalculated.

We also need to store the ASCII value of each letter, offset by 32, in an array which is indexed by the modulo 5 of a decrementing index (so it goes 0 4 3 2 1 ...). The reason for offsetting by 32 is so the value can be multiplied by a pixel bit (1 or 0) and then added to 32 to produce either a space or the character required.

This array of letter values is stored in the first 5 bytes of the code, so it's easy to access. This also then influenced the choice of letters, since those values needed to be meaningful when interpreted as a code sequence. This is the sequence #&49+. The # jumps over the & and the 49+ just pushes 13 onto the stack which is subsequently ignored.

  • \$\begingroup\$ You're asking for integer input with the &, but your program doesn't actually take input...what's going on? \$\endgroup\$ – Brian Gradin Nov 16 '16 at 0:06
  • \$\begingroup\$ That character is skipped by '#' \$\endgroup\$ – 12Me21 Feb 5 '18 at 19:30
  • \$\begingroup\$ @12Me21 I explained the reasoning behind that in the last paragraph. \$\endgroup\$ – James Holderness Feb 11 '18 at 13:47

Ruby, 110 107 102 bytes (DOCIL)

puts a=?D*4+(t=' '*7)+?O*3+t+?C*4+(s=' '*5)+?I*5+s+?L,['D   D'+s+'O   O'+s+?C+' '*11+?I+t+?L]*3,a+?L*4


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

EDIT: Saved some chars by avoiding join and moving things around


Befunge-98, 109 98 bytes (FUNGE / ANY)

:5%!2>j#4_;\$&\#;\:0`!#@_:::'@/'@*-\'@/2%*' +,:'@/:2/-'@*-\1+:5%!2>j#4_;' 3k:4k,#;:55*%!2>j#4_;a,;

Try it online!

Input (115 characters):

2022 1141 1134 935 2021 102 1141 1262 103 101 998 1141 1390 1639 997 102 1141 1646 1127 101 102 949 1134 935 2021 0

Input is the integer version of a binary number with the format aaaaabbbbbb where aaaaa is a reversed map of the character to print (for example, the second row in the N is NN N, so the mask is 10011), and bbbbbb is the ascii character to print, minus 32.

I also created a befunge-98 program to create my inputs:

4k~44p34p24p14p04p          v

Try it online!

Output (255 characters):

FFFFF     U   U     N   N      GGG      EEEEE     
F         U   U     NN  N     G         E         
FFFF      U   U     N N N     G  GG     EEEE      
F         U   U     N  NN     G   G     E         
F          UUU      N   N      GGG      EEEEE     

(255 - (115 + 98)) / 255 = 16% compression


:5%!2>j#4_;\$&\#;\:0`!#@_     Get input if it is available, else end program
:::'@/'@*-\'@/2%*' +,         Output the current input character (or a space,
                              if the mask dictates so)
:'@/:2/-'@*-                  Throw away current mask bit
\1+                           Swap loop iterator to top of stack, increment it
:5%!2>j#4_;' *3k:4k,#;        If iterator % 5 == 0, print five spaces
:55*%!2>j#4_;a,;              If iterator % 25 == 0, print newline character

This is probably pretty golfable; I've spent barely any time thinking about potential reductions.

Theoretically this can print any sequence of 5x5 ascii art.

Thanks to James Holderness for helping me get out of triple digits!

  • \$\begingroup\$ To take the idea further, 48* can be replaced with ' (since this is 98 after all), and 88* can be replaced with '@. Thanks for helping me get out of triple digits! \$\endgroup\$ – Brian Gradin Nov 16 '16 at 19:32

C#, 290 279 267 265 Bytes

Edit: Saved 12 bytes thanks to @milk! And 2 more thanks to @TheLethalCoder


void F(){string g="     ",h="H   H",A="A   A",B=h+"|"+A;Func<string,string>j=a=>a.Replace("|",g)+"\n";Console.Write(j(" SSSS|"+h+"| AAA |RRRR |PPPP")+j("S    |"+B+"|R   R|P   P")+j(" SSS |HHHHH|AAAAA|RRRR |PPPP")+j("    S|"+B+"|R  R |P")+j("SSSS |"+B+"|R   R|P"));}


public void F()
  string g = "     ", h = "H   H", A = "A   A", B = h + "|" + A;
  Func<string, string> j = a => a.Replace("|", g) + "\n";
  Console.Write(j(" SSSS|" + h + "| AAA |RRRR |PPPP") +
  j("S    |" + B + "|R   R|P   P") +
  j("    S|" + B + "|R  R |P") +
  j("SSSS |" + B + "|R   R|P"));


 SSSS     H   H      AAA      RRRR      PPPP
S         H   H     A   A     R   R     P   P
 SSS      HHHHH     AAAAA     RRRR      PPPP
    S     H   H     A   A     R  R      P
SSSS      H   H     A   A     R   R     P
  • \$\begingroup\$ There was a second where I thought that your C code was 290279 bytes in length. \$\endgroup\$ – Steven H. Nov 16 '16 at 0:17
  • 1
    \$\begingroup\$ @StevenH. It feels that way Golfing in C# :) \$\endgroup\$ – Pete Arden Nov 16 '16 at 0:30
  • \$\begingroup\$ -12 bytes if you define the local function like this Func<string,string>j=a=>a.Replace("|",g)+"\r\n"; \$\endgroup\$ – milk Nov 16 '16 at 6:46
  • \$\begingroup\$ @milk Cool, thanks! :) \$\endgroup\$ – Pete Arden Nov 16 '16 at 11:07
  • \$\begingroup\$ Do you need the \r in the \r\n? Would save 2 bytes \$\endgroup\$ – TheLethalCoder Nov 17 '16 at 17:00

Stax, 33 bytes "BCDEO"

┌☼&.àτ▲█╟;c♦▌ΩÅ╡≤♫¿(┌▲▲≡3*╤J s*è«

Run and debug it

I picked letters that

  • have vertical symmetry
  • whose middle three columns are identical

These properties mean that each letter can be represented by a 3x3 grid. Here are the 9 regions, represented by digits.


Consider the letter "B". It can be represented by 3 octal digits: 656. Each digit contains three bits, which control which regions are enabled for that letter. This technique also works for "CDEO".

Unpacked, ungolfed, and commented, the program looks like this.

"!^*14>G2eo"!   crammed integer literal             [63672, 54545, 64565]
|p              palindromize                        [63672, 54545, 64565, 54545, 63672]
m               for each, run this and output...    
  E             extract decimal digits to array     [6, 3, 6, 7, 2]
  `)"+0`        compressed string literal           "BCDEO"
  \             zip arrays                          [[6, 66], [3, 67], [6, 68], [7, 69], [2, 79]]
  {             map array using block               
    E           explode array                       6, 66
    Z\          tuck a zero under, and make pair    6, [0, 66]
    :B          custom base convert                 [66, 66, 0] 
    3)          pad to length 3                     [66, 66, 0]
    3O\         tuck a one under a 3 and pair       [66, 66, 0], [1, 3]
    :B          repeat elements corresponding times [66, 66, 66, 66, 0]
    A(          pad right to length 10              [66, 66, 66, 66, 0, 0, 0, 0, 0, 0]

Run this one


Python 3, 234 228 227 166 bytes (CLOUD):

import base64,gzip;b=b'ABzY86gn$d0{>HR1_A{T@KJyRe}8`nBNU1i6kLFS%Nec$q1YdaQ51tPO;sx(oDBkK&Q=Hwg(wC)8vxUXJX_-c000';print(gzip.decompress(base64.b85decode(b)).decode())


 CCCC     L          OOO      U   U     DDDD
C         L         O   O     U   U     D   D
C         L         O   O     U   U     D   D
C         L         O   O     U   U     D   D
 CCCC     LLLLL      OOO       UUU      DDDD

Python 3, 178 bytes

e,f,i,t,h,s='EFITH '

Won't win, but does not use any compression. It makes this:

EEEEE     FFFFF     IIIII     TTTTT     H   H
E         F           I         T       H   H
EEEE      FFFF        I         T       HHHHH
E         F           I         T       H   H
EEEEE     F         IIIII       T       H   H

Any help is welcome, I probably missed something. I didn't use Python 2 because you can't do the p=print, and that saves 17 bytes. Try it on repl.it.

  • 2
    \$\begingroup\$ What is up with that F? \$\endgroup\$ – Destructible Lemon Nov 15 '16 at 22:03
  • \$\begingroup\$ @DestructibleWatermelon I don't know how I missed that, but it is fixed now. \$\endgroup\$ – nedla2004 Nov 15 '16 at 22:14
  • \$\begingroup\$ Golfed below original size: 160 bytes, Python 2 \$\endgroup\$ – CalculatorFeline Nov 17 '16 at 1:07
  • \$\begingroup\$ Rather than using p=print, you can use a single print statement with the kw argument sep='\n'. \$\endgroup\$ – Luca Citi Mar 29 '18 at 8:29

Ruby, 101 bytes (TIFLE)

"o@h@u".bytes{|i|k=3+i%2;puts "%-10s"*5%"TIFLE".chars.map{|j|i/=2;(i/16>i%2*3?'  ':'')+j+j*k*(i%2)}}

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

I picked letters that required a single block of letters (1,4 or 5 letters long) on each line. F,L and E are left justified, but T and I require leading spaces where a single letter (vertical part) is printed. The code for adding these spaces looks like it could be improved.


"o@h@u".bytes{|i|               #for each byte (64 always set, 32...2 bits set for horiz bar, 1 bit=length of bar)
   k=3+i%2                      #decode least sig. bit for no of chars printed if a 1 is found
   puts "%-10s"*5%              #puts "%-10s%-10s%-10s%-10s%-10s" format string (expects array of subsitutes)
     "TIFLE".chars.map{|j|      #for each letter 
        i/=2                    #halve i
        (i/16>i%2*3?'  ':'')+   #if i large enough and i%2 zero, add leading space (or T and I)
        j+j*k*(i%2)             #print the letter once, then additional letters if bar required.

C 176 bytes

If implicit ints are allowed then it's possible to cut off another 8 bytes.

#define C ,//11 bytes
#define R(r)r r r r r//21 bytes
T(int l){int c=324;printf(R(R("%c")R(" "))"\n" R(R(C(++c,l>>=1)&1?c/5:32)));}//77 bytes
f(){T(67010460);T(34702434);T(66160574);T(34702434);T(67010466);}//65 bytes

Output: E D C B A

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

How it works: The macro R just repeats a piece of code 5 times. Given how often fives appear in this problem, very useful. Now: here's what T(int) does. T takes an integer, and uses it as a bit field to determine where to print letters and where to print white space. For example, if given T(0b11111111100111111110011100), it will output: EEEEE DDDD CCCC BBBB AAA. It progressively counts down as to what letter it prints. First it prints E, then D, then C, then B, then A. Calling f() will print the entire thing.


Batch, 135 bytes (DOCILe)

@set b=     
@set s=@echo DDDD%b%  OOO%b%  CCC%b% IIIII%b%L
@set t=@echo D   D%b%O   O%b%C%b%%b% I%b%  L

Note: the first line ends in 5 spaces.


BASH, 95, 111 bytes (EBASH)


base64 -d<<<4ADlADhdACLpBDSMnNdRTj0Ob2qBPVT3HkdMRZzZ3kL+yIb6mhkz06EM+KOspSDy2EBoUKKL6pfwNo0akV0zAA==|xz -dqFraw


Base64 over raw LZMA byte stream


>base64 -d<<<4ADlADhdACLpBDSMnNdRTj0Ob2qBPVT3HkdMRZzZ3kL+yIb6mhkz06EM+KOspSDy2EBoUKKL6pfwNo0akV0zAA==|xz -dqFraw

EEEEE     BBBB       AAA       SSSS     H   H
E         B   B     A   A     S         H   H
EEEE      BBBB      AAAAA      SSS      HHHHH
E         B   B     A   A         S     H   H
EEEEE     BBBB      A   A     SSSS      H   H


Yes, I'm well aware that this is not really portable, that's why I've paid a byte to suppress the xz warnings with -q in the first case >:)


Python 2, 208 194 193 bytes

This is my first ever code golf ;) Fun to do

for i in range(0,25,5):
 for c,p in {'M':18732593,'O':15255086,'N':18667121,'T':32641156,'Y':18157700}.items():
  print format(p,'025b')[i:i+5].replace('0',' ',).replace('1',c)+'   ',


Y   Y    M   M    TTTTT     OOO     N   N
 Y Y     MM MM      T      O   O    NN  N
  Y      M M M      T      O   O    N N N
  Y      M   M      T      O   O    N  NN
  Y      M   M      T       OOO     N   N

Using a dictionary destroys the sort order of the letters, but that was not a requirement

  • \$\begingroup\$ It could do -4 if we take letters that do not use the upper left corner. This would result in a 24 bit (instead of a 25 bit) number which takes up one less digit in hex. \$\endgroup\$ – Pleiadian Nov 17 '16 at 15:22

perl 94 bytes.

The first 4 letters (D, O, I, C) are specifically chosen to have the upper and lower lines similar, and the middle ones similar. As there is not any other similar letter, I chose the "L" to be able to apply the same algorithm and add the missing 4L.

for(($a="D5 6O3 6I5 6C4 5L")."
","D 3D 5O 3O 7I 7C 9L

I saved some extra bytes by replacing the \n in the code with a real new line.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.