Print the Stack Exchange favicon

20

3

Challenge

Print or return the Stack Exchange favicon, as provided below:

 ___________________
/                   \
---------------------
|                   |
---------------------
|                   |
---------------------
\__________    _____/
           |  /
           | /
           |/

This is , so the shortest answer in each language wins.

musicman523

Posted 2017-07-01T00:55:02.353

Reputation: 4 472

2Is the top left corner intended to be slightly misaligned? – ETHproductions – 2017-07-01T01:04:20.473

@ETHproductions It was intended, but I'm changing it now. It looks kind of awkward either way. – musicman523 – 2017-07-01T01:18:27.100

2The actual output is 219 bytes, for reference. – totallyhuman – 2017-07-01T01:55:02.727

Trailing lines and/or trailing spaces on lines are allowed, right? – dzaima – 2017-07-01T12:55:19.630

@dzaima Yeah that's fine – musicman523 – 2017-07-02T04:07:19.527

Alternate title: "Print Community's avatar" :P – totallyhuman – 2017-08-09T21:53:33.710

1Related – Taylor Scott – 2018-01-08T17:38:23.417

Answers

43

Operation Flashpoint scripting language, 263 195 bytes

f={r="                   ";t="---------------------\n";s=" ___________________\n/"+r+"\\n"+t+"|"+r+"|\n"+t+"|"+r+"|\n"+t+"\__________    _____/\n           |  /\n           | /\n           |/";s}

Not the right tool for the job.

Call with:

hint call f;

Output:

The formatting fails, because the font is not monospaced.

Steadybox

Posted 2017-07-01T00:55:02.353

Reputation: 15 798

49Just what makes you look at a challenge and think "oh, I should answer that in Operation Flashpoint" puzzles me... – totallyhuman – 2017-07-01T01:53:00.717

7@totallyhuman I guess its scripting lang is just fun to write in. It has quite a few quirks and limitations, so you sometimes need to use some strange workarounds, which makes it interesting (yet not very practical). – Steadybox – 2017-07-01T02:08:03.173

5Hardcoding the answer would probably give you a better score. – NieDzejkob – 2017-07-01T08:26:30.267

2@NieDzejkob Now it's shorter than just hardcoding the output, but more boring than the previous version. – Steadybox – 2017-07-01T14:28:08.577

@totallyhuman And with this challenge in particular, I wanted to test how the language would fare with a Kolmogorov-complexity challenge (for which it's far less than ideal for). – Steadybox – 2017-07-01T22:00:09.687

11

Charcoal, 38 37 33 30 bytes

←×_χ↓F/||⟦ι¹¹⟧\×_⁹‖B_×ψ⁴↙↙³↑↑³

Try it online! Link is to verbose version of code. Edit: Managed to save a byte with the help of a reflection, although @CarlosAlejo shows that it can in fact be done in 37 bytes without reflecting. Saved a further 4 bytes by drawing the left ¾ and reflecting the final ¼. Edit: Previous 33-byte answer depended on ReflectButterflyOverlap() not overprinting the overlap area with the reflection, so in case this behaviour changed, I sought a solution that didn't rely on that, and the result turned out to be shorter anyway, thanks to my creative use of printing an array. Explanation:

←×_χ                            Print 10 `_`s leftwards (top row)
    ↓                           Move down to the next row
     F/||                       For each character in the string `/||`
          ι                     Current character
           ¹¹                   Integer 11, prints as `-----------`
         ⟦   ⟧                  Put both into an array
                                Implicitly print on separate lines
              \                 Implicitly print `\`
               ×_⁹              Implicitly print 9 `_`s
                  ‖B            Reflect right, overlapping the axis
                    _           Implicitly print `_`
                     ×ψ⁴        Implicitly delete 4 characters
                        ↙↙³     Move down left and print three `/`s
                           ↑↑³  Move up and print three '|'s

Neil

Posted 2017-07-01T00:55:02.353

Reputation: 95 035

2Very well played. I love that there's four Charcoal answers to this question! ‖BO wasn't in the language the last time I used it--I'll have to keep that in mind for the future. – DLosc – 2017-07-02T01:04:43.253

I had to see for myself what you meant with "reflecting the final ¼". Well played indeed! – Charlie – 2017-07-02T21:13:09.723

8

///, 98 bytes

/'/  //&/
"""
|!! |//%/\\\/
!'|//#/_____//"/-------//!/'''' / ###____
\/!! \\&&
"""
\\##''#%'% %\/

Try it online! Or, see it interactively!

Conor O'Brien

Posted 2017-07-01T00:55:02.353

Reputation: 36 228

3Is there a utility that allows me to see the different "step"s of a /// program? (Partial execution after each replace.) That could help me to understand them better. – CAD97 – 2017-07-01T04:25:14.163

@CAD97 I've been fiddling around with the online interpreter, and it usually would come with debug options, but the way the online interpreter orders arguments, it doesn't function that way. You could grab a copy of the interpreter yourself and do something like perl slashes.pl -d1 code.txt. I'm presently working on an online execution environment for ///, but that might take some time. – Conor O'Brien – 2017-07-01T19:21:12.367

3@CAD97 Said online thing is up, take a look! – Conor O'Brien – 2017-07-01T23:06:06.013

8

JavaScript (ES6), 113 112 bytes

(Saved a byte thanks to @Craig Ayre.)

let f=

_=>` _19
/ 19\\
-21
| 19|
-21
| 19|
-21
\\_10 4_5/
 11| 2/
 11| /
 11|/`.replace(/.(\d+)/g,([a],b)=>a.repeat(b))
 
 console.log(f());

Rick Hitchcock

Posted 2017-07-01T00:55:02.353

Reputation: 2 461

Looks like you have a stray space before the replacement function. I had just come up with a similar update for my JS solution at 113 bytes. Don't know whether I should post it or let you have it. – Shaggy – 2017-07-01T18:45:56.283

Ah, wait, only seeing now that you posted your solution before I posted mine. I'll delete mine when I get to a computer and you can save a byte with replace(/.(\d+)/g,(a,b)=>a[0].repeat(b)). – Shaggy – 2017-07-01T19:36:51.663

Thanks, Shaggy. I had written a program to automate this type of answer, and it was silly to have it output an unneeded space. Your suggested replace statement is certainly an improvement, which I've now incorporated in my program. – Rick Hitchcock – 2017-07-01T22:06:58.993

1Can you save a byte array matching a: ([a],b)=>a.repeat(b))? – Craig Ayre – 2017-07-04T15:26:31.127

Yes, thanks! I was unfamiliar with that syntax. – Rick Hitchcock – 2017-07-04T15:30:04.773

8

Python 2, 115 bytes, more creative idea

t,u,v,w,x,y,z='\n -/\\_|';k=w+t+11*u+z;i=t+21*v+t
print u+19*y+t+w+19*u+x+(i+z+19*u+z)*2+i+x+10*y+4*u+5*y+k+u,k,k+w

Try it online!

Python 2, 102 bytes, boring idea

print'eNrjUojHBFz6CpgghksXG+CqwaK2hgpqYxDuASkDM/S5kDUqKKDxUbn6XADUmClx'.decode('base64').decode('zip')

Try it online!

mdahmoune

Posted 2017-07-01T00:55:02.353

Reputation: 2 605

2I am down voting this since I have seen this method used way too many times. It is just boring to see over and over again. – R. Kap – 2017-07-01T18:26:51.990

8@R.Kap Unless there's a shorter way, that's a rather arbitrary reason to downvote. – Dennis – 2017-07-01T20:37:09.863

@R.Kap I think you are talking about this kind of code: import zlib print zlib.decompress('eNrj.....mClx'.decode('base64')) – mdahmoune – 2017-07-01T20:58:03.027

@mdahmoune Great, you found a more concise way to implement the same boring idea. – R. Kap – 2017-07-01T21:05:02.457

1@Dennis Maybe, but I still stand by my opinion and have every right to express it. I have seen this method used countless times on these kinds of challenges and it requires little to no creativity on the OP's part, which are big aspects, at least in my opinion, of Kolomogorov complexity challenges, and hence my reason for the down-vote. – R. Kap – 2017-07-01T21:08:06.303

2@R.Kap If general purpose compression algorithms can beat manual ones that easily, that's a problem of the challenge, not the answer. I didn't even manage to beat Bubblegum with Jelly, and decompression had very little overhead in Jelly. – Dennis – 2017-07-01T22:45:37.913

2@Dennis I am not even talking about code length here. I am talking about effort and creativity, which this answer, in my opinion, fails to showcase in a language where one can do so much more, which is the reason I down-voted. Now, if you disagree with my reasoning that is fine. In that case, let us just agree to disagree and end this conversation right here before it gets too long. :) – R. Kap – 2017-07-02T00:05:27.353

@R.Kap what do you think about the 115 bytes one? – mdahmoune – 2017-07-02T15:25:17.700

1@mdahmoune It is better. I will remove my down-vote. :) – R. Kap – 2017-07-02T16:50:23.603

@Dennis I agree with you, we have to keep also the boring idea to push the limit of creativity... – mdahmoune – 2017-07-02T17:09:47.143

7

SOGL V0.12, 32 31 bytes

^$∙r↑Ψ«2τγæΕž‘╬Æ╬⁷"ƧΡ⅟?0Ξ³‘6«8ž

Try it Here!

Explanation:

...‘               push a quarter of the icon
    Β             palindromize vertically
      ╬⁷           palindromize horizontally (these two should be ╬3 together, but spacing doesn't work correctly (though now it does since I fixed it))
        "...‘      push the extention
             6«8ž  at coordinates [12; 8] in the quad-palindromized image put that in

The quarter:

 __________
/
-----------
|
-----------

and the other part:

    
|  /
| /
|/

dzaima

Posted 2017-07-01T00:55:02.353

Reputation: 19 048

"togethe"? "trough"? Also, it took a little while to figure out that . in the explanation meant string. Maybe use ^...' and "...'? – CalculatorFeline – 2017-07-01T16:50:03.423

@CalculatorFeline I usually did ... for compressed strings (aka nonsense) but lately I started doing one or two. And feel free to fix my mistakes and grammar :p – dzaima – 2017-07-01T16:55:06.943

6

Python 2, 124 bytes

a,b,d,e,f,g,h=' _-|/\\\n';r=d*21+h+e+a*19+e+h;n=f+h+a*11+e;print a+b*19+h+f+a*19+g+h+r*2+r[:22]+g+b*10+a*4+b*5+n+a*2+n+a+n+f

Try It Online!

R. Kap

Posted 2017-07-01T00:55:02.353

Reputation: 4 730

You don't ever use c, so you can eliminate it for 3 bytes. Try it online!

– musicman523 – 2017-07-01T16:39:59.423

@musicman523 I don't even know why I put that there. Thanks for the catch! :) – R. Kap – 2017-07-01T16:42:23.987

6

C (gcc), 187 bytes

Saved 2 bytes thanks to Cody Gray, and 3 bytes thanks to Keyu Gan!

#define a"         "
#define s a" "a
#define l"\n---------------------\n"
f(){puts(" ___________________\n/"s"\\"l"|"s"|"l"|"s"|"l"\\__________    _____/\n"a"  |  /\n"a"  | /\n"a"  |/");}

Try it online!

musicman523

Posted 2017-07-01T00:55:02.353

Reputation: 4 472

2puts would be trivially shorter, if a trailing new-line is acceptable. – Cody Gray – 2017-07-02T06:39:43.867

you may use f() instead of main(). A function is also acceptable. – Keyu Gan – 2017-07-02T15:52:26.390

5

Rust, 181 bytes

||" ___________________
/2\\
1
1
3
\\__________    _____/
4|  /
4| /
4|/".replace("1","3
|2|").replace("2",&" ".repeat(19)).replace("3",&"-".repeat(21)).replace("4",&" ".repeat(11))

Try it online!

Rust, 184 bytes

This version may be more golfable as adding further replace cost fewer bytes each. The first replace isn't part of the loop because it pulls double duty changing s into a String instead of a &'static str.

||{let mut s=" 5__5__5
/2\\
1
1
3
\\55    5/
4|  /
4| /
4|/".replace("1","3
|2|");for p in vec![("2"," ",19),("3","-",21),("4"," ",11),("5","_",5)]{s=s.replace(p.0,&p.1.repeat(p.2))}s}

Try it online!

CAD97

Posted 2017-07-01T00:55:02.353

Reputation: 1 367

5

C, 167 bytes

i;char*d=" q    /()\\   A   |()|    A   |()|    A   \\h#c/  #&|!/   #&| /   #&|/",c,b;main(j){while(c=d[i++],b=c%5==2||c>123?c:c>95?95:c>45?45:c>=32?32:++c,i<47)for(j=c;j-->=b;)putchar(b);}

Try it online!

Note: a lot of apparent spaces above are actually the tab character.

Readable version:

i;
char *d = " q   /()\\   A   |()|    A   |()|    A   \\h#c/  #&|!/   #&| /   #&|/", c, b;
main(j) {
    while(
        c = d[i++],
        b = c % 5==2 || c > 123 ? c:
            c > 95 ? 95:
            c > 45 ? 45:
            c >= 32 ? 32:
            ++c,
        i < 47
    )
        for(j = c; j-- >= b;)
            putchar(b);
}

Explanation:

The data array, d, encodes the answer in literal single characters and coded repeated characters. Each character, c, in the data array is mapped to a base character, b, and a number of repetitions. It is then printed that many times.

Characters that are used only singly (slashes and the pipe) have ASCII codes 47, 92, and 124. Two of these are divisible by 5 with a remainder of 2 (c%5=2||c>123). I couldn't find a shorter condition to test for all three.

Characters that are repeated (underscore, dash, and space), with ASCII codes 95, 45, and 32 respectively, are coded with a higher ASCII code--increased by one per repetition. So, for example, a single space is just a space, but two spaces can be coded by the next ASCII character, the exclamation point. Where a coded character would be unsuitable because it meets the above modulo condition, it can be split, as with #& to represent eleven spaces. The same technique is used to avoid overlap between the space and dash character ranges.

Finally, the ten newlines are encoded as tabs to save bytes that would have been spent escaping the newlines with a backslash, then incremented for printing (++c).

jiv

Posted 2017-07-01T00:55:02.353

Reputation: 81

Well done! I knew there were better C answers out there. – musicman523 – 2017-07-02T00:37:19.150

Thanks! It was a fun challenge. I spent something like four hours on it, so I'm glad it worked out in the end. – jiv – 2017-07-02T00:44:01.830

4

Charcoal, 49 37 bytes

↓⁵\…_χ↓↓³↗↗³…_⁵↑/↑⁵↖\←…_¹⁹↓ /F³«P²¹¶¶

Try it online!

At last I could golf this a bit. This answer (unlike all other Charcoal answers) does not use reflection, but draws all the contour in one pass, leaving the horizontal bars for the end.

Link to the verbose version.

Charlie

Posted 2017-07-01T00:55:02.353

Reputation: 11 448

"Unlike all the other Charcoal answer" Actually my first answer did not use reflection either, but I will admit that I didn't spot the chance to golf a byte off by starting the drawing with the left vertical line. (The only other changes between our solutions are that you use Range where I used Times and you print a \ where I just printed :UpLeft 1 step.) – Neil – 2017-07-02T00:07:33.093

Although it seems the reflecting is till the way to go... – Neil – 2017-07-02T00:38:18.797

Also that's twice now that my s key didn't work... – Neil – 2017-07-02T00:38:58.747

3

Bubblegum, 40 bytes

Saved 1 byte by removing a trailing newline, thanks @ovs!

00000000: 5388 c704 5cfa 0a98 2086 4b17 1be0 aac1  S...\... .K.....
00000010: a2b6 860a 6a63 10ee 0129 0333 f4b9 9035  ....jc...).3...5
00000020: 2a28 a0f1 51b9 fa00                      *(..Q...

Try it online!

musicman523

Posted 2017-07-01T00:55:02.353

Reputation: 4 472

Without a trailing newline, this gets 40 bytes.

– ovs – 2017-07-01T07:17:56.973

Thanks! I think my text editor automatically put one in. – musicman523 – 2017-07-01T16:07:19.893

How did you create this? zlib.compress(s.encode(), 9) outputs 46 bytes, and the answer seems to be zlib. – NieDzejkob – 2017-07-03T18:44:07.433

Per Dennis's suggestion, I used zopfli --deflate to generate the raw DEFLATE stream, then used xxd to convert it into the xxd format. I believe zlib leaves a checksum, or is not a raw DEFLATE stream for some other reason.

– musicman523 – 2017-07-03T18:50:13.253

3

Charcoal, 38 bytes

←…_χP↑⁵P\F³«↑P¹¹↑»↗¹…_χ‖BM²¦⁷P↓⁴… ⁴↙↙³

Try it online!

I used Carlos's answer in its original form as a jumping-off point, but saved a good bit by using a reflection, taking advantage of horizontal symmetry. (Vertical symmetry wasn't worth it because the underscores ended up on the wrong row.) You can see the evolution of the canvas at each step here.

Here's the verbose version.

DLosc

Posted 2017-07-01T00:55:02.353

Reputation: 21 213

btw you can use -d to show each step (also sorry i've been changing charcoal so much, i'm not sure very many of the new ideas are very useful, especially the goat ascii-art builtin and part of the wolfram language haha) – ASCII-only – 2017-07-27T03:07:11.920

1most useless charcoal program ever – ASCII-only – 2017-07-27T03:19:56.670

3

Python 2, 119 117 116 bytes

print''.join(' \n-/|\\_'[ord(x)/8-4]*int('1245abjl'[ord(x)%8],36)for x in' V(8&H(7(@&@(7(@&@(7(HT"S8(%@!8(%@ 8(%@8')

Try it online!

A bit of tortured run-length encoding...

EDIT: Save 3 bytes by replacing the set of lengths:

[1,2,4,5,10,11,19,21][ord(x)%8]

with

int('1245abjl'[ord(x)%8],36)

Chas Brown

Posted 2017-07-01T00:55:02.353

Reputation: 8 959

Wow! I was trying to think of an effective way to do this myself. – GarethPW – 2017-07-02T02:03:31.237

Nice code, but it seems that it is 119 bytes? – mdahmoune – 2017-07-02T15:11:04.567

@mdahmoune: Quite right - forgot to use r'' when checking the length... – Chas Brown – 2017-07-02T18:25:37.497

3

C++ 11 - 162 159 154 152 150 bytes

MSVC:

void f(){char*i="b t_b\nb/t b\\b\nv-b\nb|t b|b\nv-b\nb|t b|b\nv-b\nb\\k_e f_b/b\nl b|c b/b\nl b|b b/b\nl b|b/";while(*i)cout<<string(*i++-97,*i),i++;}

GCC: (+4 chars)

int f(){char*i="b t_b\nb/t b\\b\nv-b\nb|t b|b\nv-b\nb|t b|b\nv-b\nb\\k_e f_b/b\nl b|c b/b\nl b|b b/b\nl b|b/";while(*i){cout<<string(*i-97,*(i+1));i+=2;}}

Input string i is coded in char pairs:

  1. Count of chars to repeat (added to 'a' to be a legible character)
  2. Char to print

I think, there's still a lot of room for improvement here.

Edit:

  1. Replaced putchar with cout<<
  2. Remove while, Use string constructor to repeat chars
  3. Removed space before pointer and a spurious semi-colon ;;
  4. Compounding instructions with comma, removing braces.

Robert Andrzejuk

Posted 2017-07-01T00:55:02.353

Reputation: 181

C++11 does not support auto as a return type, that's a C++14 feature. However, you can fix this and save a byte by making the return type int. It doesn't appear that this code works, though; could you test it on Try it online! and see if you can fix it?

– musicman523 – 2017-07-02T23:14:53.927

Changed the return type auto -> void. I was testing on Visual Studio 2017 - automatically C++14. Added a version for gcc. – Robert Andrzejuk – 2017-07-03T00:32:09.423

Oh okay, gotcha. I'm running Linux so I don't have VS. Nice job! – musicman523 – 2017-07-03T01:50:21.433

Hi Robert - your run length encoding approach is similar to my own; see here. I additionally pack each (length,char) pair into a single char instead of 2. There are 7 possible characters, and 8 distinct lengths; so I use the 56 characters in ' '..'X' for encoding; which saves 40 bytes with a little extra overhead for decoding.

– Chas Brown – 2017-07-03T02:46:24.187

3

R16K1S60 Assembly, 152 144 Bytes

Writes output to screen peripheral the R16K1S60 in ASCII. Runs on The Powder Toy save 2012356. (See link in header for info)

The byte size of the program is the compiled result (Cells Used * 2), not the assembly.

You know you've done well when the logo takes more space than your bytecode.

a:
mov ex, ip
mov ax, .string
mov sp, ip
mov dx, 0x1000
send sp, dx
.loop:
mov bx, [ax]
cmp bx, ip
je .end
cmp bx, ip
je .newline

shr bx, cx, 8
and cx, 0x00FF
.inner:
send sp, cx
sub bx, ex
jnz .inner
.reentry:
add ax, ex
jmp .loop
.newline:
add dx, 0x0020
send sp, dx
jmp .reentry
.string:
dw 0x0120
dw 0x135F
dw 0x000C
dw 0x012F
dw 0x1320
dw 0x015C
dw 0x000C
dw 0x152D
dw 0x000C
dw 0x017C
dw 0x1320
dw 0x017C
dw 0x000C
dw 0x152D
dw 0x000C
dw 0x017C
dw 0x1320
dw 0x017C
dw 0x000C
dw 0x152D
dw 0x000C
dw 0x015C
dw 0x0A5F
dw 0x0420
dw 0x055F
dw 0x012F
dw 0x000C
dw 0x0B20
dw 0x017C
dw 0x0220
dw 0x012F
dw 0x000C
dw 0x0B20
dw 0x017C
dw 0x0120
dw 0x012F
dw 0x000C
dw 0x0B20
dw 0x017C
dw 0x012F
dw 0x0009
.end:
hlt

Explanation

The assembly code above implements a simple compression algorithm, with the words 0x000C being a newline and 0x0009 being the command to stop execution.

The other words are encoded simply, like this: 0xTTCC

  • T: Times to repeat the value

  • C: The ASCII character to print

The ASM uses every register available to it, including some of the less commonly used ones:

  • The Instruction Pointer, to get a few known values into quick recall to save some bytes (A constant value in an instuction that's not just a register uses an extra byte to store it)

  • The Stack Pointer is used as 6th general purpose register, because none of the code uses the stack.

Only AX, BX, CX, and DX are actually used for important data. EX and SP are used to store some constants that get frequently used.

It's somewhat simple, and has nil chance of winning, but it was fun to write!

See revision history for the old answer (It's just as large in terms of ASM)

funfact: if this was measured in words (in the case of the R16K1S60,16 bits) it'd be smaller than the pyth answer, at 72 bytes

moonheart08

Posted 2017-07-01T00:55:02.353

Reputation: 693

3

Pyth, 74 bytes

J*21\-L*db+d*19\_++\/y19\\V2J++\|y19\|;J++++\\*T\_y4*5\_\/V3+++y11\|y-2N\/

Try it online!

Melo

Posted 2017-07-01T00:55:02.353

Reputation: 31

2Welcome to PPCG! – Martin Ender – 2018-02-09T23:30:09.687

2

Python 2, 159 153 139 bytes

s=" "*19;e="-"*21;a=" "*9;print" %s\n/%s\\\n%s\n|%s|\n%s\n|%s|\n%s\n\%s    %s/\n%s|  /\n%s| /\n%s|/"%("_"*19,s,e,s,e,s,e,"_"*8,"_"*7,a,a,a)

Try it online!

EDIT: Saved 6 bytes by using % formatting instead of .format().
EDIT: Saved another 14 bytes by fixing the output, thanks to musicman523.

LyricLy

Posted 2017-07-01T00:55:02.353

Reputation: 3 313

1This isn't printing the exact text (extra lines are present). Fixing this will probably save some bytes as well. – officialaimm – 2017-07-01T05:29:30.080

Here is a fixed version, coming in at a hot 139 bytes – musicman523 – 2017-07-01T22:18:40.580

2

Jelly, 50 48 45 bytes

21“©&Ẇƥ⁸þ/Ẉoụ’ḃ1pF“CṣʠėHẹỊtṡḤḶ’ṃ“ _/\-|”¤xs¹Y

Try it online!

Dennis

Posted 2017-07-01T00:55:02.353

Reputation: 196 637

2

V, 49 bytes

i ±¹_
/±¹ \2ÙÒ-jÓÓ/|
3äkGR\±_´ µ_/
±± |  /2ñÙlx

Try it online!

nmjcman101

Posted 2017-07-01T00:55:02.353

Reputation: 3 274

2

Japt, 79 72 71 bytes

" _p
/ p\\
{"-r
| p|
"²}-r
\\_g a_b/
 h|  /
 h| /
 h|/"r".%l"_g p6nZÅnH

Test it

  • 7 bytes saved thanks to ETHproductions' excellent suggestion of using base 32 integers for the repetition values.

Shaggy

Posted 2017-07-01T00:55:02.353

Reputation: 24 623

Very nice compression method. If you use nH you can save a few more bytes: http://ethproductions.github.io/japt/?v=1.4.5&code=IiBfcAovIHBcXAp7Ii1yCnwgcHwKIrJ9LXIKXFxfZyBhX2IvCiBofCAgLwogaHwgLwogaHwvIiByIi4lbCJfZyBwNm5axW5I&input=

– ETHproductions – 2017-07-01T15:59:46.080

2

Mathematica, 163 bytes

Row@Map[Column,Characters/@{" /-|-|-\\   ",r="_ - - -_   ",r,r,r,r,r,r,r,r,r,"_ - - - |||","_ - - -   /","_ - - -  / ","_ - - - /  ",r,r,r,r,r," \\-|-|-/   "},{1}]

J42161217

Posted 2017-07-01T00:55:02.353

Reputation: 15 931

2

PHP, 86 bytes

<?=gzinflate(base64_decode("U4jHBFz6CpgghksXG+CqwaK2hgpqYxDuASkDM/S5kDUqKKDxUbn6AA"));

Try it online!

PHP, 118 bytes

<?=strtr(' 333____
/00   \
11-
|02
11-
|02
11-
\33    3/
2  /
2 /
2/',['        ','----------',"           |",_____]);

Try it online!

Jörg Hülsermann

Posted 2017-07-01T00:55:02.353

Reputation: 13 026

2

Python 2, 171 bytes

p,u,q,v,r,s,F=' ','_','/','|','-'*21,'\\',lambda f,m:f+m*19+f;B=lambda n:p*11+v+p*n+q
print'\n'.join([F(p,u),q+p*19+s,r,F(v,p),r,F(v,p),r,s+u*10+p*4+u*5+q,B(2),B(1),B(0)])

Each line is exactly 85 bytes! Hoorah!

Daniel

Posted 2017-07-01T00:55:02.353

Reputation: 6 425

2

Zsh, 244 bytes

This is specifically written for Zsh, not Bash, as it allows a bit more in terms of weird syntax.

alias p=printf
function r { p "$1%.s" {0..$2}}
function l { p $1;r $2 19;p $3;p "\n"}
l " " _ " "
l / " " \\
l - - -
l \| " " \|
l - - -
l \| " " \|
l - - -
p \\
r _ 10
r " " 4
r _ 5
p "/\n"
r " " 11
p "|  /\n"
r " " 11
p "| /\n"
r " " 11
p \|/

Note: when I tried to run it on tio.run the output is different than on my terminal. The fix to this is replacing

function r { p "$1%.s" {0..$2}}

with

function r { p "$1%.0s" {0..$2}}

which would make it 245 bytes (link).

Edit Seems like I was too eager to hit that post button and I missed some spaces, making my solution a bit less efficient. My new output seems off though, but I think I counted correctly (but it wouldn't change the length anyway).

Luca_Scorpion

Posted 2017-07-01T00:55:02.353

Reputation: 121

Welcome to PPCG! Notice that the lower line of underscores has a gap of four spaces in it, which is missing from the output of your code. – Steadybox – 2017-07-01T16:53:13.743

@Steadybox Ohh silly me. I've updated the answer, thanks for pointing it out! – Luca_Scorpion – 2017-07-01T20:26:58.530

No problem! Unfortunately, I think it's still a bit off, but this should fix it (and it saves you a byte too!).

– Steadybox – 2017-07-01T21:23:34.917

I think you can save a few bytes by using 'funcname(){}' instead of 'function funcname{}' – Winny – 2017-07-02T02:27:00.280

2

Retina, 74 bytes


 _18¶/ 18\-| 18|-| 18|-\_9 3_4%  % %/
-
¶-20¶
%
/¶ 10|
\d+
$*
+`(.)1
$1$1

Try it online!

Neil

Posted 2017-07-01T00:55:02.353

Reputation: 95 035

1

,,,, 115 101 98 bytes

I am absolutely ashamed that this is the best I can produce. >.>

"|/
"' 11×:"| /
"⇆:"|  /
"⇆'
'/'_5×' 4×'_10×92c'
'|' 19×'|'
'-21×+++++3×110⇆⊣"\
"' 19×'/'
'_19×' #

totallyhuman

Posted 2017-07-01T00:55:02.353

Reputation: 15 378

1

JavaScript (ES6), 151 bytes

_=>` 2_________
/0\\
1
|0|
1
|0|
1
\\2    _____/
3|  /
3| /
3|/`.replace(/\d/g,a=>a.repeat.call(...[[" ",19],["-",21],["_",10],[" ",11]][a]))

Test Snippet

f=
_=>` 2_________
/0\\
1
|0|
1
|0|
1
\\2    _____/
3|  /
3| /
3|/`.replace(/\d/g,a=>a.repeat.call(...[[" ",19],["-",21],["_",10],[" ",11]][a]))

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

Justin Mariner

Posted 2017-07-01T00:55:02.353

Reputation: 4 746

1

Retina, 89 bytes


1"""____¶/19\¶##-¶|19|¶##-¶|19|¶##-¶\""4"/¶11|2/¶11|1/¶11|/
#
!!
"
_____
!
-----
\d+
$* 

Try it online!

ovs

Posted 2017-07-01T00:55:02.353

Reputation: 21 408

1

Charcoal, 48 bytes

↙¹→P¹¹↓↓¹P¹¹‖B↓¦↘→×¹⁰_M⁷↑←←×¹⁰_‖BJ¹¹¦⁶→×⁴ ↙↙³↑↑³

Try it online!

Somewhat different internals than Carlos's, although not visible at first.

Erik the Outgolfer

Posted 2017-07-01T00:55:02.353

Reputation: 38 134

1

tcl, 150

proc R {s n\ 19} {string repe $s $n}
puts " [R _]
/[R \ ]\\
-[R -]- 
[set T |[R \ ]|\n-[R -]- ]
$T
\\[R _ 11]    ____/
[set S [R \  12]|]  /
$S /
$S/"

demo


Another version with same number of bytes:

proc R {s n\ 19} {string repe $s $n}
puts " [R _]
/[R \ ]\\
[set T -[R -]-\ \n|[R \ ]|]
$T
-[R -]-
\\[R _ 11]    ____/
[set S [R \  12]|]  /
$S /
$S/"

demo

sergiol

Posted 2017-07-01T00:55:02.353

Reputation: 3 055

1

Python 3.6, 132 128 125 124 bytes

x,y="_ "
b=y*19
c='-'*21
e=y*11
f=f"{c}\n|{b}|\n"
print(fr''' {x*19}
/{b}\
{f*2+c}
\{x*10+y*4+x*5}/
{e}|  /
{e}| /
{e}|/''')

Try it online!

GarethPW

Posted 2017-07-01T00:55:02.353

Reputation: 1 119

1

Windows batch, 263 bytes

@echo off
echo  ___________________
echo /                   \
for /l %%G in (1,1,2)do (
echo ---------------------
echo ^|                   ^|
)
echo ---------------------
echo \__________    _____/
echo            ^|  /
echo            ^| /
echo            ^|/

stevefestl

Posted 2017-07-01T00:55:02.353

Reputation: 539

0

Braingolf, 129 120 bytes

9+.# [#_]#
#/[# ]#\#
&@#
.+>[#-]#
!&@V9+#|[# ]#|#
!&@R!&@v&@R&@934#
..#\[#_][# ][#_]#/#
[# ]"|  /
"[# ]"| /
"[# ]"|/"&@

Try it online!

As always, braingolf is not good at ASCII art

Skidsdev

Posted 2017-07-01T00:55:02.353

Reputation: 9 656

0

Golfscript, 102 bytes

Try it online!

This is less than half the size of the actual output.

' ''_'9*.'_ 
/'' '19*'\
''-'21*n+.'|'.5$\n+++.@.@\'\\'9$'_'' '4*'_'5*'/
'2$.'   |'++.'  /
'@.' /
'@'/'

Josiah Winslow

Posted 2017-07-01T00:55:02.353

Reputation: 725

0

C (gcc), 138 137 bytes

That string still taunts me with its look of compressibility.

f(i){for(char*s=" S_:/S \\:U-:|S |:U-:|S |:U-:\\J_D E_/:K |  /:K | /:K |/";*s;s++)for(i=*s>64&*s<91?*s++-64:1;i--;)putchar(*s^58?*s:10);}

Try it online!

gastropner

Posted 2017-07-01T00:55:02.353

Reputation: 3 264

0

PowerShell, 116 115 bytes

' _19
/ 19\
-21
| 19|
-21
| 19|
-21
\_10 4_5/
 11|  /
 11| /
 11|/'-replace'(.)(\d+)',{$x,$c,$n=$_|% gr*;"$c"*"$n"}

Try it online!

mazzy

Posted 2017-07-01T00:55:02.353

Reputation: 4 832