Walkers Join! - Alan Walker's logo

13

6

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!

Dat

Posted 2017-08-17T16:44:47.750

Reputation: 879

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? – dzaima – 2017-08-17T16:49:24.150

@dzaima, yes you can. – Dat – 2017-08-17T16:50:11.163

+1 for Alan Walker!! – HighlyRadioactive – 2019-10-06T10:06:04.243

Answers

14

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.

Neil

Posted 2017-08-17T16:44:47.750

Reputation: 95 035

You "only" beat the naive solutions by 20 bytes :P – Stephen – 2017-08-17T18:29:44.150

1@StepHen A 46% saving isn't bad given the overhead of setting a loop up in the first place... – Neil – 2017-08-17T18:45:48.793

Is mirroring just not shorter for this? – Stephen – 2017-08-17T19:02:49.157

5@StepHen Fixing up the asymmetry costs too much. Best I could do was 35 bytes: F²«Jι⁰↘χ↗↗⁵M⁵↑←↙χ»‖M↥\\¶ \\F²«Jι⁰↖³. – Neil – 2017-08-17T20:02:57.183

13

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>

Arnauld

Posted 2017-08-17T16:44:47.750

Reputation: 111 334

Nicely golfed. Took a stab at this myself before checking the answers; ended up with something similar to your 172 byte version. – Shaggy – 2017-08-18T10:55:40.433

7

brainfuck, 579 bytes

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

Try it online!

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

Conor O'Brien

Posted 2017-08-17T16:44:47.750

Reputation: 36 228

I'm pretty sure this can be golfed down, especially that last part – Stan Strum – 2018-05-25T00:45:08.323

@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. – Conor O'Brien – 2018-05-25T01:45:17.507

6

SOGL V0.12, 38 bytes

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

Try it Here!

dzaima

Posted 2017-08-17T16:44:47.750

Reputation: 19 048

Now we're waiting for Charcoal :P – Mr. Xcoder – 2017-08-17T17:07:19.267

@Mr.Xcoder if it doesn't beat me, I don't know. – dzaima – 2017-08-17T17:07:48.007

4

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

totallyhuman

Posted 2017-08-17T16:44:47.750

Reputation: 15 378

3

///, 166 bytes

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

Try it online!

Conor O'Brien

Posted 2017-08-17T16:44:47.750

Reputation: 36 228

3

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!

cleblanc

Posted 2017-08-17T16:44:47.750

Reputation: 3 360

356 bytes – ceilingcat – 2019-07-27T02:38:59.513

3

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.

totallyhuman

Posted 2017-08-17T16:44:47.750

Reputation: 15 378

191 bytes – movatica – 2019-07-27T07:49:38.080

3

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.

nimi

Posted 2017-08-17T16:44:47.750

Reputation: 34 639

2

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!

Stephen

Posted 2017-08-17T16:44:47.750

Reputation: 12 293

2

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])

totallyhuman

Posted 2017-08-17T16:44:47.750

Reputation: 15 378

1

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.

AdmBorkBork

Posted 2017-08-17T16:44:47.750

Reputation: 41 581

@Veskah Simple byte savings. Thanks! – AdmBorkBork – 2019-03-14T19:11:45.183

1

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.

Erik the Outgolfer

Posted 2017-08-17T16:44:47.750

Reputation: 38 134

1

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)

Titus

Posted 2017-08-17T16:44:47.750

Reputation: 13 814

1

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!

ovs

Posted 2017-08-17T16:44:47.750

Reputation: 21 408

1

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

Embodiment of Ignorance

Posted 2017-08-17T16:44:47.750

Reputation: 7 014

j>>2 -> j/4 – ASCII-only – 2019-03-16T06:08:39.727

124. also i think you can put the null-bytes in if you hand-craft the URL – ASCII-only – 2019-03-16T06:10:48.317

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... – ASCII-only – 2019-03-16T06:14:41.223

close, this is 143 whereas normal is 141 – ASCII-only – 2019-03-16T06:25:17.393

@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: https://tio.run/##Sy7WTS7O/O9Wmpdsk5@UlZpcouPpmleam1qUmJSTalNcUpSZlx4da2eXZvs/3tZOiYnFkonDkMOYR1NAW0BRQllEUkFaQlBDWIZTMMZAgFuBUZBDgFlVUEBIMcaAU4KTSYdRgTEmr0JJLzg1B2i4RpatnUZearlCMNhgDXUFdZ0sfRNNbY0sVSM7A3slfX0lKwelmBglsJCJnaG9UkyekpWSkqamXnBBTmaJBoj535orvCizJFUD4j495/y85MQSjTQNY02YRcm2dqiSyZpAYP0fAA

– Embodiment of Ignorance – 2019-03-18T02:51:03.033

Check the meta rules for input/output, submissions may use a list of strings instead of multiline strings. anything else is not allowed.

– ASCII-only – 2019-03-18T03:07:40.063

1

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

Chas Brown

Posted 2017-08-17T16:44:47.750

Reputation: 8 959

0

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!

gastropner

Posted 2017-08-17T16:44:47.750

Reputation: 3 264