title: Generating a soccer team!

text:
# Question
Title: Generating a soccer team!
Generate the following soccer team ASCII art with the least number of bytes possible.

```
   |.|      |.|      |.|      |.|      |.|      |.|      |.|      |.|
   ]^[      ]^[      ]^[      ]^[      ]^[      ]^[      ]^[      ]^[
 /~`-'~\  /~`-'~\  /~`-'~\  /~`-'~\  /~`-'~\  /~`-'~\  /~`-'~\  /~`-'~\
{<| 8 |>}{<| 6 |>}{<| 1 |>}{<| 3 |>}{<| 7 |>}{<| 5 |>}{<| 4 |>}{<| 2 |>}
 \|___|/  \|___|/  \|___|/  \|___|/  \|___|/  \|___|/  \|___|/  \|___|/
  /   \    /   \    /   \    /   \    /   \    /   \    /   \    /   \
 /__|__\  /__|__\  /__|__\  /__|__\  /__|__\  /__|__\  /__|__\  /__|__\
 | / \ |  | / \ |  | / \ |  | / \ |  | / \ |  | / \ |  | / \ |  | / \ |
 (/   \)  (/   \)  (/   \)  (/   \)  (/   \)  (/   \)  (/   \)  (/   \)
 |)   (|  |)   (|  |)   (|  |)   (|  |)   (|  |)   (|  |)   (|  |)   (|
(.|,.,|,)(,|,.,|.)(.|,.,|,)(,|,.,|.)(.|,.,|,)(,|,.,|.)(.|,.,|,)(,|,.,|.)

```

Note that the players' feet alternate between `(.|,.,|,)` and its mirror, but their eyes all point the same direction ``-'`.

# Score

Least number of bytes wins!

# Rules

* Standard loop holes apply
* Any amount of trailing/leading white space legal.

# Answer
> 12 votes
# Charcoal, ~~106~~ ~~95~~ ~~92~~ ~~91~~ ~~79~~ 77 bytes

```
”∨+!rþW∕oc	σ<7↗OKd↶!(⊞”«5βＧ◨“Ｏc∕)ÿ6T”‖Ｂ←→→→,Ｆ³‖ＭＪ⁹¦³Ｆ6137542«ιＭ⁸→»↑Ｆ⁸«Ｍ⁸←←'

```

~~Try it online!~~ Edit: Saved 11 bytes by looping over the shirt numbers. Saved 3 bytes by working out how  worked. Saved a further byte by using separate mirror instructions. Saved 12 bytes thanks to @ASCII-only by compressing the half player string. Saved 2 bytes by repeating the mirror in a loop. Explanation:

```
”∨+!rþW∕oc	σ<7↗OKd↶!(⊞”«5βＧ◨“Ｏc∕)ÿ6T”
            Print the right half of a player as a compressed string
‖Ｂ←         Butterfly to create the left half of the player
→→→,        Fix up the left foot
Ｆ³‖Ｍ        Mirror three times to end up with 8 footballers
Ｊ⁹¦³Ｆ6137542«ιＭ⁸→»↑
            Fix up the shirt numbers
Ｆ⁸«Ｍ⁸←←'    Fix up the right eyes

```

Edit: The above code no longer works in current Charcoal; the string compression appears to have changed and the reflect command now accepts a multidirection and leaves the cursor in a different position. However it's possible to adapt the code to run in current charcoal for the same byte count. Try it online! Link is to verbose version of code. (Note that the deverbosifier tries to compress `6137542` for some reason although it's unnecessary.) It then becomes possible to golf a further byte off. Try it online! Link is to verbose version of code.

# Answer
> 10 votes
# Brainf\**k, ~~855~~ 852 bytes

That's *too* long...

```
+++++[>++++++>+++++++++>+++++++++>>+++++[<+++++>-]>++<<<<<<-]>++>+>+>-<<<<++++++++[>...>>>.<.>.<<<...<-]>>>>>>.<<<<[>>>++<<<-]++++++++[<...>>>>+.+.---.+<<<<...>-]>>>>.<<++<<++++++++[<.>>+.>.>++++.----<<--.------.+++++++>.>.<<<<.>-]>>>>.<<<<+++++[>+++<-]<[>+<-]>>>>>>>+++++++[<+++++++>-]<+[>+>+>+>+>+>+>+>+<<<<<<<<-]>++++++>++++>->+>+++++>+++>++<<<<<<<<<<<<<++++++++[>>>---.<-.>+.<<.>>>>>>.[-]<<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]<[>+<-]>>.>>.<++.->+.+<<<-]>>>>>.<<--<--------------<<++++++++[>.>>>.<.>+++...---<.<.<.<-]>>>>>.<<<<<++++++++[>..>.<...>>>.<<<..<-]>>>>>.<<<<<++++++++[>.>.>>+++..<.>..---.<<<.<-]>>>>>.<<<<<++++++++[>.>>.<<.>.<.>>>.<<<.>>.<<.<-]>>>>>.<<<<<++++++++[>.>-------.+++++++.<...>>>.<<------.++++++<.<-]>>>>>.<<<<<++++++++[>.>>.<------.<...>-.+++++++>.<<.<-]>>>>>.<<<-<++++++++<++++[>.>.>.<--.++.--.>.<.<+.-.>.>.<.++.--.>.<++.<+.-<-]

```

Explanation:

```
+++++[
    >++++++ AT CELL1
    >+++++++++ AT CELL2
    >+++++++++ AT CELL3
    >>+++++[ AT CELL5
        <+++++>-
    ] CELL4 = 25
    >++ AT CELL6
    <<<<<<-
]
>++ CELL1 = 32
>+ CELL2 = 46
>+ CELL3 = 46
>- CELL4 = 124
CELL5 = 0
CELL6 = 10
<<<< AT CELL0
++++++++[
    >...>>>.<.>.<<<...<- PRINT FIRST LINE*8
]
>>>>>>. AT CELL6
<<<<[ AT CELL2
    >>>++<<<-
]
CELL2 = 0
CELL3 = 46
CELL4 = 124
CELL5 = 92
++++++++[ AT CELL2
    <...>>>>+.+.---.+<<<<...>- PRINT SECOND LINE*8
]
>>>>. AT CELL6
NOW PRINT 47 126 96 45 39 126 92
<<++ CELL4 = 126
<< AT CELL2
++++++++[
    <.>>+.>.>++++.----<<--.------.+++++++>.>.<<<<.>- PRINT THIRD LINE*8
]
>>>>. AT CELL6
NOW PRINT 123 60 124 32 NUMBER 32 124 62 125
CELL3 = 46
<<<<+++++ AT CELL2
[
    >+++<-
]
CELL2 = 0
<[>+<-]>
CELL2 = 32
CELL3 = 61
CELL4 = 126
CELL5 = 92
>>>>> AT CELL7
> AT CELL8
+++++++[
    <+++++++>-
]
AT CELL8
<+ CELL7 = 50
[>+>+>+>+>+>+>+>+<<<<<<<<-]
CELL7 = 0
CELL 8 9 10 11 12 13 14 15 = 50
>++++++>++++>->+>+++++>+++>++<<<<<<<
AT CELL7
<<<<<<
AT CELL1
CELL2 = 32
CELL3 = 61
CELL4 = 126
CELL5 = 92
++++++++[
    PRINT 123 60 124 32 NUMBER 32 124 62 125
    >>>---. AT CELL4
    <-. AT CELL 3
    >+. AT CELL4
    <<. AT CELL2
    PRINT 56 54 49 51 55 53 52 50
    EACH TIME MOVES CELL2 TO CELL5
    >>>>>>.
    [-] CLEAR CELL8
    <
    <[>+<-] CELL6 TO CELL7
    <[>+<-] CELL5 TO CELL6
    <[>+<-] CELL4 TO CELL5
    <[>+<-] CELL3 TO CELL4
    <[>+<-] CELL2 TO CELL3
    <[>+<-] CELL1 TO CELL2
    AT CELL1
    CELL3 = 32
    CELL4 = 61
    CELL5 = 126
    CELL6 = 92
    >>.>>.<++.->+.+<<<-
]
AT CELL9
CELL9 = 0
CELL10 = 32
CELL11 = 61
CELL12 = 126
CELL13 = 92
CELL14 = 10
>>>>>.
<<
--
CELL12 = 124
<
--------------
CELL11 = 47
<<++++++++[ AT CELL9
    PRINT 32 92 124 95 95 95 124 47 32
    >.>>>.<.>+++...---<.<.<.<-
]
>>>>>.
<<<<<++++++++[
    PRINT 32 32 47 32 32 32 92 32 32
    >..>.<...>>>.<<<..<-
]
>>>>>.
<<<<<++++++++[
    PRINT 32 47 95 95 124 95 95 92 32
    >.>.>>+++..<.>..---.<<<.<-
]
>>>>>.
<<<<<++++++++[
    PRINT 32 124 32 47 32 92 32 124 32
    >.>>.<<.>.<.>>>.<<<.>>.<<.<-
]
>>>>>.
<<<<<++++++++[
    PRINT 32 40 47 32 32 32 92 41 32
    >.>-------.+++++++.<...>>>.<<------.++++++<.<-
]
>>>>>.
<<<<<++++++++[
    PRINT 32 124 41 32 32 32 40 124 32
    >.>>.<------.<...>-.+++++++>.<<.<-
]
>>>>>.
<<<-
<++++++++
CELL10 = 40
CELL11 = 46
CELL12 = 124
<++++[
    PRINT 40 46 124 44 46 44 124 44 41
    >.>.>.<--.++.--.>.<.<+.
    PRINT 40 44 124 44 46 44 124 46 41
    -.>.>.<.++.--.>.<++.<+.-<-
]

```

# Answer
> 8 votes
# , 127 bytes

```
i³ |.|
³ ]^[
 /~`-'~\
 \|³_|/
  /³ \
 /__|__\
 | / \ |
 (/³_\)
 |)³_(|  8ä{3Go86137542Ó./{<| & |>}
Gï2i(.|,.,|,)hr.%lr,|4ä$

```

Try it online!

As usual, here is a hexdump:

```
00000000: 69b3 207c 2e7c 0ab3 205d 5e5b 0a20 2f7e  i. |.|.. ]^[. /~
00000010: 602d 277e 5c0a 205c 7cb3 5f7c 2f0a 2020  `-'~\. \|._|/.
00000020: 2fb3 205c 0a20 2f5f 5f7c 5f5f 5c0a 207c  /. \. /__|__\. |
00000030: 202f 205c 207c 0a20 282f b35f 5c29 0a20   / \ |. (/._\).
00000040: 7c29 b35f 287c 2020 1b38 e416 7b33 476f  |)._(|  .8..{3Go
00000050: 3836 3133 3735 3432 1bd3 2e2f 7b3c 7c20  86137542.../{<|
00000060: 2620 7c3e 7d0a 47ef 3269 282e 7c2c 2e2c  & |>}.G.2i(.|,.,
00000070: 7c2c 291b 6872 2e25 6c72 2c7c 34e4 24    |,).hr.%lr,|4.$

```

# Answer
> 6 votes
# JavaScript (ES6), ~~196~~ ~~194~~ ~~214~~ ~~210~~ 204 bytes

Early morning golf on my phone again, so there's room for improvement.

Had to sacrifice a few bytes fixing the feet which I didn't notice were alternating.

```
_=>`   |.|
   ]^[
 /~\`-'~\\
{<| 0 |>}
 \\|___|/
  /   \\
 /__|__\\
 | / \\ |
 (/   \\)
 |)   (|
(1|,.,|2)`.replace(/.+/g,x=>x.repeat(8)).replace(/\d/g,x=>`,.86137542`[x--?(z+=x)%2:++z],z=1)

```

---

## Try it

```
o.innerText=(

_=>`   |.|
   ]^[
 /~\`-'~\\
{<| 0 |>}
 \\|___|/
  /   \\
 /__|__\\
 | / \\ |
 (/   \\)
 |)   (|
(1|,.,|2)`.replace(/.+/g,x=>x.repeat(8)).replace(/\d/g,x=>`,.86137542`[x--?(z+=x)%2:++z],z=1)

)()
```

```
<pre id=o>
```

---

## (Outdated) Explanation

We start with a string containing the characters for a single player with each line separated by an `n`, a `0` as the placeholder for the number and with `1` & `2` used as placeholders for the punctuation marks in the alternating feet.

We split the string to an array of the individual lines on `n`, map over that array replacing each element with itself repeated 8 time and then join the array to a string using a literal newline.

Finally, we replace each number in the string with either the required player number if the number is `0` or the necessary character to complete the player's feet if the number is `1` or `2`.

# Answer
> 6 votes
# SOGL, ~~92~~ ~~88~~ ~~87~~ 85 bytes

```
T◄ηψΚc∆╗*≥ζ≠/βW;θ/8ž⅔┌*lη.7¾η┐ø┘<ΟpC1ΧB‘-”ο⁸z╗≠#▲ķOjξ³Y3²‘čŗ9n8*č x"⁴⁾Jχ“r"}▓v#Χ⁶‘+čŗ

```

Explanation:

```
...‘                               push a compressed version of a soccer player
    -”                             push "-"
      ...‘č                        push ".]^[/~`-'~\\{<x>}" chopped into an array
           ŗ                       replace [in the player, "-", with each corresponding character]
            9n                     split into an array with each line with the length 9
              8*                   multiply 8 times horizonally
                č                  join into a multi-line string
                  x                push "x"
                   "...“r          push 86137542 converted to string
                         "...‘+    append to that ".,,..,,..,,..,,."
                               č   chop into an array of the chars
                                ŗ  replace [in the multi-line string, "x", with corresponding chars from "86137542.,,..,,..,,..,,."]

```

The compressed string is

```
   |-|      ---    ------- --| - |-- \\|___|/   /   \\   /__|__\\  | / \\ |  (/   \\)  |)   (| (x|,.,|x)

```

with dashes (because those could be compressed with boxstrings) in place of uncommon chars, which then get replaced and then split in lines to get

```
   |.|
   ]^[
 /~`-'~\
{<| x |>}
 \|___|/
  /   \
 /__|__\
 | / \ |
 (/   \)
 |)   (|
(x|,.,|x)

```

# Answer
> 4 votes
# Java, 391 444 bytes

EDIT: Truly fixed. God, that really made the size go up

```
class a{static void l(String s){for(int i=0;i<8;i++)System.out.print(s);System.out.println();}static void q(){int[] a={8,6,1,3,7,5,4,2};l("   |.|   ");l("   |.|   ");l("   ]^[   ");l(" /~`-'~\\ ");for(int i:a)System.out.print("{<| "+i+" |>}");System.out.println();l(" \\|___|/ ");l("  /   \\  ");l(" /__|__\\ ");l(" | / \\ | ");l(" |)   (| ");for(int i=0;i<8;i++)if(i%2==1)System.out.print("(,|,.,|.)");else System.out.print("(.|,.,|,)");}}

```

**Expanded**

```
class a
{
    static void l(String s)
    {
    for(int i=0;i<8;i++)
        System.out.print(s);
    System.out.println();
    }
    static void q()
    {
        int[] a={8,6,1,3,7,5,4,2};
        l("   |.|   ");
        l("   |.|   ");
        l("   ]^[   ");
        l(" /~`-'~\\ ");
        for(int i:a)
            System.out.print("{<| "+i+" |>}");
        System.out.println();
        l(" \\|___|/ ");
        l("  /   \\  ");
        l(" /__|__\\ ");
        l(" | / \\ | ");
        l(" |)   (| ");
        for(int i=0;i<8;i++)
            if(i%2==1)
                System.out.print("(,|,.,|.)");
            else
                System.out.print("(.|,.,|,)");
    }
}

```

# Answer
> 4 votes
# 05AB1E, ~~126~~ ~~124~~ ~~108~~ ~~106~~ 110 bytes

Thanks to *Emigna* for saving 7 bytes!

```
•5n¯в•vð3×Ðy"|.|
]^[
/~`-'~\
{<| ÿ |>}
\|___|/
/ÿ\
/__|__\
| / \ |
(/ÿ\)
|)ÿ(|".C.B})øJ»"(.|,.,|,)"Â„()Â‡«4×»

```

Uses the **05AB1E** encoding. Try it online!

# Answer
> 4 votes
# Ruby, 161

```
puts"|.|+]^[+/~`-'~\\+{<| %d |>}+\\|___|/+/   \\+/__|__\\+| / \\ |+(/   \\)+|)   (|+(.|,.,|,)(,|,.,|.)".split(?+).map{|i|(i.center(9)*8%[8,6,1,3,7,5,4,2])[0,72]}

```

Now with alternating feet. Internally it generates 8 double sets of feet (total 16). Some of these are then removed by truncating to 72 characters per line.

# Ruby, 144

```
puts"|.|+]^[+/~`-'~\\+{<| %d |>}+\\|___|/+/   \\+/__|__\\+| / \\ |+(/   \\)+|)   (|+(.|,.,|,)".split(?+).map{|i|i.center(9)*8%[8,6,1,3,7,5,4,2]}

```

Fairly simple, prints line by line, 8 partial footballers at a time and uses the `%` operator (like `sprintf`) to substitute the shirt numbers (when the string does not contain `%d` they are ignored.)

# Answer
> 3 votes
# Python 2.7, 179 bytes

```
print"\n".join(s*8for s in"   |.|   *   ]^[   * /~`-'~\ *{<| %s |>}* \|___|/ *  /   \  * /__|__\ * | / \ | * (/   \) * |)   (| *(%s|,.,|%s)".split("*"))%tuple("86137942"+".,,."*4)

```

Encode one player as a single string with out-of-band characters to let us split it into a list, so that we can then multiply each layer by 8 and finally insert the required numbers and punctuations into the output.

# Answer
> 3 votes
## JavaScript (ES6), ~~198~~ 197 bytes

Includes a leading line break.

```
f=(x=792)=>x--?f(x)+(x%72?'':`
`)+`   |.|      ]^[    /~\`-'~\\ {<| ${"75428613"[x%8]} |>} \\|___|/   /   \\   /__|__\\  | / \\ |  (/   \\)  |)   (| (${x&1?".|,.,|,":",|,.,|."})`[9*(x/9>>3)+x%9]:''

```

### Demo

```
f=(x=792)=>x--?f(x)+(x%72?'':`
`)+`   |.|      ]^[    /~\`-'~\\ {<| ${"75428613"[x%8]} |>} \\|___|/   /   \\   /__|__\\  | / \\ |  (/   \\)  |)   (| (${x&1?".|,.,|,":",|,.,|."})`[9*(x/9>>3)+x%9]:''

o.innerHTML = f()
```

```
<pre id=o></pre>
```

# Answer
> 2 votes
# Python 2, ~~207~~ ~~197~~ ~~186~~ 201 bytes

```
b=[x*8for x in"   |.|   #   ]^[   # /~`-'~\ ## \|___|/ #  /   \  # /__|__\ # | / \ | # (/   \) # |)   (| ".split("#")]+["(.|,.,|,)(,|,.,|.)"*4]
for y in'86137542':b[3]+='{<| %s |>}'%y
print'\n'.join(b)

```

Try it online!

Nothing very clever and way too long at ~~207~~ 197 ~~but as far as I can see, at least it prints the feet correctly~~.

**Edit** A bit better at 186

**Edit 2** Back to over 200 after spotting why the feet were not in fact right. Well hidden gotcha!

# Answer
> 1 votes
# PHP, 204 Bytes

```
<?=gzinflate(base64_decode(pdDLDcMwCAbgO1P8t9qS66jpIzlUWSRu6B6lmb3giAWKJawPDggAIFXQXwSk8drWoxQBYdjf59PeEAR9noIZsnwND8fFcXVMjrvj5hgNhCbMLAOC0BtphmbLhqA30obMtm0IBNGeTf8gCKnPlhGETqQZkvUOgVKVUouUnEpHzf9Vfg));

```

Try it online!

## PHP, 205 Bytes

```
for(;$i++<11;)for($p=print"
";$c=_86137542[$p++];)echo str_pad(["|.|","]^[","/~`-'~\\","{<| $c |>}","\|___|/","/   \\","/__|__\\","| / \ |","(/   \)","|)   (|",$p&1?"(,|,.,|.)":"(.|,.,|,)"][$i-1],9," ",2);

```

Try it online!

# PHP, 211 Bytes

```
for(;$i<11;)echo($p=str_pad)("
",73,$p(["|.|","]^[","/~`-'~\\","{<| ".join(" |>}{<| ",[8,6,1,3,7,5,4,2])." |>}","\|___|/","/   \\","/__|__\\","| / \ |","(/   \)","|)   (|","(.|,.,|,)(,|,.,|.)"][+$i++],9," ",2));

```

Try it online!

# Answer
> 1 votes
# C#, 420 bytes

Golf:

```
using System;using static System.Console;class Z{static void Main(){int[]a={8,6,1,3,7,6,4,2};int i=0;X("   |.|   ");X("   ]^[   ");X(" /~`-'~\\ ");for(i=0;i<8;i++)Write("{<| "+a[i]+" |>}");WriteLine();X(" \\|___|/ ");X("  /   \\  ");X(" /__|__\\ ");X(" | / \\ | ");X(" (/   \\) ");X(" |)   (| ");for(i=0;i<8;i++)Write((i%2==0)?"(.|,.,|,)":"(,|,.,|.)");}static void X(String s){for(int i=0;i<8;i++)Write(s);WriteLine();}}

```

Expanded:

```
using System;
using static System.Console;
class Z
{
    static void Main()
    {
        int[]a={8,6,1,3,7,6,4,2};
        int i=0;
        X("   |.|   ");
        X("   ]^[   ");
        X(" /~`-'~\\ ");
        for(i=0;i<8;i++)
            Write("{<| "+a[i]+" |>}");
        WriteLine();
        X(" \\|___|/ ");
        X("  /   \\  ");
        X(" /__|__\\ ");
        X(" | / \\ | ");
        X(" (/   \\) ");
        X(" |)   (| ");
        for(i=0;i<8;i++)
            Write((i%2==0)?"(.|,.,|,)":"(,|,.,|.)");
    }
    static void X(String s)
    {
        for(int i=0;i<8;i++)
            Write(s);
        WriteLine();
    }
}

```

Inspired by Jesse M's Java answer, with a few edits to make it shorter

# Answer
> 1 votes
# Ook!, 8519 bytes

```
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook! Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook. Ook. Ook? Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook? Ook. Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook. Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook. Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook! Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook? Ook. Ook? Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook. Ook? Ook. Ook. Ook! Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook! Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook! Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook? Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook. Ook! Ook. Ook! Ook. Ook! Ook. Ook. Ook? Ook! Ook! Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook. Ook? Ook! Ook. Ook. Ook? Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook. Ook? Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook. Ook. Ook? Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook? Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook? Ook. Ook! Ook! Ook? Ook!

```

I had to.

Port of tony200910041's brainf\**k answer

# Answer
> 1 votes
## Mathematica 282 bytes

```
d={"   |.|   ","   ]^[   "," /~`-'~\\ ",StringRiffle[{8,6,1,3,7,5,4,2},{"{<| "," |>}{<| "," |>}"}]
," \\|___|/ ","  /   \\  "," /__|__\\ "," | / \\ | "," (/   \\) "," |)   (| ", "(.|,.,|,)"};f[x_, y_] :=Table[Row@Table[d[[i]],8],{i,x,y}];Column@Flatten@Join[{f[1,3],d[[4]],f[5,11]}]

```

# Answer
> 1 votes
# Retina, 270 bytes

```

A |.|AKKKKKKK ¶A ]^[AJJJJJJJ NEEEEEEEE¶{<| 8H6H1H3H7H5H4H2 |>} N\|___|/GGGGGGG ¶MMMM NDDDDDDDDNCCCCCCCCNLLLLN|)A (|IIIIIII ¶BBBB
N
¶
M
AFAAFA
L
(F)A(F)A
K
AA|.|A
J
AA]^[A
I
A|)A (|
H
 |>}{<|
G
A\|___|/
F
/A \
E
/~`-'~\A
D
/__|__\A
C
| / \ |A
B
(.|,.,|,)(,|,.,|.)
A

```

Try it online!

# Answer
> 1 votes
# Bubblegum, ~~130~~ 117 bytes

```
00000000: a4c6 bb0d 4231 0c86 d1de 537c 1d89 1412  ....B1....S|....
00000010: f1a6 402c 42c0 ecc1 cf9d 1d5d 244f e053  ..@,B......]$O.S
00000020: 1d40 5d40 3206 3c5f 0f20 1963 2cef ed66  .@]@2.<_. .c,..f
00000030: 9964 639f 9bb8 a2fb 77cd 39b2 8b1c 2297  .dc.....w.9...".
00000040: c829 728c ecd7 604c b9bb 06c9 180c 6042  .)r...`L......`B
00000050: 36c6 7097 fb24 1b43 0c26 221b a30c 6056  6.p..$.C.&"...`V
00000060: b231 5481 2292 b1d2 d57a 53ab a5fd d3eb  .1T."....zS.....
00000070: 6fe4 8900 00                             o....

```

Try it online!

# Answer
> 1 votes
# Perl 5, 206 bytes

```
say$_ x 8 for'   |.|   ','   ]^[   ', " /~`-'~\\ ";print"{<| $_ |>}"for 8,6,1,3,7,5,4,2;say;say$_ x 8 for' \\|___|/ ','  /   \\  ',' /__|__\ ',' | / \\ | ',' (/   \\) ',' |)   (| ';say'(.|,.,|,)(,|,.,|.)'x4

```

Try it online!

It's ugly and brute force, but it works.

# Answer
> 0 votes
# Deadfish~, 4964 bytes

```
{i}cc{ii}iiccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddcccccc{{i}d}iic{{d}ii}iic{{i}dd}ddc{{d}i}ddccc{dd}ddc{ii}iiccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}icccccc{iiiiii}icicdddc{dddddd}iccc{dd}ddc{ii}iic{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{i}iiiiic{{i}dd}dc{ddd}c{ddddd}dcddddddc{{i}d}dddc{ddd}ddddc{dddddd}cc{dd}ddc{{i}}{i}iiic{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}iiiic{dd}ddddc{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}iic{dd}ddc{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}dddc{dd}iiic{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}dc{dd}ic{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}iiic{dd}dddc{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}ic{dd}dc{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}c{dd}c{{i}d}iic{dddddd}ddc{iiiiii}iiicddc{dddddd}dddc{iiiiii}iiiic{{d}i}ddc{ii}ddc{dd}iic{{i}d}iic{dddddd}ddc{iiiiii}iiic{{d}i}dddc{dd}ddc{ii}iic{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddcc{iiiiii}c{iii}iic{ddd}iccc{iii}dc{{d}ii}iiic{d}dddddc{dd}ddc{ii}iicc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddccc{iiiiii}c{dddddd}ccc{dd}ddc{ii}iic{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{i}iiiiic{iiiii}ddcc{iii}dc{ddd}iccdddc{dddddd}cc{dd}ddc{ii}iic{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{i}iiiiic{d}dddddc{iiiiii}c{dddddd}c{{i}d}iic{{d}i}ddcc{dd}ddc{ii}iic{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{i}ddc{i}dddc{d}dddddccc{iiiiii}c{ddddd}dc{d}icc{dd}ddc{ii}iic{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddcc{{i}d}iic{{d}ii}dddc{d}iccc{i}ddc{{i}dd}iiiic{{d}i}ddc{dd}ddc{iii}ciiiiiic{{i}dd}ddc{{d}ii}ciicddc{{i}dd}c{{d}ii}cdddcdciiiic{{i}dd}c{{d}ii}ciicddc{{i}dd}c{{d}ii}iicdddddcdciiiiiic{{i}dd}ddc{{d}ii}ciicddc{{i}dd}c{{d}ii}cdddcdciiiic{{i}dd}c{{d}ii}ciicddc{{i}dd}c{{d}ii}iicdddddcdciiiiiic{{i}dd}ddc{{d}ii}ciicddc{{i}dd}c{{d}ii}cdddcdciiiic{{i}dd}c{{d}ii}ciicddc{{i}dd}c{{d}ii}iicdddddcdciiiiiic{{i}dd}ddc{{d}ii}ciicddc{{i}dd}c{{d}ii}cdddcdciiiic{{i}dd}c{{d}ii}ciicddc{{i}dd}c{{d}ii}iicdddddc{ddd}dc

```

Try it online!

Wow, out-ungolfed everyone by 25x!

---
Tags: code-golf, ascii-art, kolmogorov-complexity
---


title: Embedded Diamonds!

text:
# Question
Title: Embedded Diamonds!
No, not this. And not this either. This question is nothing like those

Write the shortest code to print/return the following output:

```
   /\      /\      /\
  /  \    /  \    /  \
 / /\ \  / /\ \  / /\ \
/ /  \ \/ /  \ \/ /  \ \
\ \  / /\ \  / /\ \  / /
 \ \/ /  \ \/ /  \ \/ /
  \  / /\ \  / /\ \  /
   \/ /  \ \/ /  \ \/
   /\ \  / /\ \  / /\
  /  \ \/ /  \ \/ /  \
 / /\ \  / /\ \  / /\ \
/ /  \ \/ /  \ \/ /  \ \
\ \  / /\ \  / /\ \  / /
 \ \/ /  \ \/ /  \ \/ /
  \  /    \  /    \  /
   \/      \/      \/

```
* Standard methods of input/output.
* Standard loopholes apply.
* Trailing/leading whitespace is okay, in any amount.

# Answer
# Charcoal, ~~28~~ ~~24~~ 23 bytes

```
↗²↖↙⁴⟲Ｐ²⁴⁶↘↙↙²⟲Ｐ²⁴⁶Ｃ⁸¦⁰

```

Try it online! Explanation:

```
↗²↖↙⁴   Draw the top left 4x4 corner
         /
        //
⟲Ｐ²⁴⁶   Rotate it three times to complete a diamond
         /\
        //\\
        \\//
         \/
↘↙↙²    Draw the top left line of the inner diamond
         /\
        //\\
        \\//
         \//
⟲Ｐ²⁴⁶   Rotate three times to complete five diamonds
Ｃ⁸¦⁰    Copy everything 8 characters to the right to complete eight diamonds

```

Edit: My previous answer used `‖Ｍ‖Ｍ↓` to create a whole diamond by reflecting the top corner, but due to a bug in Charcoal this left the cursor out of position. Fortunately I discovered another way of achieving the same effect which doesn't move the cursor, which meant that I saved a byte drawing the inner diamond. (I also looked into overlapping operations, but I wasn't able to improve on the rotate/copy approach.)

Edit: `↖²↗↘⁴‖Ｍ¬Ｍ¹¦³↘²‖Ｍ¬Ｃ⁸¦⁰` does the job in 21 bytes, but that relies on the new reflecting behaviour, so I don't know whether this was possible with the old code.
> 16 votes

# Answer
# Charcoal, ~~62~~ ~~50~~ ~~48~~ ~~45~~ ~~42~~ 40 bytes

*Thanks to @Okx for saving two bytes!*

```
↙²→↘²↙↖⁴→↗⁴‖ＭＦ²Ｃ⁸¦⁰Ｍ⁸↓→↗²↓↘²Ｍ⁴→↑↗²↓↘²‖Ｍ↓

```

Try it online!

**Explanation:**

```
↙²→↘²          // Draw the left half of the inner part of the first diamond.
↖⁴→↗⁴          // Draw the left half of the outer part.
‖Ｍ             // Mirror the half of the diamond to create the first full diamond.
Ｆ²Ｃ⁸¦⁰         // Copy the picture eight characters to the left twice.
               // The first copy gives us two diamonds, and the second copy of the
               // two diamonds overlaps so that the result is three diamonds.
Ｍ⁸↓→↗²↓↘²     // Move down to draw the upper inner half of the first middle diamond.
Ｍ⁴→↑↗²↓↘²     // Move right to do the same for the second middle diamond.
‖Ｍ↓           // Mirror the whole thing vertically.

```
> 7 votes

# Answer
# PHP, 126 Bytes

```
<?=gzinflate(base64_decode("vY7BCQAwCAP/mSIbuJD7z1GJLbbiuz5yKCeEpDk1RUSQWm8iMiRnIyw178Qgi5hs3ceHOA86snN7ON2b/687X+7umuIC"));

```

Try it online!

# PHP, 149 Bytes

```
$s=strtr("000
111
222
333
444
555
  \ 22 /
   \\33/   ",["   /\   ","  /  \  "," / /\ \ ","/ /  \ \\","\ \  / /"," \ \/ / "]);echo"$s
".strrev($s);

```

Try it online!
> 6 votes

# Answer
# 05AB1E, ~~45~~ ~~44~~ 43 bytes

Code:

```
…/ \©•—‹íćCé']d₂2ó@¯çX‘¯¨•3вè8äJvyÂ®Â‡«}»Â»

```

Pre-explanation:

The `•—‹íćCé'\]d₂2ó@¯çX‘¯¨•3в` part is just a compressed version of the following array:

```
[1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 2, 1, 2, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 2, 1, 2, 1, 1, 0, 1, 0, 2, 1, 2, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2]

```

Which we index into the string `…/ \`. This maps `0 -> /`, `1 -> space`, `2 -> \`. After that, we process this string with the following program:

```
8äJvyÂ®Â‡«}»Â»

8ä               # Split the array into 8 pieces
  J              # Join each sub-array in the array
   vy     }      # For each string in the array
     Â           #   Bifurcate (duplicate and reverse)
      ®          #   Push the string "/ \" (which was copied using ©)
       Â         #   Bifurcate to get "\ /"
        ‡        #   Transliterate / -> \ and \ -> /
         «       #   Append to the original string
           »     # Join the entire stack on newlines
            Â    # Bifurcate
             »   # Join the stack by newlines

```

Uses the **05AB1E** encoding. Try it online!
> 6 votes

# Answer
# Ruby, ~~99~~ 97 bytes

```
400.times{|i|print (23<x=i%25)?$/:" /  \\   "[(x^y=i/25)&4^x+y&1^(x-2&4&y-2>y/6%2*x/2%11*4?2:0)]}

```

**Explanation**

Each 4x4 square contains only spaces and `/` or `\`. We plot these to give the overall diamond pattern. To avoid partial patterns at the borders, certain 2x2 squares must be left blank as below.

```
.. /\ .... /\ .... /\ ..
../  \..../  \..../  \..
 / /\ \  / /\ \  / /\ \
/ /  \ \/ /  \ \/ /  \ \
\ \  / /\ \  / /\ \  / /
 \ \/ /  \ \/ /  \ \/ /
..\  / /\ \  / /\ \  /..
.. \/ /  \ \/ /  \ \/ ..
.. /\ \  / /\ \  / /\ ..
../  \ \/ /  \ \/ /  \..
 / /\ \  / /\ \  / /\ \
/ /  \ \/ /  \ \/ /  \ \
\ \  / /\ \  / /\ \  / /
 \ \/ /  \ \/ /  \ \/ /
..\  /....\  /....\  /..
.. \/ .... \/ .... \/ ..

```

**Ungolfed version** \- modified to print the above to assist in explanation

```
400.times{|i|print (23<x=i%25)?$/:     #Calculate x. If last column, print a newline else
  " /..\\ .."[(x^y=i/25)&4^x+y&1^      #If (x^y)&4==4, use x+y&1 to select between space and /. If (x^y)&4==0 select between \ and space.
  (x-2&4&y-2>y/6%2*x/2%11*4?2:0)]      #If x-2&4&y-2==4, and we are on the 2 character wide border (y/6%2*x/2%11==0), XOR with 2 to print .
}

```
> 5 votes

# Answer
# JavaScript, 232 bytes

```
_=>(a=`3868683
2/274/274/272
1/18172/18172/18171
/1/27191/27191/2717
7172/18172/18172/1/
17191/27191/27191/1
272/18172/18172/2
391/27191/27193`.replace(/\d/g,n=>n>6?['\\','/\\','\\/'][n-7]:'
'.repeat(n)))+`
`+[...a].reverse().join``

```

### Try it online!

```
const f = _=>(a=`3868683
2/274/274/272
1/18172/18172/18171
/1/27191/27191/2717
7172/18172/18172/1/
17191/27191/27191/1
272/18172/18172/2
391/27191/27193`.replace(/\d/g,n=>n>6?['\\','/\\','\\/'][n-7]:' '.repeat(n)))+`
`+[...a].reverse().join``

console.log(`
${f()}
`)
```
> 3 votes

# Answer
# Pyth - ~~106~~ ~~98~~ ~~96~~ 92 bytes

```
V16V24J%t+NH8K%+_2-NH8=Y&&&>H1>N1<N14<H22p?|q2J&&Y!%J4?<1%H4J!J\/?|q2K&&Y!%K4?<1%H4!KK\\d)pb

```

Try it
> 2 votes

# Answer
# Canvas, 18 bytes

```
４／２／３３╋╬２／７７╋╬：９１╋

```

Try it here!

Explanation:

```
4/           push a diagonal of length 4
  2/         push a diagonal of length 2
    33╋      insert that at [3;3] in the 1st diagonal
                    /
                   /
                  / /
                 / /
╬            quad-palindromize with 0 overlap
 2/77╋       insert a 2-long diagonal in the bottom-right corner
                    /\
                   /  \
                  / /\ \
                 / /  \ \
                 \ \  / /
                  \ \/ /
                   \  / /
                    \/ /
      ╬      quad-palindromize with 0 overlap, creating most of the output
                    /\      /\
                   /  \    /  \
                  / /\ \  / /\ \
                 / /  \ \/ /  \ \
                 \ \  / /\ \  / /
                  \ \/ /  \ \/ /
                   \  / /\ \  /
                    \/ /  \ \/
                    /\ \  / /\
                   /  \ \/ /  \
                  / /\ \  / /\ \
                 / /  \ \/ /  \ \
                 \ \  / /\ \  / /
                  \ \/ /  \ \/ /
                   \  /    \  /
                    \/      \/
       :91╋  overlap self on [9;1]

```
> 2 votes

# Answer
# C#, 608 bytes

```
void q(){Action<string>a=Console.Write;Func<int,int,string>b=(c,d)=>new string(' ',c)+(d<1?"/\\":d<2?"/  \\":d<3?"/ /\\ \\":d<4?"/ /  \\ \\":d<5?"\\ \\  / /":d<6?"\\ \\/ /":d<7?"\\  /":"\\/");Action e=()=>a(b(0,4)+b(0,4)+b(0,4)+"\n"+b(1,5)+b(2,5)+b(2,5)+"\n");Action f=()=>a(b(1,2)+b(2,2)+b(2,2)+"\n");Action g=()=>a(b(0,3)+b(0,3)+b(0,3)+"\n");a(b(3,0)+b(6,0)+b(6,0)+"\n"+b(2,1)+b(4,1)+b(4,1)+"\n");f();g();e();a("  \\  / /\\ \\  / /\\ \\  /\n"+"   \\/ /  \\ \\/ /  \\ \\/\n"+"   /\\ \\  / /\\ \\  / /\\\n"+"  /  \\ \\/ /  \\ \\/ /  \\\n");f();g();e();a(b(2,6)+b(4,6)+b(4,6)+"\n"+b(3,7)+b(6,7)+b(6,7)+"\n");}

```
> 1 votes

# Answer
## Javascript 126 bytes

```
for(c=r=a='';r<16;c++>22&&(r++,c=0,a+=`
`))C=c%22>1&&r%14>1,q=[1,,C&&r&2,,,,C&&~r&2,,1],a+=q[c+5+r&7]?'/':q[r-c+20&7]?'\\':' '

```

Since it's now pretty unreadable, a basic explanation:

* we tile the space top left to bottom right
* we draw it as basically 6 diagonal lines that repeat every 8 characters: 2 solid lines, and 4 that are "dashed" (two characters, then two spaces...)
* the `C=...` stuff is to limit drawing of some of the lines to within a bounding box
* to save a lot of characters, we deliberately add numbers to make the expressions for the upwards and downwards lines extremely similar
* then, put the expressions themselves into a sparse array `[1,,C&&...]`, which we look up into. If there is a truthy value, we draw the appropriate character.

-

```
for(c=r=a='';r<16;c++>22&&(r++,c=0,a+=`
`))                 // basic grid tiling
C=c%22>1&&r%14>1,   // are we not near the edges
q=[1,               // a solid line that always draws
,                   // a line that never draws
C&&r&2,             // a line that draws if not near the edge, and if on the correct "dash" (r&2)
,,,
C&&~r&2,            // if not near the edge, and on the opposite "dash" (~r&2)
,1                  // the opposite diagonal line that always draws
],
a+=q[c+5+r&7]?'/' // compute which upward line we're on, check whether to draw it
:q[r-c+20&7]?'\\' // do the same for the downward line
:' '                // otherwise draw a space

```

Maybe this explanation didn't help. :)

Try online: https://codepen.io/stevebennett/pen/WjgMpY

Hopefully I got the output right:

```
   /\      /\      /\
  /  \    /  \    /  \
 / /\ \  / /\ \  / /\ \
/ /  \ \/ /  \ \/ /  \ \
\ \  / /\ \  / /\ \  / /
 \ \/ /  \ \/ /  \ \/ /
  \  / /\ \  / /\ \  /
   \/ /  \ \/ /  \ \/
   /\ \  / /\ \  / /\
  /  \ \/ /  \ \/ /  \
 / /\ \  / /\ \  / /\ \
/ /  \ \/ /  \ \/ /  \ \
\ \  / /\ \  / /\ \  / /
 \ \/ /  \ \/ /  \ \/ /
  \  /    \  /    \  /
   \/      \/      \/

```

# History

## 130

```
for(c=r=a='';r<16;c++>22&&(r++,c=0,a+=`
`))C=c%22>1&&r%14>1,q=[1,,C&&r&2,,,,C&&~r&2,,1],a+=q[(c+5+r)%8]?'/':q[(r-c+20)%8]?'\\':' '

```

## 133

```
for(c=r=a='';r<16;c++>22&&(r++,c=0,a+=`
`))C=c%22>1,q=[1,,C&&r&2&&r<14,,,,C&&~r&2&&r>1,,1],a+=q[(c+5+r)%8]?'/':q[(r-c+20)%8]?'\\':' '

```

## 137

```
for(c=r=a='';r<16;c++==23&&(r++,c=0,a+=`
`))C=c<22&&c>1,q=[1,,C&&r&2&&r<14,,,,C&&~r&2&&r>1,,1],a+=q[(c+5+r)%8]?'/':q[(r-c+20)%8]?'\\':' '

```

## 155

```
for(c=r=a='';r<16;c++==23&&(r++,c=0,a+=`
`))Z=(C=c<22&&c>1)&&~r&2&&r>1,Y=C&&r&2&&r<14,B=(c-r+12)%8,A=(c+5+r)%8,q=[1,,Y,,,,Z,,1],a+=q[A]?'/':q[8-B]?'\\':' '

```

## History: 172

```
for(c=r=a='';r<16;c++==23&&(r++,c=0,a+='\n'))a+=(Z=(C=c<22&&c>1)&&~r&2&&r>3,Y=C&&r&2&&r<12,B=(c-r+16)%8,A=(c+r)%8,A==3||A==5&&Y||A==1&&Z?'/':B==4||B==2&&Y||B==6&&Z?'\\':' ')

```
> 1 votes

# Answer
# C#, ~~382~~ 291 bytes

```
_=>string.Format(@"{5}{5}{5}
{2}{2}{2}
{0}{0}{0}
{1}{1}{1}
\ \ {0}{0} / /
 \ \{1}{1}/ /
  \ {0}{0} /
   \{1}{1}/
   /\ \ {0} / /\
  /  \ \{1}/ /  \
 {0}{0}{0}
{1}{1}{1}
\ \ {0}{0} / /
 \ \{1}{1}/ /
{4}{4}{4}
{3}{3}{3}",@" / /\ \ ",@"/ /  \ \",@"  /  \  ",@"   \/   ",@"  \  /  ",@"   /\   ");

```
> 1 votes

# Answer
# PowerShell, ~~168~~ ~~125~~ ~~122~~ 121 bytes

```
$a=(,' '*24+'
')*16
0,8,8+(88,8)*2+8|%{$i=$o+=$_
'&$:&8%$%6%&%5%&%6%$%8&:$'|% t*y|%{$i+=$_-35;$a[$i]='\/'[$i%2]}}
-join$a

```

Try it online!

The script creates the array of 400 chars and renders 8 diamonds started from positions with intervals `0,8,8,88,8,88,8,8`.

* The string `'&$:&8%$%6%&%5%&%6%$%8&:$'` contains the intervals of offsets for the rendered symbols.
* The expression `|% t*y` is shortcut for `|foreach-object toCharArray`

First render steps:

```
---/\-------------------
--/--\------------------
-/-/\-\-----------------
/-/--\-\----------------
\-\--/-/----------------
-\-\/-/-----------------
--\--/------------------
---\/-------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------

```

---

```
---/\------/\-----------
--/--\----/--\----------
-/-/\-\--/-/\-\---------
/-/--\-\/-/--\-\--------
\-\--/-/\-\--/-/--------
-\-\/-/--\-\/-/---------
--\--/----\--/----------
---\/------\/-----------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------

```

---

```
---/\------/\------/\---
--/--\----/--\----/--\--
-/-/\-\--/-/\-\--/-/\-\-
/-/--\-\/-/--\-\/-/--\-\
\-\--/-/\-\--/-/\-\--/-/
-\-\/-/--\-\/-/--\-\/-/-
--\--/----\--/----\--/--
---\/------\/------\/---
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------
------------------------

```

---

```
---/\------/\------/\---
--/--\----/--\----/--\--
-/-/\-\--/-/\-\--/-/\-\-
/-/--\-\/-/--\-\/-/--\-\
\-\--/-/\-\--/-/\-\--/-/
-\-\/-/--\-\/-/--\-\/-/-
--\--/-/\-\--/----\--/--
---\/-/--\-\/------\/---
----\-\--/-/------------
-----\-\/-/-------------
------\--/--------------
-------\/---------------
------------------------
------------------------
------------------------
------------------------

```

and so on.
> 1 votes

# Answer
# Retina, 214 bytes

```

F/\E/\E/\¶B/B\BB/B\FAD D¶F\/ C C¶FD D /\¶BC CAF\B/BB\B/¶F\/E\/E\/
F
B
E
BBB
D
/\ \B/
C
/B\ \/
B

A
 /  \¶ / /\ \  / /\ \  / /\ \¶/ /  \ \/ /  \ \/ /  \ \¶\ \  / /\ \  / /\ \  / /¶ \ \/ /  \ \/ /  \ \/ /¶  \  /

```

Try it online!
> 0 votes

# Answer
# Japt, 75 bytes

Can't seem to golf at all today :\ This is hideous!

```
`66e7s2gf8447sppcpÜ;7¶p1paff2kmbj1l3odfs4q1½0j¢·lqbs`q¤®©n28" /\\"Ã·ê û

```

Test it
> 0 votes

# Answer
# Deadfish~, 2839 bytes

```
{iii}iiccc{i}iiiiic{iiii}iiiiic{dddddd}cccccc{i}iiiiic{iiii}iiiiic{dddddd}cccccc{i}iiiiic{iiii}iiiiic{{d}ii}ddc{ii}iicc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}cccc{i}iiiiic{d}dddddcc{iiiiii}c{{d}ii}ddc{ii}iic{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{{d}ii}ddc{iiii}dddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{{d}ii}ddc{{i}dd}iic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{dddd}iiic{ii}iic{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{dddd}iiic{ii}iicc{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{dddd}iiic{ii}iiccc{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{dddd}iiic{ii}iiccc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{{d}ii}ddc{ii}iicc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{{d}ii}ddc{ii}iic{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{{d}ii}ddc{iiii}dddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{{d}ii}ddc{{i}dd}iic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{iiii}iiiiic{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{dddd}iiic{ii}iic{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{dddd}iiic{ii}iicc{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddcccc{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddcccc{iiiiii}c{dddddd}cc{i}iiiiic{dddd}iiic{ii}iiccc{iiiiii}c{dddd}dddddc{d}dddddcccccc{iiiiii}c{dddd}dddddc{d}dddddcccccc{iiiiii}c{dddd}dddddc

```

Try it online!

Deadfish - always way longer than the output and extremely inefficient.
> 0 votes

---
Tags: code-golf, ascii-art, kolmogorov-complexity, geometry
---


title: Words with Blocks

text:
# Question
Title: Words with Blocks
Given a dictionary of 4-letter words that have no repeated characters (***from this list of words***), you must choose ONE of those words, and output that specific word using the following dictionary of block letters:

```
 .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| |      __      | || |   ______     | || |     ______   | || |  ________    | |
| |     /  \     | || |  |_   _ \    | || |   .' ___  |  | || | |_   ___ '.  | |
| |    / /\ \    | || |    | |_) |   | || |  / .'   \_|  | || |   | |   '. \ | |
| |   / ____ \   | || |    |  __'.   | || |  | |         | || |   | |    | | | |
| | _/ /    \ \_ | || |   _| |__) |  | || |  \ '.___.'\  | || |  _| |___.' / | |
| ||____|  |____|| || |  |_______/   | || |   '._____.'  | || | |________.'  | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'
 .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| |  _________   | || |  _________   | || |    ______    | || |  ____  ____  | |
| | |_   ___  |  | || | |_   ___  |  | || |  .' ___  |   | || | |_   ||   _| | |
| |   | |_  \_|  | || |   | |_  \_|  | || | / .'   \_|   | || |   | |__| |   | |
| |   |  _|  _   | || |   |  _|      | || | | |    ____  | || |   |  __  |   | |
| |  _| |___/ |  | || |  _| |_       | || | \ '.___]  _| | || |  _| |  | |_  | |
| | |_________|  | || | |_____|      | || |  '._____.'   | || | |____||____| | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'
 .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| |     _____    | || |     _____    | || |  ___  ____   | || |   _____      | |
| |    |_   _|   | || |    |_   _|   | || | |_  ||_  _|  | || |  |_   _|     | |
| |      | |     | || |      | |     | || |   | |_/ /    | || |    | |       | |
| |      | |     | || |   _  | |     | || |   |  __'.    | || |    | |   _   | |
| |     _| |_    | || |  | |_' |     | || |  _| |  \ \_  | || |   _| |__/ |  | |
| |    |_____|   | || |  '.___.'     | || | |____||____| | || |  |________|  | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'
 .----------------.  .-----------------. .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| | ____    ____ | || | ____  _____  | || |     ____     | || |   ______     | |
| ||_   \  /   _|| || ||_   \|_   _| | || |   .'    '.   | || |  |_   __ \   | |
| |  |   \/   |  | || |  |   \ | |   | || |  /  .--.  \  | || |    | |__) |  | |
| |  | |\  /| |  | || |  | |\ \| |   | || |  | |    | |  | || |    |  ___/   | |
| | _| |_\/_| |_ | || | _| |_\   |_  | || |  \  '--'  /  | || |   _| |_      | |
| ||_____||_____|| || ||_____|\____| | || |   '.____.'   | || |  |_____|     | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'
 .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| |    ___       | || |  _______     | || |    _______   | || |  _________   | |
| |  .'   '.     | || | |_   __ \    | || |   /  ___  |  | || | |  _   _  |  | |
| | /  .-.  \    | || |   | |__) |   | || |  |  (__ \_|  | || | |_/ | | \_|  | |
| | | |   | |    | || |   |  __ /    | || |   '.___'-.   | || |     | |      | |
| | \  '-'  \_   | || |  _| |  \ \_  | || |  |'\____) |  | || |    _| |_     | |
| |  '.___.\__|  | || | |____| |___| | || |  |_______.'  | || |   |_____|    | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'
 .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| | _____  _____ | || | ____   ____  | || | _____  _____ | || |  ____  ____  | |
| ||_   _||_   _|| || ||_  _| |_  _| | || ||_   _||_   _|| || | |_  _||_  _| | |
| |  | |    | |  | || |  \ \   / /   | || |  | | /\ | |  | || |   \ \  / /   | |
| |  | '    ' |  | || |   \ \ / /    | || |  | |/  \| |  | || |    > '' <    | |
| |   \ '--' /   | || |    \ ' /     | || |  |   /\   |  | || |  _/ /''\ \_  | |
| |    '.__.'    | || |     \_/      | || |  |__/  \__|  | || | |____||____| | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'
 .----------------.  .----------------.
| .--------------. || .--------------. |
| |  ____  ____  | || |   ________   | |
| | |_  _||_  _| | || |  |  __   _|  | |
| |   \ \  / /   | || |  |_/  / /    | |
| |    \ \/ /    | || |     .'.' _   | |
| |    _|  |_    | || |   _/ /__/ |  | |
| |   |______|   | || |  |________|  | |
| |              | || |              | |
| '--------------' || '--------------' |
 '----------------'  '----------------'

```

Depending on how old you are, you may have just been given an injection of nostalgia from these block-based letters. Then again, past a certain point, you may have the nostalgia from watching your kids spell these block-based words out on their own. First originating in 1693, alphabet blocks were a pretty common education piece of the nuclear family and beyond. We're going to recreate this nostalgia by spelling a word ***from this list of words***.

In other words, this challenge is to pick four letters from the keyspace definition and render them "stacked" in an order specified by the dictionary. You'll notice the dictionary omits 4-letter words like `moon` as they repeat letters, and are basically cheat-words.

Here is the block structure itself with no character inside:

```
 .----------------.
| .--------------. | # Tops are periods.
| |              | |
| |              | |
| |              | |
| |              | |
| |              | |
| |              | |
| |              | |
| '--------------' | # Bottoms are apostrophe's.
 '----------------'

```

# Rules

* Characters inside the blocks only use: `|/\_'.]-><`.
* Numbers don't exist, nor do symbols; only the letters in the word list.
* This is a kolmogorov-complexity problem after you've chosen your word, you must output each block exactly as shown.
* You may output them in any format you want, vertical, horizontal, stacked in a square; however, it must read top-to-bottom, left-to-right. Also, each block must be displayed without being altered, in a coherent format. This is to give more freedom to save bytes and allow a diverse output structure, much like how it would be when playing with blocks.
* The main competitive element of this challenge is both compression optimization and, like my other problem, also factors in your ability to problem solve given the leg-room of seemingly "aesthetic" choice.

# Examples

```
 .----------------.  .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| |  _________   | || |  ____  ____  | || |   ______     | || |  _________   | |
| | |  _   _  |  | || | |_  _||_  _| | || |  |_   __ \   | || | |_   ___  |  | |
| | |_/ | | \_|  | || |   \ \  / /   | || |    | |__) |  | || |   | |_  \_|  | |
| |     | |      | || |    \ \/ /    | || |    |  ___/   | || |   |  _|  _   | |
| |    _| |_     | || |    _|  |_    | || |   _| |_      | || |  _| |___/ |  | |
| |   |_____|    | || |   |______|   | || |  |_____|     | || | |_________|  | |
| |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'  '----------------'

```

Is the same validity as:

```
 .----------------.
| .--------------. |
| |  _________   | |
| | |  _   _  |  | |
| | |_/ | | \_|  | |
| |     | |      | |
| |    _| |_     | |
| |   |_____|    | |
| |              | |
| '--------------' |
 '----------------'
 .----------------.
| .--------------. |
| |  ____  ____  | |
| | |_  _||_  _| | |
| |   \ \  / /   | |
| |    \ \/ /    | |
| |    _|  |_    | |
| |   |______|   | |
| |              | |
| '--------------' |
 '----------------'
 .----------------.
| .--------------. |
| |   ______     | |
| |  |_   __ \   | |
| |    | |__) |  | |
| |    |  ___/   | |
| |   _| |_      | |
| |  |_____|     | |
| |              | |
| '--------------' |
 '----------------'
 .----------------.
| .--------------. |
| |  _________   | |
| | |_   ___  |  | |
| |   | |_  \_|  | |
| |   |  _|  _   | |
| |  _| |___/ |  | |
| | |_________|  | |
| |              | |
| '--------------' |
 '----------------'

```

Which is just as valid as:

```
                     .----------------.
                    | .--------------. |
                    | |  _________   | |
                    | | |  _   _  |  | |
                    | | |_/ | | \_|  | |
                    | |     | |      | |
                    | |    _| |_     | |
                    | |   |_____|    | |
                    | |              | |
                    | '--------------' |
                     '----------------'
 .----------------.  .----------------.  .----------------.
| .--------------. || .--------------. || .--------------. |
| |  ____  ____  | || |   ______     | || |  _________   | |
| | |_  _||_  _| | || |  |_   __ \   | || | |_   ___  |  | |
| |   \ \  / /   | || |    | |__) |  | || |   | |_  \_|  | |
| |    \ \/ /    | || |    |  ___/   | || |   |  _|  _   | |
| |    _|  |_    | || |   _| |_      | || |  _| |___/ |  | |
| |   |______|   | || |  |_____|     | || | |_________|  | |
| |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' |
 '----------------'  '----------------'  '----------------'

```

This also works:

```
 .----------------.  .----------------.
| .--------------. || .--------------. |
| |  _________   | || |  ____  ____  | |
| | |  _   _  |  | || | |_  _||_  _| | |
| | |_/ | | \_|  | || |   \ \  / /   | |
| |     | |      | || |    \ \/ /    | |
| |    _| |_     | || |    _|  |_    | |
| |   |_____|    | || |   |______|   | |
| |              | || |              | |
| '--------------' || '--------------' |
 '----------------'  '----------------'
 .----------------.  .----------------.
| .--------------. || .--------------. |
| |   ______     | || |  _________   | |
| |  |_   __ \   | || | |_   ___  |  | |
| |    | |__) |  | || |   | |_  \_|  | |
| |    |  ___/   | || |   |  _|  _   | |
| |   _| |_      | || |  _| |___/ |  | |
| |  |_____|     | || | |_________|  | |
| |              | || |              | |
| '--------------' || '--------------' |
 '----------------'  '----------------'

```

Even stuff that seems like it would cost bytes for you to do:

```
    .----------------.  .----------------.
   | .--------------. || .--------------. |
   | |  _________   | || |  ____  ____  | |
   | | |  _   _  |  | || | |_  _||_  _| | |
   | | |_/ | | \_|  | || |   \ \  / /   | |
   | |     | |      | || |    \ \/ /    | |
   | |    _| |_     | || |    _|  |_    | |
   | |   |_____|    | || |   |______|   | |
   | |              | || |              | |
   | '--------------' || '--------------' |
    '----------------'  '----------------'
           .----------------.  .----------------.
          | .--------------. || .--------------. |
          | |   ______     | || |  _________   | |
          | |  |_   __ \   | || | |_   ___  |  | |
          | |    | |__) |  | || |   | |_  \_|  | |
          | |    |  ___/   | || |   |  _|  _   | |
          | |   _| |_      | || |  _| |___/ |  | |
          | |  |_____|     | || | |_________|  | |
          | |              | || |              | |
          | '--------------' || '--------------' |
           '----------------'  '----------------'

```

However you can stack the blocks to save yourself bytes is a winner in my book.

This is , lowest byte-count wins.

# Answer
# Charcoal, ~~180~~ ~~164~~ ~~162~~ ~~159~~ ~~158~~ 155 bytes

```
→⁸↘.↓⁹← '←⁸↗→⁶↗'↑⁷← .←⁶↘Ｆ³Ｃ⁰¦¹¹↓↓↗²____↓←|_↓↓³↗↘_←|_____↑¹↗²↓↓²↖↙_Ｍ⁶↓↘_↘⁴↑↘_←|____↑¹→↖\_↓\_Ｍχ↓↗²← _↑¹ ____↓←|↙_↙²|_↓←|___↘Ｍ⁵↓_↘_→'↘.↓\|↙¹←'.__↗→¹↗'↖|←.-‖Ｍ←

```

Try it online! Edit: Saved ~~16~~ 18 bytes by manually drawing the letters `WAY`; unfortunately `X` turns out to be too hard to draw, so it's still printed using a string literal. Saved a further 3 bytes by switching from `WAXY` to `AHOY`. Saved another byte by switching to `MAYO` because I can use the predefined `χ` variable for 10. Saved a further 3 bytes by repeating the copy of the border in a loop. Explanation:

```
→⁸↘.↓⁹← '←⁸↗    Draw the outer right half of a block
→⁶↗'↑⁷← .←⁶↘    Draw the inner right half of a block
Ｆ³Ｃ⁰¦¹¹         Make three copies of the right half of the block
↓↓              Move into position and draw an M right half
↗²____↓←|_↓↓³↗↘_←|_____↑¹↗²↓↓²↖↙_
Ｍ⁶↓             Move into position and draw an A right half
↘_↘⁴↑↘_←|____↑¹→↖\_↓\_
Ｍχ↓             Move into position and draw a Y right half
↗²← _↑¹ ____↓←|↙_↙²|_↓←|___↘
Ｍ⁵↓             Move into position and draw an O right half
_↘_→'↘.↓\|↙¹←'.__↗→¹↗'↖|←.-
‖Ｍ←             Reflect to the left

```

Full list of letter right halves:

```
A   ↘_↘⁴↑↘_←|____↑¹→↖\_↓\_              (22 bytes)
H   _↑¹←↑¹ ____↓←|_↓↓³↗↘_←|____↑¹→↑¹←↓_ (35 bytes)
M   ↗²____↓←|_↓↓³↗↘_←|_____↑¹↗²↓↓²↖↙_   (33 bytes)
O   _↘_→'↘.↓\|↙¹←'.__↗→¹↗'↖|←.-↘        (28 bytes)
W   ↘²↑↑²← _↑¹ _____↓←|_↓↓⁴↖←__↖²↘      (30 bytes)
X    ____¶|_  _|¶ / /¶' <¶'\ \_¶|____|¶ (35 bytes)
Y   ↗²← _↑¹ ____↓←|↙_↙²|_↓←|___↘        (28 bytes)

```

If `O`, `W`, `X` or `Y` is the last letter then the last byte can be removed. On the other hand, `M`, `W` and `Y` cost 2 bytes as a first letter or a byte as the letter after `O`; `H` costs a byte as a first letter. With the above byte counts, the following words are possible:

```
MAYO 155 bytes (43+33+22+28+28+2-1)
AHOY 156 bytes (43+22+35+28+28+1-1)
WAXY 159 bytes (43+30+22+35+28+2-1)
WHOA 160 bytes (43+30+35+28+22+2)
HOAX 163 bytes (43+35+28+22+35+1-1)
WHAM 165 bytes (43+30+35+22+33+2)
WHOM 171 bytes (43+30+35+28+33+2)

```
> 8 votes

# Answer
# PHP, 362 Bytes

MILK

```
$a="--------------";$b=977775;echo strtr("2222
1111
5 6886 5976_885576_7759___8675
507\8/7_|59807_|75907_|7855 08|08_|85
9|7\/7|85577975989875575_/ /885
95\8/955779759857_7557|8__'.885
5 _5_\/_5_ 597_5_88557_5__/ |859_9\ \_85
506|06|59806|759|66|855 |6||6| 5
$b$b$b$b
3333
4444",
["|_","| .$a. |"," .-$a-. ","| '$a' |"," '-$a-' ","| |",____,"   ","  ","| |  "]);

```

Try it online!

## PHP, 258 Bytes Only compressed

```
echo gzinflate(base64_decode("pZI5DsUgDET7nMJdqsCFkHyROfxnHJaB6iu4iOFhjxfF0rNZMjtgF3aaDCesCsK8mlULDwbC+j0eBhtksgAN4xUEz8UsMwNTMLhDkicZjCgUiJugRX7JEaUdWj9Ikf40GUVzdKOCYIf4V9BXwTrxnVTQWaTkcMsO34l0hyS1Hyns8S1WXHZIG052GGDZYTPIDkcu5shqOvIHVgXv9V+6GfidXTsjPWE/"));

```

Try it online!

## PHP, 323 Bytes Code above compress with use of eval

```
eval(gzinflate(base64_decode("VVBdawQhDHz3VwQRbOF2135EI8v9klrCXincW+F6j/nxneyWQkdxwswYg2k7x+kf4pou594AXj8/rl/0fb/dbw/xGQhPQGCqIpW4t6oizCCEu6pKbRy4tCFLU+MuBQRrJySpiBVREw7d2lia+fXWEZEuDTXrQou4z2jS/1xu6raJap7dZ1LWseDwQUD7JGA0QNeufdBQD5Zq2D5M9VmsVn+VrBo2cUiXY4UXILwC8RTeomk8RaM5bTMZSpqntE0z7WpOWz7U7Go+VAj4BIVKLtCvCn5/XH8A")));

```

Try it online!
> 5 votes

# Answer
# Jelly, ~~119~~ 114 bytes

### WHAM

```
“ƭHGE94=ẠĊỴI>ạȧⱮṅƇṾ'Ñɦȥ⁴7?6ụ\ĖḂẆṾƇṗyZḣ&c%~Œ’ṃ“ |\_”s7;€“| |”µṚ“\/”y;µ€s6U4¦
“ŒUỴ2,Ɠ’ṃ“|'-. ”s4µṪẋ7ṭµ€m€0s3ṚjÐ€¢Y€Y

```

**Try it online!**

### How?

The general idea is to choose letters which have left-right symmetry with minimal character translation so as to (a) reduce the base in which the data may be encoded and (b) keep the "reflection" function small.

The letter `H` has left-right symmetry with no need for translation. The letters `W` and `A` also have left-right symmetry if the `/`s on the left become `\`s on the right. Unfortunately there are not four such letters (with the same sides having the same slopes of slashes).

Letters such as `O` introduce more characters, which increases the base needed for encryption making for a far larger number and hence more bytes.

`M`, however, only introduces the other slash - if the half rows for the `M` are stored in reverse *and* with the wrong slashes, the base is kept at four and a post-decryption, post-reflection reversal of just these rows puts everything right again (this is the `U4¦` in Link 1). This also means the character translation only needs to cater for `\` becoming `/` and not the other way around too (i.e. `Ṛ“\/”y;` rather than `Ṛ“\/“/\”y;`).

```
“...’ṃ“ |\_”s7;€“| |”µṚ“\/”y;µ€s6U4¦ - Link 1: middle rows of blocks: no arguments
“...’                                - base 250 number
     ṃ“ |\_”                         - convert to base 4 with digits [0-3]="_ |\"
            s7                       - split into sevens
                “| |”                - literal "| |"
              ;€                     - concatenate €ach
                     µ               - monadic chain separation (call that rhs)
                             µ€      - for each r in rhs:
                      Ṛ              -     reverse r
                       “\/”y         -     convert any '\'s to '/'s
                            ;        -     concatenate with r
                               s6    - split into sixes
                                   ¦ - apply to indexes...
                                  4  -   four (the M)
                                 U   -   upend

“ŒUỴ2,Ɠ’ṃ“|'-. ”s4µṪẋ7ṭµ€m€0s3ṚjÐ€¢Y€Y - Main link: no arguments
“ŒUỴ2,Ɠ’                               - base 250 number
        ṃ“ -|.'”                       - convert to base 5 with digits [0-4]="' -|."
                s4                     - split into fours
                  µ                    - monadic chain separation (call that lhs)
                       µ€              - for each l in lhs:
                   Ṫ                   -   tail l
                    ẋ7                 -   repeat (the tail) seven times
                      ṭ                -   tack to l
                         m€0           - reflect €ach
                            s3         - split into threes
                              Ṛ        - reverse
                                  ¢    - call last link (1) as a nilad
                               jÐ€     - join mapped over right
                                   Y€  - join each with newlines
                                     Y - join with newlines
                                       - implicit print

```
> 4 votes

# Answer
## Javascript ~~433~~ 416 characters

Yeah, it is not very impressive. But I put this much work in and I don't see any easy way to get a lot better :)

\_=\>{r=(s,x)=\>s.repeat(x)

```
Z='| |'
q=(s,x)=>Z+r(_=' ',x)+s+r(_,14-s.length-x)+Z
h=r('-',14)
Y=(a,o)=>` .-${h}-. \n| .${h}. |
`+a.map((s,i)=>q(s,[2,1,3,3,2,1][i]+o)).join(N='\n')+N+q(r(_,14))+`
| '${h}' |
 '-${h}-'
`
return Y([i=r(U='_',5),j='|_   _|',Z,Z+'    _',l='_| |___/ |',m=`|${i}____|`],1)+Y([i,j,Z,Z,I=U+Z+U,J=`|${i}|`],3)+Y([e=r(U,9),f='|_   ___  |',g=Z+'_  \\_|','|  _|',I,J],0)+Y([e,f,g,'|  _|  _',l,m],0)}

```

Not sure my letters are perfectly well formed:

```
 .----------------.
| .--------------. |
| |   _____      | |
| |  |_   _|     | |
| |    | |       | |
| |    | |    _  | |
| |   _| |___/ | | |
| |  |_________| | |
| |              | |
| '--------------' |
 '----------------'
 .----------------.
| .--------------. |
| |     _____    | |
| |    |_   _|   | |
| |      | |     | |
| |      | |     | |
| |     _| |_    | |
| |    |_____|   | |
| |              | |
| '--------------' |
 '----------------'
 .----------------.
| .--------------. |
| |  _________   | |
| | |_   ___  |  | |
| |   | |_  \_|  | |
| |   |  _|      | |
| |  _| |_       | |
| | |_____|      | |
| |              | |
| '--------------' |
 '----------------'
 .----------------.
| .--------------. |
| |  _________   | |
| | |_   ___  |  | |
| |   | |_  \_|  | |
| |   |  _|  _   | |
| |  _| |___/ |  | |
| | |_________|  | |
| |              | |
| '--------------' |
 '----------------'

```

The result is saved to the `a` variable.
> 2 votes

# Answer
# Bubblegum, 119 bytes

```
00000000: d5d2 0106 0341 1483 6100 e614 3fb0 60a6  .....A..a...?.`.
00000010: 172a b948 0e5f 08d2 a754 a9d2 80f5 2df8  .*.H._...T....-.
00000020: bde1 ecb1 b33c f1e0 650c 4892 00c0 412c  .....<..e.H...A,
00000030: 406e cc27 bc46 3522 63e9 860b adac b017  @n.'.F5"c.......
00000040: bcf6 d32e bcda a2eb b3c8 ce34 c1ce 2c4c  ...........4..,L
00000050: d17b 4ce6 40a7 f1f7 91ca ea14 2994 e853  .{L.@.......)..S
00000060: 901f 770d ccc9 0b53 d858 85ff 1b29 66e4  ..w....S.X...)f.
00000070: 78ae d637 9feb 03                        x..7...

```

Try it online!

LIFE. Here is a list of all letters in a more readable format I used for trying out every single word.
> 2 votes

# Answer
# Deadfish~, 3977 bytes

```
{iii}iic{i}iiiicd{c}ccccccic{d}ddddcc{i}iiiicd{c}ccccccic{d}ddddcc{i}iiiicd{c}ccccccic{d}ddddcc{i}iiiicd{c}ccccccic{d}ddddc{dd}ddc{{i}}{i}iiiic{{d}i}ddc{i}iiiicd{c}ccccic{d}ddddc{{i}d}iicc{{d}i}ddc{i}iiiicd{c}ccccic{d}ddddc{{i}d}iicc{{d}i}ddc{i}iiiicd{c}ccccic{d}ddddc{{i}d}iicc{{d}i}ddc{i}iiiicd{c}ccccic{d}ddddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}ddcc{iiiiii}iiiccccccccc{dddddd}dddccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcc{iiiiii}iiicccc{dddddd}dddcc{iiiiii}iiicccc{dddddd}dddcc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddccc{iiiiii}iiicccccc{dddddd}dddccccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcc{iiiiii}iiiccccccccc{dddddd}dddccc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}i}ddcc{iiiiii}iiic{dddddd}dddccc{iiiiii}iiic{dddddd}dddcc{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddc{{i}d}iic{ddd}ic{dddddd}dddcc{iiiiii}iiic{iii}dcc{ddd}ic{dddddd}dddcc{iiiiii}iiic{iii}dc{{d}i}ddc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcc{{i}d}iic{ddd}ic{dddddd}dddccc{iiiiii}iiicc{dddddd}dddc{iiiiii}c{dddddd}ccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddc{{i}d}iic{ddd}ic{dddddd}dddccc{iiiiii}iiiccc{dddddd}dddcc{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}ddc{{i}d}iic{ddd}ic{ddddd}iic{d}dddddc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}i}ddc{iiiiii}ciiic{iii}dc{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddccc{iiiiii}c{dddddd}c{iiiiii}c{dddddd}cc{i}iiiiic{d}dddddc{i}iiiiic{d}dddddccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcccc{{i}d}iic{{d}i}ddc{{i}d}iic{ddd}icc{ddddd}ddddc{d}ic{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddccc{{i}d}iic{{d}i}ddc{{i}d}iic{ddd}ic{dddddd}dddcc{iiiiii}ciiic{iii}dc{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}ddccccc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}i}ddcccccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcccc{iiiiii}c{dddddd}c{iiiiii}c{dddd}dddddc{d}dddddc{i}iiiiic{d}dddddcccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcccc{{i}d}iic{{d}i}ddcc{iiiiii}iiiccc{ddddd}iic{d}dddddccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddccc{{i}d}iic{{d}i}ddcc{iiiiii}iiic{iii}dc{{d}i}ddcc{iiiiii}iiic{dddddd}dddccc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}ddcccc{iiiiii}iiic{iii}dc{{d}i}ddc{{i}d}iic{ddd}ic{dddddd}dddccccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcccc{iiiiii}iiic{iii}dc{{d}i}ddcc{{i}d}iic{ddd}ic{dddddd}dddcccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddccc{iiiiii}iiic{iii}dc{{d}i}ddc{{i}d}iic{ddd}ic{dddddd}dddcccccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcc{iiiiii}iiic{iii}dc{{d}i}ddc{{i}d}iic{ddd}iccc{ddddd}iic{d}dddddc{{i}d}iic{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}ddccc{{i}d}iic{ddd}iccccc{iii}dc{{d}i}ddcccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddccc{{i}d}iic{ddd}icccccc{iii}dc{{d}i}ddccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddcc{{i}d}iic{ddd}iccccc{iii}dc{{d}i}ddccccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}ddc{{i}d}iic{ddd}iccccccccc{iii}dc{{d}i}ddcc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{{i}d}iic{{d}i}dd{c}cccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}dd{c}cccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}dd{c}cccc{{i}d}iic{{d}i}ddc{{i}d}iicc{{d}i}ddc{{i}d}iic{{d}i}dd{c}cccc{{i}d}iic{{d}i}ddc{{i}d}iic{{d}}{d}ddddc{{i}}{i}iiiic{{d}i}ddc{i}dddciiiiii{c}ccccddddddc{d}iiic{{i}d}iicc{{d}i}ddc{i}dddciiiiii{c}ccccddddddc{d}iiic{{i}d}iicc{{d}i}ddc{i}dddciiiiii{c}ccccddddddc{d}iiic{{i}d}iicc{{d}i}ddc{i}dddciiiiii{c}ccccddddddc{d}iiic{{i}d}iic{{d}}{d}ddddc{ii}iic{i}dddciiiiii{c}ccccccddddddc{d}iiicc{i}dddciiiiii{c}ccccccddddddc{d}iiicc{i}dddciiiiii{c}ccccccddddddc{d}iiicc{i}dddciiiiii{c}ccccccddddddc

```

Try it online!
> 0 votes

---
Tags: code-golf, ascii-art, kolmogorov-complexity
---


title: Equalizing fractions

text:
# Question
Title: Equalizing fractions
When I was in grade 3, we were taught how to solve a very simple math problem. It was equaling the denominators of two or more fractions.

Let's take two proper fractions:-

$$ \frac{1}{2},\frac{2}{3} $$

First we will take the Least Common Multiple of the denominators of the two fractions, the LCM of \\$2,3\\$ are \\$6\\$. Then we divide the LCM (\\$6\\$) by the denominators of both fractions (\\$6\\$) and we get \\$3,2\\$ and serially multiply them with the numerators of the both fractions and get

$$ \frac{3}{6},\frac{4}{6} $$

And that's the result.

# Challenge

Take two or more fractions, and equalize their denominators.

# I/O format

You can take an array/list of `(numerator,denominator)` pairs. Pre-defining them in TIO header is allowed. You can take in other better ways too.

```
Input: ((1,2),(2,3)) or
        1,2 2,3
        1/2 2/3
Output: (3,6),(4,6) or
        3,6 4,6
        3/6 4/6
Input:  ((1, 8), (5, 12))
       1,8 5,12
       1/8 5/12
Output: ((3, 24), (10, 24))
         3,24 10,24
         3/24 10/24
Input: ((1, 2),(2, 3),(4, 6))
Output: 3/6 4/6 4/6

```

# Rules

* Standard loopholes are forbidden. (except use of TIO headers to pre-define input)
* Trailing whitespace in output is allowed.
* If possible, please link to an online interpreter (e.g. TIO) to run your program on.
* Please explain your answer. This is not necessary, but it makes it easier for others to understand.
* Languages newer than the question are allowed. This means you could create your own language where it would be trivial to do this, but don't expect any upvotes.
* This is , so shortest code in bytes wins!

# Answer
> 7 votes
# JavaScript (Node.js), 63 bytes

```
f=(a,t=1)=>a.some(v=>t%v[1])?f(a,1+t):a.map(([p,q])=>[p*t/q,t])

```

Try it online!

---

# JavaScript (Node.js), 63 bytes

```
f=(a,t,b=a.map(([p,q])=>[m=p*t/q,o&=m%1||t],o=t))=>o?b:f(a,-~t)

```

Try it online!

`m=p*t/q` cannot be changed to `p*=t/q` due to floating point errors. For example, `11*15/11` is `15`, but `11*(15/11)` is `14.999999999999998`. :(

* The first answer here will output `[[6, 12], [6, 12]]` for input `[[2, 4], [3, 6]]`.
* The second one will output `[[1, 2], [1, 2]]` for input `[[2, 4], [3, 6]]`.

---

# JavaScript (Node.js), 62 bytes

* @Arnauld had modified the code to make it work in 62 bytes. This one would support positive fractions.

```
f=(a,t,o=-~t,b=a.map(([p,q])=>[p*t/q,t+=p*t%q]))=>t<o?b:f(a,o)

```

Try it online!

# Answer
> 5 votes
# Wolfram Language (Mathematica), 20 bytes

```
LCM@@(q=Last/@#)/q#&

```

Try it online!

Fractions are in the form `{numerator, denominator}`
We simply multiply the fractions by the LCM of denominators divided by the denominators

# Answer
> 5 votes
# Factor, ~~73~~ 64 bytes

-9 bytes thanks to chunes!

```
[ dup 1 [ lcm ] reduce [ swap n/v v* dup length ] keep <array> ]

```

Try it online!

Takes the input as two separate lists for numerators and denominators

# Factor, 73 bytes

```
[ unzip dup 1 [ lcm ] reduce swap over [ n/v v* ] dip '[ _ 2array ] map ]

```

Try it online!

Takes the input as a list of (numerator,denominator) pairs.

I thought it would be shorter using fractions but I didn't manage to make it nice. Except this the Factor version TIO has normalizes the fractions.

# Answer
> 4 votes
# , 14 10 bytes

```
,.**./@]%]

```

Try it online!

-4 after realizing taking a list of numerators and a list of denominators was allowed

Works like `<list of numerators> f <list of denominators>`.

* `*./@]` LCM of denominators (right hand arg)...
* `%]` Divided elementwise by the denominators...
* `,.*` Times the zip of the numerators and denominators.

# Answer
> 3 votes
# Haskell, 45 bytes

```
n#d=($d).zipWith(div.(*foldr1 lcm d))<$>[n,d]

```

Try it online!

Takes two lists (`n=numerators` and `d=denominators`) as input, returns two lists with the same format as output. Assumes fractions in the input are reduced.

# Haskell, ~~72~~ ~~69~~ 66 bytes

```
f x|l<-foldr(\(n,d)->lcm.div d$gcd n d)1x=[(div(n*l)d,l)|(n,d)<-x]

```

Try it online!

Takes a list of pairs as input, returns a list of pairs as output. Works for unreduced fractions as well.

# Haskell, 79 bytes

```
f x|let(z,l)=foldr(\(n,d)(y,a)->((div(n*l)d,l):y,lcm(d`div`gcd n d)a))([],1)x=z

```

Takes a list of pairs as input, returns a list of pairs as output. Works for unreduced fractions as well.

Quite a bit longer than the other answer, but I decided to post it anyway since there is some Haskell magic going on! The LCM of the (reduced) denominators `l` appears both on the left hand side and the right hand side of the `let` expression. This is only possible because of Haskell's lazyness.

# Answer
> 3 votes
# Ruby, 57 bytes

```
->l{k=l.reduce(1){|s,x|s.lcm x[1]};l.map{|a,b|[a*k/b,k]}}

```

Try it online!

# Answer
> 3 votes
# Jelly, ~~9~~ 8 bytes

```
aæl/Ṅ:Ʋ×

```

Try it online!

Full program. Takes a list of denominators \\$\[d\_1, d\_2, ...\]\\$ on the left and a list of numerators \\$\[n\_1, n\_2, ...\]\\$ on the right. Outputs a list of denominators, then a list of numerators

Would be 7 bytes if we could just output the dominator once.

## How it works

```
aæl/Ṅ:Ʋ× - Main link. Takes denominators D on the left and numerators N on the right
      Ʋ  - Group the previous 4 links into a monad on D:
 æl/     -   Reduce by LCM
a        -   AND; Replace each element in D with the LCM
    Ṅ    -   Print the list of LCM
     :   -   Divide each by the corresponding element of D
       × - Multiply this list with N elementwise

```

# Answer
> 2 votes
# Pyth, 33 bytes

```
K1JEFkJ=K/*kKikK;FkE[/*kKhJK)=JtJ

```

Try it online!

Takes two lines of input: first line should contain the list of denominators, and the second line should contain the list of corresponding numerators.

# Explanation

```
K1       # Initialize K to 1
JE       # Initialize J to evaluated input (in this case, list of denominators)
FkJ      # For loop over elements of J, with iterator as k
=K       # Set K to
*kK      # Product of k and K
ikK      # GCD of k and K
/        # Divide them to get the LCM
FkE      # Another for loop over the next evaluated input (the numerators)
hJ       # First element of J
/*kKhJ   # Convert the numerator accordingly
K        # Denominator
[...)    # Put that inside a list and print it
tJ       # Tail J (first element removed)
=J       # Assign J to it

```

# Answer
> 1 votes
# Python 3, 99 bytes

```
import numpy
f=lambda a,i=0,k=1:i<len(a)and f(a,i+1,numpy.lcm(k,a[i][1]))or[(p*k//q,k)for p,q in a]

```

Try it online!

Takes a list of lists and computes the LCM of denominators. This result is stored in `k` and at the end the fractions are converted to the same denominator (`k`).

# Answer
> 1 votes
# Retina, 82 bytes

```
\d+
*
+`(_+)/((_+)(\3)*) (_+)/(?!\2\b)(\3)+\b
$#6*$1/$#6*$2 $#4*$5$5/$#6*$2
_+
$.&

```

Try it online! Link includes test cases. Explanation:

```
\d+
*

```

Convert to unary.

```
+`

```

Repeat until all denominators are equal.

```
(_+)

```

Match a numerator...

```
/((_+)(\3)*)

```

... and the largest factor of a denominator...

```
 (_+)

```

... and another numerator...

```
/(?!\2\b)(\3)+\b

```

... and a denominator that is not equal to the first denominator but with the shared (greatest) common divisor.

```
$#6*$1/$#6*$2 $#4*$5$5/$#6*$2

```

Multiply the first fraction by the multiplicity `$#6` of the GCD in the second fraction, and also update the second fraction.

```
_+
$.&

```

Convert to decimal.

# Answer
> 1 votes
# Charcoal, 30 bytes

```
≔Ｅθ⊟ιη≔¹ζＷ⌈﹪ζη≦⊕ζＩＥθ⟦÷×ζ⊟ι§ηκζ

```

Try it online! Link is to verbose version of code. I/O is standard Charcoal array format. Explanation: Uses brute force.

```
≔Ｅθ⊟ιη

```

Get the denominators.

```
≔¹ζ

```

Assume the LCM is 1.

```
Ｗ⌈﹪ζη≦⊕ζ

```

Keep incrementing the LCM until all the denominators divide it.

```
ＩＥθ⟦÷×ζ⊟ι§ηκζ

```

Scale the fractions to the new denominator.

# Answer
> 1 votes
# , ~~69~~ 66 bytes

*Edit: -3 bytes thanks to Giuseppe*

```
function(m)m/m[,2]*which(!rowSums(outer(1:prod(m),m[,2],"%%")))[1]

```

Try it online!

Input & output as 2-column matrices, with each row representing a pair of numerator & denominator.

# Answer
> 0 votes
# Excel, 130 bytes

```
=LET(n,COUNT(A:A),b,OFFSET(B1,,,n),q,SEQUENCE(PRODUCT(b)),MIN(IF(MMULT(1*(MOD(q,TRANSPOSE(b))=0),b^0)=n,q,""))/b*OFFSET(A1,,,n,2))

```

Uses columns A&B for input

```
=LET(
n,COUNT(A:A)                                                            ' Number of fractions
b,OFFSET(B1,,,n)                                                        ' List of denominators
q,SEQUENCE(PRODUCT(b))                                                  ' 1..product of all denominators
MIN(IF(MMULT(1*(MOD(q,TRANSPOSE(b))=0),b^0)=n,q,""))/b*OFFSET(A1,,,n,2) ' final calculation
             1*(MOD(q,TRANSPOSE(b))=0)                                  ' matrix of q by b where 1 indicates q mod b = 0
    IF(MMULT(                         ,b^0)=n,q,"")                     ' if q is divisible by all n numbers then q else "" (list of all common multiples)
MIN(                                               )                    ' least common multiple
                                                    /b*OFFSET(A1,,,n,2) ' multiply each row by the number need to change denominator to LCM

```

# Answer
> 0 votes
# 05AB1E, 9 bytes

```
.¿©¹÷*®δ‚

```

Input as two separated lists, first the list of denominator, second the list of numerator.
Output as a list of pairs of \[numerator, denominator\].

Try it online or verify all test cases.

**Explanation:**

```
.¿         # Get the Least Common Multiple (LCM) of the first (implicit) input-list of
           # denominators
  ©        # Store this value in variable `®` (without popping)
   ¹÷      # Integer-divide it by each value of the first input-list
     *     # Multiply each value at the same positions to the second (implicit)
           # input-list of numerators
       δ   # For each value:
      ® ‚  #  Pair it with the stored LCM of variable `®`
           # (after which the resulting list of pairs is output implicitly as result)

```

# Answer
> 0 votes
# Julia, 22 bytes

```
n$d=(l=lcm(d))n./d.=>l

```

Try it online!

* expects `[numerators] $ [denominators]`
* outputs an array of pairs : `[num1 => den1, num2 => den2,...]`
* could be 20 bytes with the denominator only once in the ouput

---
Tags: code-golf, math, rational-numbers
---