13
\$\begingroup\$

You might know Alan Walker from his ever popular song Faded. Now his "followers" are called Walkers and they have a logo, here is a simplified version:

\\
 \\              //\\  
  \\            //  \\            //
   \\          //    \\          //
    \\        //      \\        //
     \\      //        \\      //
      \\    //          \\    //
       \\  //    //\\    \\  //
        \\//    //  \\    \\//
         //    //    \\    \\
        //\\  //      \\  //\\
           \\//        \\//  \\
                              \\

The goal of this challenge is to print this logo.

RULES:

  1. If you return a list of strings from a function as per meta standards, please provide a footer that prints it to the screen.
  2. All characters of the above logo have to be there. No shortcuts!
  3. Shortest number of bytes wins!
\$\endgroup\$
  • \$\begingroup\$ can there be extra spaces at the end of each line (as they don't change how the output looks)? Can there be leading/appending newlines? \$\endgroup\$ – dzaima Aug 17 '17 at 16:49
  • \$\begingroup\$ @dzaima, yes you can. \$\endgroup\$ – Dat Aug 17 '17 at 16:50
  • \$\begingroup\$ +1 for Alan Walker!! \$\endgroup\$ – HighlyRadioactive Oct 6 at 10:06

18 Answers 18

14
\$\begingroup\$

Charcoal, 31 30 29 27 bytes

F²«Jι⁰↙χ↖↖⁵↙↙⁵↖↖²P↖χ↙↗χ↘↘¹²

Try it online! Link is to verbose version of code. Sadly Copy doesn't do what I want in this case, so I have to loop instead. Explanation:

F²«Jι⁰

Draw everything twice, but with the cursor starting one character to the right the second time.

   ↙χ↖↖⁵↙↙⁵↖↖²P↖χ

Draw the main W from right to left, but leave the cursor near the inverted V.

   ↙↗χ↘↘¹²

Draw the inverted V.

\$\endgroup\$
  • \$\begingroup\$ You "only" beat the naive solutions by 20 bytes :P \$\endgroup\$ – Stephen Aug 17 '17 at 18:29
  • 1
    \$\begingroup\$ @StepHen A 46% saving isn't bad given the overhead of setting a loop up in the first place... \$\endgroup\$ – Neil Aug 17 '17 at 18:45
  • \$\begingroup\$ Is mirroring just not shorter for this? \$\endgroup\$ – Stephen Aug 17 '17 at 19:02
  • 5
    \$\begingroup\$ @StepHen Fixing up the asymmetry costs too much. Best I could do was 35 bytes: F²«Jι⁰↘χ↗↗⁵M⁵↑←↙χ»‖M↥\\¶ \\F²«Jι⁰↖³. \$\endgroup\$ – Neil Aug 17 '17 at 20:02
13
\$\begingroup\$

JavaScript (ES6), 172 139 bytes

let f =

_=>`1
3s1
5o5o
7k9k
9gdg
bchc
d8l8
f48194
h08590
i899
g14d41
n0h05
1p`.replace(/.p?/g,n=>' '.repeat((n=parseInt(n,36))/2)+(c='/\\'[n&1])+c)

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

How?

The logo basically consists of groups of spaces followed by either // or \\ and line feeds.

Spaces and ending patterns are encoded using base-36 values:

  • The least significant bit gives the ending pattern: 0 for //, 1 for \\.
  • All other bits give the number of spaces before the ending pattern.

Everything can be encoded this way with a single base-36 digit except the last line which consists of 30 spaces followed by \\, leading to 30*2+1 = 61 = 1p in base-36. This p should be interpreted as 12 spaces followed by \\ but this pattern doesn't appear anywhere. So, we can simply handle this special case at the cost of 2 extra bytes in the regular expression: /.p?/.


First version, 186 bytes

NB: This one was submitted prior to the logo update.

let f =

_=>[...`WALKER'S`].reduce((s,c)=>(x=s.split(c)).join(x.pop()),`E
 ELSRE
'LK'
 'LRWLR
WSKS'SK
S ESRLESR
S'KL'K
S 'RKEWR
LEAK'WA
L AKWW
SKERS'RE
L 'ALEA'
LLLS'S    '  ER  AE\\\\KSALSSA//WSE`)

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

\$\endgroup\$
  • \$\begingroup\$ Nicely golfed. Took a stab at this myself before checking the answers; ended up with something similar to your 172 byte version. \$\endgroup\$ – Shaggy Aug 18 '17 at 10:55
7
\$\begingroup\$

brainfuck, 579 bytes

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

Try it online!

Generates the constants 47 92 32 10 in memory, then selects and outputs them as appropriate.

\$\endgroup\$
  • \$\begingroup\$ I'm pretty sure this can be golfed down, especially that last part \$\endgroup\$ – Stan Strum May 25 '18 at 0:45
  • \$\begingroup\$ @StanStrum Feel free to give it a shot. I tried but couldn't find any nice way to express it, especially given BF's verbosity in conditionals. \$\endgroup\$ – Conor O'Brien May 25 '18 at 1:45
6
\$\begingroup\$

SOGL V0.12, 38 bytes

6«╝5╚@┼╬⁷7«8ž'⁸3L╚ž92L╚╬5L«26«╝╬5:21╬5

Try it Here!

\$\endgroup\$
  • \$\begingroup\$ Now we're waiting for Charcoal :P \$\endgroup\$ – Mr. Xcoder Aug 17 '17 at 17:07
  • \$\begingroup\$ @Mr.Xcoder if it doesn't beat me, I don't know. \$\endgroup\$ – dzaima Aug 17 '17 at 17:07
4
\$\begingroup\$

Bubblegum, 77 76 bytes

Hexdump:

0000000: 75cf c109 8000 0c43 d17b a6c8 0659 28fb  u......C.{...Y(.
0000010: cf21 05cb a782 3de9 4b5a b495 5b9f 4946  .!....=.KZ..[.IF
0000020: 870f dac3 f8ea 5704 51b9 2284 c611 0114  ......W.Q.".....
0000030: 9029 f09e ec67 2362 21e1 075e 2136 29b9  .)...g#b!..^!6).
0000040: 08b9 bf97 8939 cf33 ebbf d33e            .....9.3...>

Try it online!

Bubblegum threshold. :P

\$\endgroup\$
3
\$\begingroup\$

///, 166 bytes

/-/!#//,/%"//'/%#//&/!!//%/  //#/\\\/\\\///"/\\\\\\\\//!/%%/"
 "&!'"%
,&-,&-
% "&'!"&'
!"&#!,&#
! "!'&"!'
!,-&,-
!% "'-"!"'
&"#-,!"#
& #-!"!"
&#"'!,'"
&% "#&"#,
&&&!,

Try it online!

\$\endgroup\$
3
\$\begingroup\$

C (gcc), 377 bytes

char*r="2\\01 2\\14 2/2\\02 2\\12 2/2 2\\12 2/03 2\\10 2/4 2\\10 2/04 2\\8 2/6 2\\8 2/05 2\\6 2/8 2\\6 2/06 2\\4 2/10 2\\4 2/07 2\\2 2/4 2/2\\4 2\\2 2/08 2\\2/4 2/2 2\\4 2\\2/09 2/4 2/4 2\\4 2\\08 2/2\\2 2/6 2\\2 2/2\\011 2\\2/8 2\\2/2 2\\030 2\\";char d[9];main(i){do{if(*r==48)puts(""),r++;for(i=0;isdigit(*r);d[i++]=*r++);for(d[i]=0,i=atoi(d);i--;putchar(*r));}while(*r++);}

Try it online!

\$\endgroup\$
3
\$\begingroup\$

Python 2, 197 bytes

print''.join(i>'/'and(i<'2'and['/','\\'][int(i)]*2or' '*int(i))or i for i in"""1
 19501
2193021
319 0419 0
41806180
51608160
61409 140
71204014120
8104021410
90404141
8012061201
921081021
99931""")

Try it online!

Uses the logic from the JS answer.

\$\endgroup\$
3
\$\begingroup\$

Haskell, 161 160 bytes

foldr(\a->(++(' '<$[1..fromEnum a-last(96:[64|a<'`'])])++last("\\\\":["//"|a<'`'])))""<$>words"` `Na LbLb JdJc HfHd FhFe DjDf Bd`DBg @dbD@h ddDI `BfB`H b@h@k ~"

Try it online!

Spaces before \\ are encoded as lowercase letters and before // as uppercase letters where the number of spaces is the ASCII value minus 96 (or 64). Zero spaces is ` / @. The Spaces of each line are stored in reverse order, because the are consumes by a right-fold.

\$\endgroup\$
2
\$\begingroup\$

Charcoal, 51 bytes

P↘¹²→↘¹²↑P↗⁵→↗⁵↓P↘⁵→↘⁵↑P↗χ→↗χM¹¹↓M⁵←P↖¹²←↖¹²↓P↙χ←↙χ

Try it online!

Charcoal, 50 bytes

P↘χ→↘χ↑P↗⁵→↗⁵M⁵↑←P↙χ←↙χMχ↗‖MM¹⁸←P↖²←↖²J²⁷¦⁹P↘²→↘²¦

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Charcoal, 50 31 bytes

F²«↘¹²↗↗⁵↘↘⁵↗↗⁹Mχ↓M⁴←↖¹²↙↙χJ¹¦⁰

Try it online! Link is to verbose version.

I tried. (Also, I will point out that I did this completely on my own, even if it looks somewhat similar to the other one. [Shiz, I did it again. This is still different, by the way. :P])

\$\endgroup\$
1
\$\begingroup\$

Jelly, 65 bytes

“<fṭY2Ẹ<ƭẹ£ʋ¥¹)Œ<Ẓ⁹ḣ⁶ıĠ\ṃṛ?04|ẏḌẉƙ+’b36⁶ẋ“ÇỴ$ñ⁵FḄ’Bị⁾\/¤ẋ€2¤żFs36

Try it online!

Returns a list of characters. TIO link has a footer to print on separate lines.

\$\endgroup\$
1
\$\begingroup\$

PHP, 186 bytes:

Both versions require PHP 5.5 or later.

Run with -nr or try them online


space compression gives the shortest alternative:

(double backslash mapped to 0, double slash to f, sapces compressed to digits)

while(~$c="0
1077f0
2066f2066f
3055f4055f
408f608f
506f806f
604f5504f
702f4f0402f
80f4f2040f
9f4f4040
8f02f602f0
560f80f20
87870"[$i++])echo+$c?str_pad("",$c):strtr($c,["\\\\",f=>"//"]);

PHP 7.1 yields warnings; replace +$c with $c>0 to fix.


base 64 encoded bitmap (187 bytes):

(mapped space to 00, newline to 01, double backslash to 10 and double slash to 11, then concatenated 3 "pixels" each to one character, prepended 1 and converted from binary to ASCII)

for(;$c=ord("d`@@@@yB@@@@p`@@@M@`@@C@H@@@t@`@@p@H@@M@B@@p@@`@M@@`C@@@H@t@@`pC`BCP@@l@p`Bt@@C@L@`BP@@xL@BCd@@@K@@Bpd@@@@@@@@@B"
[$i++]);)for($b=6;$b;)echo[" ","
","\\\\","//"][3&$c>>$b-=2];

(first linebreak for reading convenience; the other one is essential)

\$\endgroup\$
1
\$\begingroup\$

Bubblegum, 74 bytes

00000000: 758c 4b11 0400 0885 eea6 a081 85e8 9f63  u.K............c
00000010: 4fb2 7f4f 0e30 4f07 e5ed 7615 8613 e16f  O..O.0O...v....o
00000020: 321c ab89 d484 4a22 2591 8a48 45a0 2052  2.....J"%..HE. R
00000030: 809e dfd5 481e 3d0d 7a24 4d96 bc43 b2fd  ....H.=.z$M..C..
00000040: 96d3 cdbf fff9 7fa7 f300                 ..........

Try it online!

\$\endgroup\$
1
\$\begingroup\$

PowerShell, 221 220 bytes

$ofs=''
"b
 b$(' '*14)/b
$((2..6|%{' '*$_+"b$(($a=' '*(14-++$i*2)))/$(' '*$i*2)b$a/`n"}))   4b  /4/b4b  /
44b/4/  b4b/
44 /4/4b4b
44/b  /4  b  /b
44   b/44b/  b
$(' '*30)b"-replace4,'    '-replace'/','//'-replace'b','\\'

Try it online!

Fairly naïve approach (and 50 bytes worse than the JS answer, cringe). Anyone know of a way to do multiple -replaces in PowerShell?

-1 byte thanks to Veskah.

\$\endgroup\$
1
\$\begingroup\$

Python 2, 180 bytes

print''.join(c<'3'and'\\/\n\\/'[int(c)::3]or' '*(int(c,36)-2)for c in'0230g104240e140e1250c160c1260a180a127081a08128061c0612904161060412a0161406012b16160602a1041804102d01a01402w0')

Try it online!

The encoding is base 36:

0 => \\
1 => //
2 => \n

and otherwise,

n => (n-2) spaces
\$\endgroup\$
1
\$\begingroup\$

C# (Visual C# Interactive Compiler), 122 bytes (121 chars)

_=>@"
A
9;13) +!(# 0$(	-) 
4	(	€".SelectMany(j=>(j%2>0?"//":@"\\").PadLeft(j/4)+(j%4>1?"\n":""))

Try it online!

Explanation

Each part of the logo is just 0+ spaces with either a \\ or a // at the end, plus maybe a newline. There are 52 of these. We then encode each segment into a character:

  • Take the number of spaces in each segment, then add 2 to that number.

  • Bit shift the number to the left 2 times.

  • If the segment ends with //, bit-wise OR the number by one.

  • If the segment ends with a newline, bit-wise OR the number by two.

  • Take the number, and cast it into a char.

  • Repeat for each segment.

Here are all of the 52 segments and the numeric value they encode into:

10,12,65,10,16,57,16,59,20,49,24,51,24,41,32,43,28,33,40,35,32,25,48,27,36,17,25,8,24,19,40,9,25,16,24,11,45,25,24,26,41,8,17,32,17,10,52,9,40,9,18,128
\$\endgroup\$
  • \$\begingroup\$ j>>2 -> j/4 \$\endgroup\$ – ASCII-only Mar 16 at 6:08
  • \$\begingroup\$ 124. also i think you can put the null-bytes in if you hand-craft the URL \$\endgroup\$ – ASCII-only Mar 16 at 6:10
  • \$\begingroup\$ in the explanation: bitshift left, not right. also list of strings is only if you return each line as its own string... you'll need the string.Concat here for it to be valid... \$\endgroup\$ – ASCII-only Mar 16 at 6:14
  • \$\begingroup\$ close, this is 143 whereas normal is 141 \$\endgroup\$ – ASCII-only Mar 16 at 6:25
  • \$\begingroup\$ @ASCII-only I am pretty sure returning a list of strings like this is allowed, but I'll add another solution just in case. However, is this valid: tio.run/##Sy7WTS7O/… \$\endgroup\$ – Embodiment of Ignorance Mar 18 at 2:51
0
\$\begingroup\$

C (gcc), 144 140 139 bytes

-4 bytes thanks to ceilingcat.

Each character in the string encodes a number of spaces to use before a certain string. If it's a lower-case letter (or a backtick), then the string is "\", and if upper-case or @, it's "//". A space signifies a newline.

f(c,i){for(i=0;c="` aN` bLbL cJdJ dHfH eFhF fDjD gBD`dB h@Dbd@ IDdd H`BfB` k@h@b ~"[i++];)printf("%*s",c%32+2,c<33?"\n":c<96?"//":"\\\\");}

Try it online!

\$\endgroup\$

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