In Honor of Adam West

91

13

Adam West passed away, and I'd like to honor his memory here on PPCG, though I doubt he knew of our existence. While there are many, many different things that this man is known for, none are more prominent than his role as the original batman. I'll always remember my step-father still watching the old-school Batman and Robin to this day. This challenge is simplistic in nature, not at all in line with the complicated man that was Adam West. However, it's the best I could come up with, as this is the most iconic image of the man's career.


I wanted to post this earlier, but I was waiting for someone to come up with something better.


Output the following (with or without trailing spaces/newlines):

           *                         *
       ****          *     *          ****
     ****            *******            ****
   ******            *******            ******
  *********         *********         *********
 ***********************************************
*************************************************
*************************************************
*************************************************
 ***********************************************
  *****       *********************       *****
    ****       ***    *****    ***       ****
       **       *      ***      *       **

This is , the lowest byte-count will win.

Magic Octopus Urn

Posted 2017-06-13T22:10:12.150

Reputation: 19 422

7You should forbid encoded strings. It is really not fun! – sergiol – 2017-06-13T22:47:38.910

7He wasn't the original Batman. That honour belongs to Lewis Wilson. – Shaggy – 2017-06-13T22:55:46.403

43When I saw the title, I thought the output was going to be "na-na-na-na-na-na-na-na na-na-na-na-na-na-na-na". – D Krueger – 2017-06-14T02:36:31.510

3@DKrueger: make it so in another question :) – Olivier Dulac – 2017-06-14T14:46:13.493

4Why didn't this start last year? Carrie Fisher, Prince, David Bowie and Alan Rickman! – caird coinheringaahing – 2017-06-14T20:58:26.160

3

@DKrueger is Array(17).join("wat"-1) close enough?

– Patrick Roberts – 2017-06-15T02:29:39.267

Do we have to use space and * or are any two unique chars okay? – TheLethalCoder – 2017-06-15T10:50:52.580

2@TheLethalCoder 27 submissions all using * and space so we're sticking to that. – Magic Octopus Urn – 2017-06-15T13:25:14.210

1Are extra spaces allowed at the end of a line? – Joel Coehoorn – 2017-06-15T21:18:12.637

@DKrueger There's (sort of) already one of those: https://codegolf.stackexchange.com/questions/67893/what-song-is-playing

– Pharap – 2017-06-16T01:22:56.703

@PatrickRoberts I remember my webdev friend showing me that when we were in college together very shortly after the initial broadcast. (And thus I stayed clear of Javascript for a very long time.) – Pharap – 2017-06-16T01:28:16.670

Hold the door! Hold the door! Hod de door! Hodddeor! Hoodoor! Hodor! – None – 2017-06-16T02:49:38.897

You may return to your harpsicord. https://youtu.be/gT5dzaje1dE?t=26

– Wossname – 2017-06-16T21:18:59.417

You may enjoy the Game of Life version I've added to my Python answer.

– PM 2Ring – 2017-06-17T12:02:21.233

Answers

49

Jelly, 44 bytes

“¡©İ'¹!ðkW>ṅṙẏṙlœf:ߌÆ@Ƥ’b25o99Jx$ị⁾ *s25ŒBY

Try it online!

How it works

“¡©İ'¹!ðkW>ṅṙẏṙlœf:ߌÆ@Ƥ’

This is a numeric literal. All characters are replaced with their 1-based indices in Jelly's code page the result is interpreted as a bijective base-250 integer, yielding

58616171447449697510361193418481584558895594063391402

Next, b25 convert that integer to base 25 and o99 replaces 0 with 99, yielding

11 1 20 4 10 1 8 4 12 4 3 6 12 4 2 9 9 5 1 99 1 24 2 5 7 11 4 4 7 3 4 3 7 2 7 1 6 2

Jx$ replaces the jth base-25 digits n with n copies of j, yielding

1 1 1 1 1 1 1 1 1 1 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 5 5 5 5 5 5 5 5 5 5 6 7 7 7 7 7 7 7 7 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 11 11 11 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 15 15 16 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 18 18 18 18 18 19 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 21 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 23 23 24 24 24 24 24 25 25 25 25 25 25 25 26 26 26 26 26 26 26 26 26 26 26 27 27 27 27 28 28 28 28 29 29 29 29 29 29 29 30 30 30 31 31 31 31 32 32 32 33 33 33 33 33 33 33 34 34 35 35 35 35 35 35 35 36 37 37 37 37 37 37 38 38

Now, ị⁾ * indexes into the character pair. Indexing is 1-based and modular, so odd numbers get replaced with spaces, even ones with asterisks. This yields

           *                    ****          *        ****            ****   ******            ****  *********         ***** *************************************************************************************************** ************************  *****       ***********    ****       ***    ***       **       *      **

s25 chops the result into chunks of length 25. If we write each chunk on its own line, we get

           *             
       ****          *   
     ****            ****
   ******            ****
  *********         *****
 ************************
*************************
*************************
*************************
 ************************
  *****       ***********
    ****       ***    ***
       **       *      **

The bounce atom ŒB palindromizes each chunk by appending a reversed copy without its first character, yielding

           *                         *           
       ****          *     *          ****       
     ****            *******            ****     
   ******            *******            ******   
  *********         *********         *********  
 *********************************************** 
*************************************************
*************************************************
*************************************************
 *********************************************** 
  *****       *********************       *****  
    ****       ***    *****    ***       ****    
       **       *      ***      *       **       

Finally, Y introduces the actual linefeeds.

Dennis

Posted 2017-06-13T22:10:12.150

Reputation: 196 637

1And I thought “QƤḣọḲ£¿ẆịµñẒṢƊ¬ƒỤ2ỴÐ,ịṁ&Ḅ<ḋsḳn.⁷ṛḃṡ⁾6bḋeṁ’ṃ⁾ *s25ŒBY was short enough at 53 bytes... – Erik the Outgolfer – 2017-06-14T08:04:00.273

I tried like 14 different things, then finally got to this by trial and error. Didn't understand what you meant by "replaces 0 with 99" until I tried it myself. – Magic Octopus Urn – 2017-06-16T18:41:42.887

156

Wordfuck, 5761 2686 bytes

I guess using his name as a source code gets Adam West some honor.

adam west adam west adam_wes t_a dam_we st_a dam_ west adam west adam west adam west_ad am_west_a dam_we st ad am we st ad am we st ad am west_a dam_we st_a dam_ west_ada m_w est ada m_w est ada m_west_ adam west_a dam_west_ adam_we st_ ad am_west ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am_wes t_ adam_w est_ adam west adam west adam west adam west adam we st_adam west_ad am we st ad am we st adam_w es t_ ad am west_ad am we st ad am we st ad am we st_ada m_ west_ad am we st ad am west_a da m_west_ ad am we st ad am we st ad am west_a da m_ we st adam_w es t_adam_ west_ad am we st ad am west_a da m_ we st adam_we st ad am we st ad am we st ad am we st_ada m_ we st ad am we st adam_we st ad am we st ad am we st ad am we st_ada m_ we st ad am_wes t_ adam_we st_adam we st ad am_wes t_ ad am we st ad am_west ad am we st ad am we st ad am we st adam_w es t_ ad am we st ad am_west ad am we st ad am we st ad am we st adam_w es t_ ad am we st adam_w es t_adam_ west_ad am we st_ada m_ we st ad am we st ad am west_ad am we st ad am we st ad am west_a da m_ we st ad am we st ad am_west ad am we st ad am we st ad am_wes t_ ad am we st ad am we st adam_w es t_adam_ west_ad am west_a da m_ we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st_ada m_ west_ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am west_a da m_west_ ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am_wes t_ adam_we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st adam_w es t_adam_ west_ad am west_a da m_ we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st ad am we st_ada m_ west_ad am_west ad am west_a da m_ we st ad am_west ad am we st ad am we st_ada m_ we st ad am we st ad am we st ad am we st ad am we st ad am west_ad am we st ad am we st adam_w es t_ ad am we st_ada m_ west_ad am_west ad am we st adam_w es t_ ad am west_ad am we st ad am we st adam_w es t_ ad am_west ad am we st adam_w es t_ ad am we st_adam we st ad am west_a da m_ we st_adam we st ad am we st ad am_wes t_ ad am we st_ada m_ west_ad am_west ad am we st ad am we st_ada m_ we st_adam we st ad am we st ad am_wes t_ adam_we st ad am we st ad am_wes t_ ad am west_ad am we st ad am we st_ada m_ west_ad am we st ad am we st adam_w es t!

Try it online! (transpiled brainfuck)

Adam West singing (thanks @carusocomputing)

Uriel

Posted 2017-06-13T22:10:12.150

Reputation: 11 708

69This is terrible. I love it. – TheWanderer – 2017-06-14T00:51:58.793

26Hmm. Yes. Pretty good, but I think you forgot an underscore on line 1. – Mateen Ulhaq – 2017-06-14T07:58:59.480

2Is there a way we can test this? – Shaggy – 2017-06-14T10:25:53.200

1

In the esolang entry there is an Wordfuck->Brainfuck converter: https://pastebin.com/BNJrU7VX

– Roman Gräf – 2017-06-14T11:51:49.343

2https://www.youtube.com/watch?v=RgHUGtlvwrY – Magic Octopus Urn – 2017-06-14T14:17:28.747

2Sometimes, it really is the taking part that counts. – David Richerby – 2017-06-14T16:11:23.453

Who said that a working implementation of a Turing machine wouldn't be practical..? :-) – Bob Jarvis - Reinstate Monica – 2017-06-14T17:53:34.443

2It says in the question This is code-golf, the lowest byte-count will win. xD – Wilf – 2017-06-15T18:17:59.520

4@Wilf welcome to PCCG! we don't really compete on this site, of course this isn't the winning solution, but its hilarious and challenge themed, so it gets upvoted so more people can enjoy it. Hoping to upvote your answers soon! – Uriel – 2017-06-15T18:28:06.393

1Wow... They don't call it wordfuck for no reason. – None – 2017-06-16T02:51:04.717

3

@Shaggy Try it online! (STDERR)

– Adám – 2017-06-16T08:44:24.763

68

Python, 530 529 528 524 bytes

import zlib as Holy
B=list("NNAAAnAAnnAnaAannnaaaaNaAAnNanAaAanNNaNNaNaanNNANanNNANaAnAaANANAAnAaANNnAanAaNnAaAANNAaAnNANAaaANNAanAaNaNNNAaNNanAAnNNnaaaNANANANnnaaaNaaAAAANaNaNaNAnNAAAAaaaaANAaNnnAaAaNAAaANNnaaNnNnaannaaAaananannNnAAAAAanAananANAnaAAnANAAaaaAaaanaaAAaanNAnanAAnnnANAnNAnnAnnnanaNNaaaNaNNaAAnNAaaANNNANAnAaaAaNaANnNNNaaAanaaaanaaaaaAaAaNnNnnaAnANaNnnANanNA")
A=dict(N='11',A='01',n='10',a='00')   
T=""
POP=BIFF=POW=OOF=lambda:A[B.pop()]
while B:T+=chr(int(POP()+POW()+BIFF()+OOF(),2))
print Holy.decompress(T)

rrauenza

Posted 2017-06-13T22:10:12.150

Reputation: 781

5Oh lord, I haven't laughed that hard in awhile. NAanANANaNANaNAANnAnaNANanaNA – Magic Octopus Urn – 2017-06-14T19:55:36.197

9

In code golf, we're supposed to make the byte count small, but your entry is rather hefty. ;)

– PM 2Ring – 2017-06-14T21:29:10.440

34On occasion, one must make sacrifices for the greater good. – rrauenza – 2017-06-14T21:34:24.207

1That sounds like something Batman would say. ;) I have to admit that I find the B.pop(0) slightly annoying. Why not reverse B so you can use the much more efficient (and shorter) B.pop()? The pop(0) has to move all the remaining list elements down one slot. Sure, it happens at C speed, but it's still less efficient than popping from the end of the string. – PM 2Ring – 2017-06-15T19:59:13.793

@PM2Ring Great idea! Done. Had to also change the map to keep it starting with an N. – rrauenza – 2017-06-15T20:30:40.340

Holy decompress, Batman! Love that little nod ;) – Doktor J – 2017-06-16T18:37:23.897

Your answer would certainly win if it was a popularity contest! – sergiol – 2017-06-17T14:28:09.747

Why import zlib as Holy? Is there a reason or is it a reference I don't get? – stybl – 2017-06-18T13:24:00.180

@Sty https://youtu.be/zQVfOguNWBw

– rrauenza – 2017-06-18T14:28:38.200

5The aliases to POP, BIFF, POW, OOF made me spit out what I was drinking on my monitor. Thanks lol. +1. – rayryeng - Reinstate Monica – 2017-06-22T20:02:14.393

20

JavaScript (ES6), 148 146 bytes

_=>`n2zh2
f8l2b2l8
b8pep8
7cpepc
5ijiji
3yyq
0
0
0
3yyq
5afy8fa
98f69a96f8
f4f2d6d2f4`.replace(/./g,c=>'* '[(n=parseInt(c,36))&1].repeat(n/2||49))

Demo

let f =

_=>`n2zh2
f8l2b2l8
b8pep8
7cpepc
5ijiji
3yyq
0
0
0
3yyq
5afy8fa
98f69a96f8
f4f2d6d2f4`.replace(/./g,c=>'* '[(n=parseInt(c,36))&1].repeat(n/2||49))

o.innerHTML = f()
<pre id=o></pre>

Arnauld

Posted 2017-06-13T22:10:12.150

Reputation: 111 334

12

Python, 149 142 bytes

7 bytes saved thanks to @PM2Ring

for l in"b1d 74a13 54c4 36c4 2995 1o 0p 0p 0p 1o 257b 447343 727162".split():x=''.join(s*int(k,36)for s,k in zip(' *'*3,l));print(x+x[-2::-1])

Uriel

Posted 2017-06-13T22:10:12.150

Reputation: 11 708

Nice. You can shave off 7 bytes: x=''.join(s*int(k,36)for s,k in zip(' *'*3,l)) – PM 2Ring – 2017-06-14T06:56:05.227

No worries. I managed to write an even shorter Python version. ;) – PM 2Ring – 2017-06-15T15:35:59.657

1@PM2Ring you got my +1 – Uriel – 2017-06-15T15:39:30.163

12

MATL, 61 59 bytes

' *'60:'*u9|K9j[~F9R,>ejc4Q,7;F\1l_=7sFR'F11:ZaY"13e)25ZvZ)

Try it online!

How it works

This uses the following, standard techniques:

  • Since the image is horizontally symmetric, only the left half (including center column) is encoded.
  • The image is linearized in column-major order (down, then across) and the resulting sequence is run-length encoded.
  • The resulting run lengths take values from 1 to 11, so the sequence of run lengths is compressed by base conversion, from base 11 to base 94 (printable ASCII chars except single quote, which would need escaping).

Luis Mendo

Posted 2017-06-13T22:10:12.150

Reputation: 87 464

1There are 60 runs in column-major order, but only 38 in row-major. Would that save any bytes? – Dennis – 2017-06-14T04:36:41.690

@Dennis The problem is that in that case the run lengths are [1:12 20 24 99], which makes compression more difficult. My best attempt is at 60 bytes

– Luis Mendo – 2017-06-14T08:38:32.197

Rather than constructing the exact set, have you tried simply using base 25 and replacing 0 with 99 with, e.g., Y|? I don't know enough MATL atm to test if that's actually shorter... – Dennis – 2017-06-14T16:28:46.407

@Dennis That looks promising. Using the set [1:24 99] I removed one byte. If I use [0:24] (base 25) I don't know how to turn 0 into 99 in few bytes

– Luis Mendo – 2017-06-14T17:18:07.380

1Right Y| doesn't work in MATL/Octave like it does in Jelly/Python. In the latter, 0 or 99 yields 99... – Dennis – 2017-06-14T18:58:59.297

@Dennis Aah, now I get it. Yes, that behavior for or / and is quite useful sometimes – Luis Mendo – 2017-06-14T21:06:39.437

7

vim, 168 156 bytes

:nm N a <C-v><ESC>
:nm A a*<C-v><ESC>
:nm B aY<C-v><ESC>yyp!!rev<C-v><CR>kJh4xo<C-v><ESC>
11NA13NB7N4A10NA3NB5N4A12N4AB3N6A12N4AB2N9A9N5ABN24AB25ABkyyppjN24AB2N5A7N11AB4N4A7N3A4N3AB7N2A7NA6N2ABdd

This assumes a Unix environment, for rev. I use a fairly straightforward (count,character) encoding, with N and A appending a and * respectively, and B doing the copy and reverse.

In the actual file, the bracketed entries are replaced by the literal bytes they represent. <C-v> is 0x16, <ESC> is 0x1b, and <CR> is 0x0d.

Try it online

Ray

Posted 2017-06-13T22:10:12.150

Reputation: 1 488

I think it would be faster to not bother making macros 'b' and 'c', and instead remap them directly. :nm N a <C-v><esc> and :nm A a*<C-v><esc> – James – 2017-06-14T19:27:00.520

@DJMcMayhem So it does. For some reason, I thought it would be more difficult to store the <C-v> in a file than it is, so I used the roundabout method so I could test it with { cat foo.vim; echo ':wq'; } | vim out.txt. I'm not sure why it didn't occur to me to try <C-v><C-v> yesterday. – Ray – 2017-06-14T21:08:47.900

I'm glad to know you got it working! Another way you can test vim answers for convenience is Try it online!, which really uses an esolang I wrote, but it's (mostly) backwards compatible anyway. The -v flag lets you use vim key descriptions (like <C-v> and whatnot)

– James – 2017-06-14T21:28:35.000

@DJMcMayhem Very nice. Thanks. – Ray – 2017-06-14T21:35:52.883

Can't you write <NL> instead of <NEWLINE>? – L3viathan – 2017-06-15T18:26:05.553

@L3viathan I could, but it wouldn't make any difference in the count. The actual file contains single bytes for each of those; I just represented the nonprintables in bracket notation here for readability. <C-v> is 0x16; <ESC> is 0x1b, and <NEWLINE> is 0x0d (so perhaps I should have called it <CR> instead). Those are the bytes that are inserted via <C-v><C-v>, <C-v><ESC>, and <C-v><ENTER> respectively. I've clarified that in the answer. – Ray – 2017-06-16T01:14:50.203

7

Charcoal, 69 54 52 48 bytes

E⪪”|↖y{{﹪yc›o”n↗πf>T≔Y¿PN|ωπQβ” ⪫Eιק* μ⌕βλω‖O←

Try it online! Link is to verbose version of code. Edit: Thanks to @ASCII-only, saved 4 bytes by switching from a separate flag to looping over indices, 7 bytes by using the (undocumented?) ⸿ character, and a further 4 bytes by using the alphabet for the run length encoding. Saved a further 2 bytes because AtIndex automatically takes the modulo. Saved a further 4 bytes because Map automatically creates an index variable. Explanation:

Print(Map(

The outer Map returns an array. Print handles this by printing each element on its own line, thus avoiding having to manually Join them with \n.

Split("anb adbke eme fjj y z z z y lhf dedhe cgbhc" " "),

The string encodes all the half-rows of the output. Alternating letters refer to the number of *s and spaces (a=0 is used to handle a row that starts with a space). The space is a convenient choice of delimiter, but also turns out to compress well (x also compresses to an overall 55 bytes). Each row is processed separately. (Note: The deverbosifier fails to remove the separator between a compressed and uncompressed string, otherwise the code would have a , for readability.)

Join(Map(i, Times(AtIndex("* ", m), Find(b, l))), w)));

Loop over every letter, expanding to the appropriate number of *s or spaces. The variable m is the inner loop index for this Map, while l holds the letter. The result is then Joined into a single string using the predefined empty string w.

ReflectOverlap(:Left);

Once all the rows are printed, reflect everything to the left, overlapping the middle column.

I tried handling the newlines, spaces and stars all in one loop but it actually took two more bytes this way:

Print(Join(Map("anb adbke eme fjj y z z z y lhf dedhe cgbhc", Ternary(Equals(" ", i), "\n", Times(AtIndex("* ", k), Find(b, i)))), w));
ReflectOverlap(:Left);

Neil

Posted 2017-06-13T22:10:12.150

Reputation: 95 035

1+1 I really need to learn Charcoal (as well has Hexagony and Cubix). Three of my favorite programming languages I see here. Btw, I guess you were already planning to, but could you add an explanation? – Kevin Cruijssen – 2017-06-14T11:02:43.777

@KevinCruijssen Hmm, I guess even the verbose code needs some clarification... does this suffice? – Neil – 2017-06-14T11:43:01.460

Ah, I hadn't noticed the TIO contained the verbose version tbh. But nevertheless, an explanation in the answer itself never hurts, so thanks for taking the time to write it. – Kevin Cruijssen – 2017-06-14T12:38:06.127

I want to learn charcoal, but it needs a page like 05AB1E which explains what each char of the code-page actually does without having to dive into code. – Magic Octopus Urn – 2017-06-14T14:49:09.193

2@carusocomputing It's not too bad: apart from compressed strings, you've got normal strings (ASCII characters and pilcrow), numbers (superscript digits), arrows (...arrows), commands (usually fullwidth capital letters) and operators (everything else), so you can then look them up on the appropriate page of the wiki. – Neil – 2017-06-14T15:28:44.487

@neil ohhh... there's a Wiki. I was literally reading codepage.py to do the 2 answers I did. I have a tendency to overlook obvious stuff. – Magic Octopus Urn – 2017-06-14T16:26:29.993

@carusocomputing I know the feeling - I stumbled across the wiki, but subsequently forgot about it, until someone reminded me. – Neil – 2017-06-14T16:45:17.820

Not that much of an improvement but still an improvement I guess – ASCII-only – 2017-06-17T06:37:06.373

Wait, slightly better

– ASCII-only – 2017-06-17T06:52:26.787

Oh btw naive method for comparison :P (if this is still broken, wait like a day for Dennis to pull fixed version)

– ASCII-only – 2017-06-17T07:36:22.913

@ASCII-only Even more slightly better still if you take out those two separators... – Neil – 2017-06-17T14:23:36.023

7

05AB1E, 47 bytes

„ *19×S•«M;Ó8ζ?èYÑ?½¨/Ž´.δòÈÖ<•25вт<19ǝ×J13ä€û»

Try it online!

Emigna

Posted 2017-06-13T22:10:12.150

Reputation: 50 798

Ported Dennis's algorithm right? – Erik the Outgolfer – 2017-06-14T11:12:16.770

@EriktheOutgolfer: Borrowed the replace 99 trick from him (saved 4 bytes over the straight forward way). Still looking for a better way though. – Emigna – 2017-06-14T11:23:40.573

-1 by using .∞ instead of €û» (mirrors implicitly join lists on newlines first in the legacy version, before applying the mirror). I've also tried to use ₂в instead of 25в, but unfortunately the compressed integer is then 1 byte longer as well, so it doesn't save anything: •2Ø°×á[1∊Œ)’˜Àå<тIÞ‡p5ÉQ•₂в. – Kevin Cruijssen – 2019-08-06T12:09:45.320

7

Various solutions, all using Run Length Encoding, with a variety of techniques to encode the RLE data.

Python 3, 125 121 bytes

This version uses a bytes string to store the data.

s=''
for c in b'<)@4/:),0/>/,3>/*981(WYYY(W*14=./4-.-4+4)2+':s+=' *'[c%2]*(c//2-19);s*=len(s)<25or print(s+s[-2::-1])or 0

Let s be a string of stars or of spaces. Then the byte n encoding s is given by

n = 38 + 2*len(s) + (s[0]=='*')

Python 2, 133 126 bytes

This version uses alphabetic coding. The letter value determines the length of the output string, the case of the letter determines whether it's composed of spaces or stars.

s=''
for c in'kAmgDjAceDlDcFlDbIiEaXYYYaXbEgKdDgCdCgBgAfB':
 s+=' *'[c<'a']*(int(c,36)-9)
 if len(s)>24:print s+s[-2::-1];s='' 

My original 133 byte Python 2 solution.

This version uses zero-length strings so it can easily alternate between star and space strings.

s=''
for c,n in zip(24*' *','b1d074a13054c436c429951o0p0p0p1o257b447343727162'):
 s+=c*int(n,36)
 if len(s)>24:print s+s[-2::-1];s=''

Just for fun, here's a one-liner using the alphabetic coding.

Python 2, 148 bytes

print'\n'.join(''.join(s+s[-2::-1])for s in zip(*[iter(''.join(' *'[c<'a']*(int(c,36)-9)for c in'kAmgDjAceDlDcFlDbIiEaXYYYaXbEgKdDgCdCgBgAfB'))]*25))

For even more fun, here's a pattern in Conway's Game of Life that generates a version of the Batman logo. I had to double each line to keep the aspect ratio roughly the same as the text version. This pattern doesn't really compute the logo (although it is possible to do computations in Life - it's Turing-complete), it just replays it from memory loops, so I guess I can't post it as a code golfing entry (although I did create it using a Python script I wrote a few years ago). ;)

It's encoded in a fairly standard RLE format that most Life engines can load. If you don't have a GoL program (eg Golly), you can view it in action online with this online Life engine, which can import Life RLE files. Here's a PNG version of that Life pattern, some Life programs (including Golly) can load Life patterns from PNGs and various other image file formats.

PM 2Ring

Posted 2017-06-13T22:10:12.150

Reputation: 469

6

Clojure, 833 437 bytes

Almost by definition Clojure will never win any prizes for brevity, but as I looked forward EVERY DARN WEEK to the TWO (count 'em - TWO) episodes of Batman (same Bat-time, same Bat-channel!) it's clear that there is no time to lose!

Quick, Robin - to the Bat-REPL!!!

(defn r[c n](clojure.string/join(repeat n c)))(defn pl[col](loop[i 0 c " "](print(r c (nth col i)))(if(< i (dec (count col)))(recur (inc i) (if (= c " ") "*" " "))(println))))(defn p[](loop[lines [[11 1 25 1][7 4 10 1 5 1 10 4][5 4 12 7 12 4][3 6 12 7 12 6][2 9 9 9 9 9][1 47][0 49][0 49][0 49][1 47][2 5 7 21 7 5][4 4 7 3 4 5 4 3 7 4][7 2 7 1 6 3 6 1 7 2]] i 0] (pl (nth lines i))(if (< i (dec (count lines)))(recur lines (inc i))nil)))

Un-golfed version:

(defn repstr [c n]
  (clojure.string/join (repeat n c)))

(defn print-bat-signal-line [col]
  (loop [i  0
         c  " "]
    (print (repstr c (nth col i)))
    (if (< i (dec (count col)))
      (recur (inc i) (if (= c " ") "*" " "))
      (println))))

(defn print-bat-signal []
  (loop [lines [[11 1 25 1]  ; spaces asterisks spaces asterisks
                [7 4 10 1 5 1 10 4]
                [5 4 12 7 12 4]
                [3 6 12 7 12 6]
                [2 9 9 9 9 9]
                [1 47]
                [0 49]
                [0 49]
                [0 49]
                [1 47]
                [2 5 7 21 7 5]
                [4 4 7 3 4 5 4 3 7 4]
                [7 2 7 1 6 3 6 1 7 2]]
        i      0]
    (print-bat-signal-line (nth lines i))
    (if (< i (dec (count lines)))
      (recur lines (inc i))
      nil)))

RIP Adam West. No matter how ridiculous those shows were, those of us who were kids salute you.

Bob Jarvis - Reinstate Monica

Posted 2017-06-13T22:10:12.150

Reputation: 544

While not golfed, it still beats the cat answer heh. – Magic Octopus Urn – 2017-06-14T19:46:11.303

Golfed version added. I'd turn it sideways to make it look like it's climbing a wall if I could. :-) – Bob Jarvis - Reinstate Monica – 2017-06-15T14:52:32.583

6

T-SQL, 283 276 222 bytes

SELECT CAST(DECOMPRESS(CAST('H4sIAAAAAAAEAFNQgAMtBVxAi5cLxgICdB3IAkAAVYuqEsLHIgRWjV0KqxBIvZYWujQeEaAGLdIALxeJGuinhXSvQEMCPVSQAbIcJPJQReGSSHxU9WAeSppAqEMoBwCfudAGawIAAA=='as XML).value('.','varbinary(max)'))AS varchar(max))

Implementing GZIP compression of the original batman string, via the method posted here. This works only in SQL 2016 and later.

For earlier SQL versions, use my prior method (276 bytes):

DECLARE @ CHAR(999)=REPLACE(REPLACE(REPLACE('PRINT SPACE(11#1$25#1&$7#4$10#1$5#1$10#4&$5#4$12#7$12#4&$3#6$12#7$12#6&$2#9$9#9$9#9&$1#47&#49&#49&#49&$1#47&$2#5$7#21$7#5&$4#4$7#3$4#5$4#3$7#5&$7#2$7#1$6#3$6#1$7#2)','#',')+REPLICATE(''*'','),'$',')+SPACE('),'&',')+CHAR(13')EXEC(@)

Basically I'm manually encoding a giant string that determines what to print next, using the following method:

  • #7 gets replaced by +REPLICATE('*',7)
  • $4 gets replaced by +SPACE(4)
  • & gets replaced by +CHAR(13)

After replacement, the full 958 character string looks like (with line breaks at each line in the Batman symbol:

PRINT 
SPACE(11)+REPLICATE('*',1)+SPACE(25)+REPLICATE('*',1)+CHAR(13)
+SPACE(7)+REPLICATE('*',4)+SPACE(10)+REPLICATE('*',1)+SPACE(5)+REPLICATE('*',1)+SPACE(10)+REPLICATE('*',4)+CHAR(13)
+SPACE(5)+REPLICATE('*',4)+SPACE(12)+REPLICATE('*',7)+SPACE(12)+REPLICATE('*',4)+CHAR(13)
+SPACE(3)+REPLICATE('*',6)+SPACE(12)+REPLICATE('*',7)+SPACE(12)+REPLICATE('*',6)+CHAR(13)
+SPACE(2)+REPLICATE('*',9)+SPACE(9)+REPLICATE('*',9)+SPACE(9)+REPLICATE('*',9)+CHAR(13)
+SPACE(1)+REPLICATE('*',47)+CHAR(13)
+REPLICATE('*',49)+CHAR(13)
+REPLICATE('*',49)+CHAR(13)
+REPLICATE('*',49)+CHAR(13)
+SPACE(1)+REPLICATE('*',47)+CHAR(13)
+SPACE(2)+REPLICATE('*',5)+SPACE(7)+REPLICATE('*',21)+SPACE(7)+REPLICATE('*',5)+CHAR(13)
+SPACE(4)+REPLICATE('*',4)+SPACE(7)+REPLICATE('*',3)+SPACE(4)+REPLICATE('*',5)+SPACE(4)+REPLICATE('*',3)+SPACE(7)+REPLICATE('*',5)+CHAR(13)
+SPACE(7)+REPLICATE('*',2)+SPACE(7)+REPLICATE('*',1)+SPACE(6)+REPLICATE('*',3)+SPACE(6)+REPLICATE('*',1)+SPACE(7)+REPLICATE('*',2)

Which gets executed as dynamic SQL, producing the following output:

           *                         *
       ****          *     *          ****
     ****            *******            ****
   ******            *******            ******
  *********         *********         *********
 ***********************************************
*************************************************
*************************************************
*************************************************
 ***********************************************
  *****       *********************       *****
    ****       ***    *****    ***       *****
       **       *      ***      *       **

BradC

Posted 2017-06-13T22:10:12.150

Reputation: 6 099

6

C (gcc), 191 bytes

#define x 16777215
char*b,*c,a[50];l[]={4096,122888,491535,2064399,4186143,x/2,x,x,x,x/2,4064255,983495,98435,0},*p=l;main(){for(;*p;p++,puts(a))for(b=c=a+23;b>=a;*p/=2)*b--=*c++=" *"[*p&1];}

Try it online!

Hagen von Eitzen

Posted 2017-06-13T22:10:12.150

Reputation: 371

5

PHP, 137 bytes

<?=gzinflate(base64_decode(U1CAAy0FXECLC8YAAnQNyAJAwIVFIYSPRYgLLkWEYrByLS10WTwiXAgmcYCLRPV00kGyN6BhgB4eyABZjgstyqAsuDpU5YjEgJIOEKoQigE));

Try it online!

PHP, 177 bytes

foreach(["9zojk",a2878,aa4nb,b7u9z,chbf3,eze2n,jz6rj,jz6rj,jz6rj,eze2n,cepdr,ako8z,a1pc1]as$v)echo$t=strtr(substr(base_convert($v,36,2),1),10,"* "),"* "[$k++<2],strrev($t),"\n";

Try it online!

PHP, 179 bytes

for(;$o=ord(kAlgDjAbeDlCcFlCbIiDaWXXXaWbEgJdDgCdBgBgAfA[$i++]);($x+=$s)%24?:print$r.("* "[$k++<2]).strrev($r)."\n".$r="")$r.=strtr(str_repeat($b=+($o>96),$s=$o-64-$b*32),10," *");

Try it online!

Jörg Hülsermann

Posted 2017-06-13T22:10:12.150

Reputation: 13 026

Your first example needs quotes – Steven Penny – 2017-06-14T02:18:36.890

2@StevenPenny No it doesn't. Have checked the try it online link? – ovs – 2017-06-14T05:14:44.733

1@StevenPenny In this case PHP use the cast of non-existing constants to strings. I only throws a Notice Error which is allowed in Codegolf. And the missing "=" at the end of the base64 encoded string will be add automatically – Jörg Hülsermann – 2017-06-14T09:48:40.250

4

Java, 296 214 bytes

Golfed:

()->{String r="";boolean b=1<0;for(int a:";1I1074:151:4054<7<4036<7<6029999901_10a10a10a01_0257E570447345437407271636172".toCharArray()){for(int i=0;i<a-48;++i)r+=(b?'*':' ');if(a<49)r+='\n';else b=!b;}return r;}

Ungolfed:

public class InHonorOfAdamWest {

  public static void main(String[] args) {
    System.out.println(f(() -> {
      String r = "";
      boolean b = 1 < 0;
      for (int a : ";1I1074:151:4054<7<4036<7<6029999901_10a10a10a01_0257E570447345437407271636172".toCharArray()) {
        for (int i = 0; i < a - 48; ++i) {
          r += (b ? '*' : ' ');
        }
        if (a < 49) {
          r += '\n';
        }
        else {
          b = !b;
        }
      }
      return r;
    }));
  }

  private static String f(java.util.function.Supplier<String> f) {
    return f.get();
  }
}

user18932

Posted 2017-06-13T22:10:12.150

Reputation:

Could use ";1I1074:151:4054<7<4036<7<6029999901_10a10a10a01_0257E570447345437407271636172" for data, and for(char a:x){a=(int)a-48; [...] basically is adding 48 to each of the numbers and converting them to their ascii char equivalent. I believe this will save you 70-80 bytes. Also I believe hardcoding the data into the lamba will reduce bytes too. – Magic Octopus Urn – 2017-06-14T19:49:47.717

Also boolean b=false; can be boolean b=1<0, or even better you could use an int and also combine the declaration for i on the same line ;). – Magic Octopus Urn – 2017-06-14T19:52:49.413

1@carusocomputing thanks, I did not think about packing it in a string. Yours had some bad Unicode value in it, I had to regenerate it and the output displays correctly now. – None – 2017-06-15T18:56:46.440

Since you don't use i in your for loop i think you can use for(int i=0;i++<a-48;) as for-head. – Roman Gräf – 2017-06-19T06:05:38.077

3

Bubblegum, 75

xxd dump:

00000000: cd92 b501 8050 1043 fb4c 91fa efbf 1f0e  .....P.C.L......
00000010: 2f87 d371 5814 37d3 7c35 4d2b 1826 64f6  /..qX.7.|5M+.&d.
00000020: d8aa 419c 2a11 3e75 ce25 6d1e ee9d 22e0  ..A.*.>u.%m...".
00000030: bb11 f04f 0d7f 2e38 dfc8 6926 3dad 0871  ...O...8..i&=..q
00000040: f316 1071 6db8 fc07 a408 f7              ...qm......

Try it online.

Digital Trauma

Posted 2017-06-13T22:10:12.150

Reputation: 64 644

3

Python 2, 134 bytes

for w in'1D 4A13 4C4 6C4 995 O P P P O 57B 47343 27162'.split():r=''.join(c*int(k,36)for c,k in zip(3*'* ',w));print'%25s'%r+r[-2::-1]

Try it online!

Run-length encodes each line from the left half in base 36. Mirrors it to make the full line, which is printed. The leading spaces are not encoded; instead, the left half is padded to length 25.

xnor

Posted 2017-06-13T22:10:12.150

Reputation: 115 687

I wish I could use that padding trick in my version... – PM 2Ring – 2017-06-15T15:34:59.670

3

Coffeescript (282 Bytes)

t=['6bk','59mw','l2j3','2ghsf','4zg2n','9zldr','jz6rj','4u7zz','165qf','47wj']
[0,1,2,3,4,5,6,6,6,5,7,8,9].map((d)->parseInt(t[d], 36).toString(2).padStart 25, '0').forEach (d)->console.log (d+d.split('').reverse().join('').substring(1)).replace(/0/g, ' ').replace(/1/g,'*')

Explaination (using plain-ol ES6)

  • Like other's mentioned, the image is symmetric, so we can toss out half of it in the encoding
  • Several lines are also repeated, so we can toss each line in a lookup table to save a few bytes
  • We convert each half-line into binary (using 0 as space and 1 as *), and encode it at that highest radix in Javascript (36), resulting in the encoding array.
  • First map takes each line and converts it back into its final output half-line, padding it with 0s
  • Second map concatenates each line with its reversed half (tossing the middle column the second time), and replaces the 0s and 1s with spaces and *s

var t = [
    '6bk',
    '59mw',
    'l2j3',
    '2ghsf',
    '4zg2n',
    '9zldr',
    'jz6rj',
    '4u7zz',
    '165qf',
    '47wj'
];
[0,1,2,3,4,5,6,6,6,5,7,8,9].map((d) => {
    return parseInt(t[d], 36).toString(2).padStart(25, '0');
})
.forEach((d) => {
    console.log((d + d.split('').reverse().join('').substring(1))
        .replace(/0/g, ' ')
        .replace(/1/g, '*'));
});

cjbrooks12

Posted 2017-06-13T22:10:12.150

Reputation: 131

Cool answer! Welcome to the site! :) – James – 2017-06-19T21:07:03.990

2

V, 102 bytes

i±³ *±± 
³ *± ´*· 
´*±² ´*µ 
´*±² ¶*³ 
µ*¹ ¹*  
²´* Ä3o²µ*jo±±*· µ*  
³*´ ³*· ´*´ 
**¶ *· **· Îæ$vp

Try it online!

Hexdump:

00000000: 69b1 b320 2ab1 b120 0ab3 202a b120 b42a  i.. *.. .. *. .*
00000010: b720 0ab4 2ab1 b220 b42a b520 0ab4 2ab1  . ..*.. .*. ..*.
00000020: b220 b62a b320 0ab5 2ab9 20b9 2a20 200a  . .*. ..*. .*  .
00000030: b2b4 2a20 1bc4 336f b2b5 2a1b 6a6f b1b1  ..* ..3o..*.jo..
00000040: 2ab7 20b5 2a20 200a b32a b420 b32a b720  *. .*  ..*. .*. 
00000050: b42a b420 0a2a 2ab6 202a b720 2a2a b720  .*. .**. *. **. 
00000060: 1bce e624 7670                           ...$vp

This uses run-length encoding to generate the following batman half:

             *           
   *          ****       
****            ****     
****            ******   
*****         *********  
************************ 
*************************
*************************
*************************
************************ 
***********       *****  
***    ***       ****    
**      *       **      

And then reverses and duplicates each line.

James

Posted 2017-06-13T22:10:12.150

Reputation: 54 537

2

C# (.NET Core), 342 333 328 185 175 bytes

_=>{var r="";for(int i=0,j,k=0;i<63;i++)for(j=0;j++<"-#;#4&,#'#,&.&.).&*(.).('+++++%Q#µ#Q%')7)'(&)%&'&%)&-$)#(%(#)$)"[i]-34;){r+=i%2<1?' ':'*';if(++k%49<1)r+='\n';}return r;}

Try it online!

Lots of bytes saved after changing the approach. Taking the drawing as a 2D array, I calculated the RLE encoding by files:

{ 11, 1, 25, 1, 18, 4, 10, 1, 5, 1, 10, 4, 12, 4, 12, 7, 12, 4, 8, 6, 12, 7, 12, 6, 5, 9, 9, 9, 9, 9, 3, 47, 1, 147, 1, 47, 3, 5, 7, 21, 7, 5, 6, 4, 7, 3, 4, 5, 4, 3, 7, 4, 11, 2, 7, 1, 6, 3, 6, 1, 7, 2, 7 }

Odd indices stand for s and even indices stand for *s. Then I substituted every number for a printable ASCII representation (taking the '#' character as 1), and I got:

-#;#4&,#'#,&.&.).&*(.).('+++++%Q#µ#Q%')7)'(&)%&'&%)&-$)#(%(#)$)

So the algorithm just calculates the drawing by decompressing this string and adding newlines in the proper places.

Charlie

Posted 2017-06-13T22:10:12.150

Reputation: 11 448

1No need to set l to a variable just use it in the loop directly. .ToString(i, 2) -> .ToString(i,2) i.e. remove the whitespace. – TheLethalCoder – 2017-06-14T10:48:34.927

Can you save any bytes with decimal or scientific (1e10) representations for those numbers? This challenge is actually helpful here.

– TheLethalCoder – 2017-06-15T15:47:29.740

@TheLethalCoder nope. I just checked (impressive challenge, by the way) and I already use the smallest representation, so no luck there. I even tried finding the greatest common divisor between them to see if I could divide the numbers by a constant, but it's obviously 1. – Charlie – 2017-06-15T19:50:20.417

2

Mathematica 151 Bytes

Uncompress@"1:eJxTTMoPCm5iYmBQQAAtBVxAK8bA0AjGBgJ0PcgCQABXjaoWwsciBFWPXRKrEESHlha6AjwiYC1apAGQHhK10FsTOV6Chgp6CCEDZDlYdKKKw6WR+OjxD+KiJBSEQoR6AC49ZiI="

Cheap and uncreative. The string is just from the built-in Compress command used on the required output.

Update:

I think I can do better with the built-in ImportString \ ExportString functions but I can't see to copy and paste the resulting strings from ExportString correctly. E.g.

b = "           *                         *\n       ****          *     *          ****\n     ****            *******            ****\n   ******            *******            ******\n  *********         *********         *********\n ***********************************************\n*************************************************\n*************************************************\n*************************************************\n ***********************************************\n  *****       *********************       *****\n    ****       ***    *****    ***       ****\n       **       *      ***      *       **"
ExportString[b,"GZIP"]
ImportString[%,"GZIP"]

I can not seem to copy the text output from the second line to replace the % in the third line.

Ian Miller

Posted 2017-06-13T22:10:12.150

Reputation: 727

2

Bash, 407 322 bytes

w=`yes 1|head -30|tr -d '\n'`
for i in B1C000 74A120 54C003 36C003 299004 1C0506 0D0506 0D0506 0D0506 1C0506 257505 447342 727161
{ read a b c d e f <<<$(echo $i| fold -1| xargs)
x=`printf "%.$[0x${a}]d%.$[0x${b}]s%.$[0x${c}]d%.$[0x${d}]s%.$[0x${e}]d%.$[0x${f}]s" 0 $w 0 $w 0 $w`
echo -n $x$[f<1?0:1]
rev<<<$x
}|tr 01 \ \*

Try it online!

really awful, need more time or help to golf it. it generates the output with 0 an 1 and transliterates in the end. Encoded in hexa digits the amount of 0 and 1, taking care to make last digit 0 for the first two rows as a flag to output middle column. Uses printf pressision to either digit or string to output 0 and 1. think the %.$[0x${X}]C pattern could be used to golf it.

w=`yes 1|head -30|tr -d '\n'`  # w=111111111111111111111111111111   
for i in B1C000 74A120 54C003 36C003 299004 1C0506 0D0506 0D0506 0D0506 1C0506 257505 447342 727161
{ read a b c d e f <<<$(echo $i| fold -1| xargs)
printf "%.$[0x${a}]d
%.$[0x${b}]s
%.$[0x${c}]d
%.$[0x${d}]s
%.$[0x${e}]d
%.$[0x${f}]s" 0 $w 0 $w 0 $w
echo -n $[f<1?0:1]
printf "%.$[0x${f}]s
%.$[0x${e}]d
%.$[0x${d}]s
%.$[0x${c}]d
%.$[0x${b}]s
%.$[0x${a}]d\n" $w 0 $w 0 $w 0 
}|tr 01 \ \*

marcosm

Posted 2017-06-13T22:10:12.150

Reputation: 986

2

PowerShell, 305 bytes, 307 bytes, 316 bytes

[IO.StreamReader]::new(([IO.Compression.GZipStream]::new([IO.MemoryStream]::new(([Convert]::FromBase64String('H4sIAAAAAAAEAL1SOQ4AIAjbTfwDc///QFE8gKAJi53sNQASbYBuQC3rxfANLTBm1iaFB9JIx1Yo9Tzg7YfCBeRQS7Lwr5IfZW7Cb0VDe3I8q25TcXvrTsyXOLGTbuHBUsBqAgAA')),0,102),[IO.Compression.CompressionMode]::Decompress))).ReadToEnd()

Maybe someone else can help me shorten it further, though I can't figure out how unless there's a more concise way to define a custom type accelerator.

Edit: Shortened version (thanks @root). Encoded string (pre base64 encoding) can be trimmed by eight array positions and the range can be thus decreased. Not sure why StreamWriter is introducing this bloat into the MemoryStream. Insight into the underlying behavior would be appreciated.

[IO.StreamReader]::new(([IO.Compression.GZipStream]::new([IO.MemoryStream]::new(([Convert]::FromBase64String('H4sIAAAAAAAEAL1SOQ4AIAjbTfwDc///QFE8gKAJi53sNQASbYBuQC3rxfANLTBm1iaFB9JIx1Yo9Tzg7YfCBeRQS7Lwr5IfZW7Cb0VDe3I8q25TcXvrTsyXOLGTbg')),0,94),[IO.Compression.CompressionMode]::Decompress))).ReadToEnd()

Ungolfed:

#Read decoded stream 
[IO.StreamReader]::new(
    (
        #Reverse GZip encoding
        [IO.Compression.GZipStream]::new(
            #Load GZip encoded string into a memory stream
            [IO.MemoryStream]::new(
                (
                    # Convert Base64 back to GZip encoded string
                    [Convert]::FromBase64String('H4sIAAAAAAAEAL1SOQ4AIAjbTfwDc///QFE8gKAJi53sNQASbYBuQC3rxfANLTBm1iaFB9JIx1Yo9Tzg7YfCBeRQS7Lwr5IfZW7Cb0VDe3I8q25TcXvrTsyXOLGTbuHBUsBqAgAA')
                ),
                #Start of range
                0,
                #End of range. Stick the Memory Stream into a variable and use .Length here for non golf code
                102
            ),
            #Specify that we are decompressing
            [IO.Compression.CompressionMode]::Decompress
        )
    )
).ReadToEnd()

Compression code:

$s = '           *                         *
       ****          *     *          ****
     ****            *******            ****
   ******            *******            ******
  *********         *********         *********
 ***********************************************
*************************************************
*************************************************
*************************************************
 ***********************************************
  *****       *********************       *****
    ****       ***    *****    ***       ****
       **       *      ***      *       **'

#Create Memory Stream
$ms = [IO.MemoryStream]::new()
#Initialize a stream
$sw = [IO.StreamWriter]::new(
    #Create GZip Compression stream
    [IO.Compression.GZipStream]::new(
        #Reference Memory Stream
        $ms,
        #Set mode to compress
        [IO.Compression.CompressionMode]::Compress
    )
)
#Write input into stream
$sw.Write($s)
#Close the stream
$sw.Close()

#Convert Array to Base64 string
[Convert]::ToBase64String(
    #Retrieve Memory Stream as an array
    ($ms.ToArray() | select -SkipLast 8)
)

Chirishman

Posted 2017-06-13T22:10:12.150

Reputation: 389

1Why 102? 99 works the same, [IO.StreamReader]::new(([IO.Compression.GZipStream]::new([IO.MemoryStream]::new(([Convert]::FromBase64String('H4sIAAAAAAAEAL1SOQ4AIAjbTfwDc///QFE8gKAJi53sNQASbYBuQC3rxfANLTBm1iaFB9JIx1Yo9Tzg7YfCBeRQS7Lwr5IfZW7Cb0VDe3I8q25TcXvrTsyXOLGTbuHBUsBqAgAA')),0,102),[IO.Compression.CompressionMode]::Decompress))).ReadToEnd() – root – 2017-06-16T15:40:10.113

@root it does, I guess but i'm not sure why that works. You can actually decrease it by eight to 94 and drop the last eight characters of the encoded input string. I'm having a hard time figuring out why this works and I don't want to add it to my answer until I do.

Is my compression function erroneously adding in some extraneous padding somehow? – Chirishman – 2017-06-16T16:00:50.677

1From your compression code, the last two values from $ms.ToArray() are both 0. Are they necessary? – root – 2017-06-16T16:13:45.880

No. And trying different input strings it seems consistent that it's exactly two unneeded array positions on the end. I'll add a clause to skip the last two to my compress script. Still wish I knew why stream writer was adding the nulls onto the end – Chirishman – 2017-06-16T16:24:00.123

1You're right, it's more than just the 2 tail characters, it's 8. The last 8 positions in the array, ('225','193','82','192','106','2','0','0'), can be removed to create H4sIAAAAAAAEAL1SOQ4AIAjbTfwDc///QFE8gKAJi53sNQASbYBuQC3rxfANLTBm1iaFB9JIx1Yo9Tzg7YfCBeRQS7Lwr5IfZW7Cb0VDe3I8q25TcXvrTsyXOLGTbg==. I don't understand where they're coming from. – root – 2017-06-16T16:29:33.940

2

Python 3, 232 197 183 164 bytes

Yet Another Python Answer. No boring compression code though. Exciting compression code.

for s in map(lambda x:x+x[-2::-1],b".$; *',$' ('.* &).* %,+, $R #T #T #T $R %()8 '')&&( *%)$(&".split()):print(*((u-35)*" "+(v-35)*"*"for u,v in zip(*[iter(s)]*2)))

I'm using the magic number 35 because that way, no control characters, spaces or things that would need to be escaped occur. Sad that I have to process the spaces and stars separately, that costs me a bit.

Ungolfed:

for s in map(lambda x:x+x[-2::-1],   # map a list to the list and itself reversed,
                                     # minus the last (center) element
# magic string:
".$; *',$' ('.* &).* %,+, $R #T #T #T $R %()8 '')&&( *%)$(&"
.split()):                           # split on whitespace to divide into lines
 print(*(                            # unpack generator expression
(ord(s[i])-35)*" "                   # convert character to int, -25, times space
+(ord(s[i+1])-35)*"*"                # same thing with "*"
for i in range(0,len(s)-1,2)))       # for every pair in the list

L3viathan

Posted 2017-06-13T22:10:12.150

Reputation: 3 151

That encoding method's better than base 36. I hope you don't mind that I've adapted it for my latest solution. ;) There are a few things you can do to reduce your byte count. 1 You can save a byte by putting the print call on the same line as the for. 2 If you use a bytes string you can get rid of those ord calls. 3 You can replace the range by zipping over a pair of iterators. Here's a generator that combines both those ideas: ((u-35)*" "+(v-35)*"*"for u,v in zip(*[iter(s)]*2)). Those changes will bring your count down to 164. – PM 2Ring – 2017-06-16T09:24:28.010

@PM2Ring I don't mind at all. Going on vacation for a few weeks so feel free to edit in your changes. – L3viathan – 2017-06-16T09:26:52.823

Oh, ok. But I'll let you do the new un-golfed version. – PM 2Ring – 2017-06-16T09:27:31.223

@PM2Ring in a bus already, so I'll just hope someone else will approve it – L3viathan – 2017-06-16T09:33:17.940

2

Perl 5, 168 bytes

$_="11 *25 
7 4*10 *5 *10 4
5 4*12 7*12 4
3 6*12 7*12 6
2 9*9 9*9 9
 47
49
49
49
 47
  5*7 21*7 5
4 4*7 3*4 5*4 3*7 4
7 **7 *6 3*6 *7 *";s/$/*/gm;say s/\d+(.)/$1x$&/ger

Note the trailing space at the end of only the first line. Requires -M5.01, which is free.

Can probably be golfed quite a bit more.

msh210

Posted 2017-06-13T22:10:12.150

Reputation: 3 094

2

LaTeX, 314 bytes

\documentclass{book}\begin{document}\def\r#1#2{\ifnum#2>64#1\r#1{\numexpr#2-1}\fi}\catcode`.13\catcode`!13\catcode`-13\def!#1{\r*{`#1}}\def-#1{\r~{`#1}}\let.\par\tt-K!A-Y!A.-G!D-J!A-E!A-J!D.-E!D-L!G-L!D.-C!F-L!G-L!F.-B!I-I!I-I!I.-A!o.!q.!q.!q.-A!o.-B!E-G!U-G!E.-D!D-G!C-D!E-D!C-G!D.-G!B-G!A-F!C-F!A-G!B\enddocument

The ungolfed version with explanations:

\documentclass{book}
\begin{document}
% Macro for repeating #1 (#2-64) times
\def\r#1#2{\ifnum#2>64#1\r#1{\numexpr#2-1}\fi}
% Prepare '.', '!' and '-' for usage as macro names
\catcode`.13\catcode`!13\catcode`-13
% The ASCII code of #1 (a character) is used as the number of how often '*' will be printed with \r
\def!#1{\r*{`#1}}
% Same as ! but for spaces
\def-#1{\r~{`#1}}
% . becomes a line break
\let.\par
% Set monospace font
\tt
% And finally print the whole thing
-K!A-Y!A.-G!D-J!A-E!A-J!D.-E!D-L!G-L!D.-C!F-L!G-L!F.-B!I-I!I-I!I.-A!o.
!q.!q.!q.-A!o.-B!E-G!U-G!E.-D!D-G!C-D!E-D!C-G!D.-G!B-G!A-F!C-F!A-G!B
\enddocument

siracusa

Posted 2017-06-13T22:10:12.150

Reputation: 623

2

PowerShell, 129 128 bytes

-join('5+C+<.4+/+4.6.616.206160/33333-Y+s*t+Y-/1?1/0.1-./.-1.5,1+0-0+1,'|% t*y|%{(' ','*')[$i++%2]*($_-42)})-split'(.{49})'-ne''

Try it online!

Ungolfed:

-join(
    '5+C+<.4+/+4.6.616.206160/33333-Y+s*t+Y-/1?1/0.1-./.-1.5,1+0-0+1,'|% toCharArray|%{
        (' ','*')[$i++%2]*($_-42)
    }
)-split'(.{49})'-ne''

Output:

           *                         *           
       ****          *     *          ****       
     ****            *******            ****     
   ******            *******            ******   
  *********         *********         *********  
 *********************************************** 
*************************************************
*************************************************
*************************************************
 *********************************************** 
  *****       *********************       *****  
    ****       ***    *****    ***       ****    
       **       *      ***      *       **

Main idea is very simple

The Emblem Coding:

  1. Concatenate all emblem lines to one string
  2. Count spaces and asterisks
  3. Encode length of each segment + 42 as a char

Decoding (this script):

  1. Get code of the char minus 42 for each char from the cripto-string. This is a length of a segment
  2. Append segment, consisting of a space or asterisk repeated Length times
  3. Insert new line each 49 symbols to split lines

Some smart things

  1. The coding algorithm suggests a symbol with code 189 to display 3 middle asterisk lines. This symbol is not ASCII. It works normal with modern environments, but there are ambiguities with script length. So, I replace non-ascii-symbol ½ to s*t (73 asterisks, 0 spaces, 74 asterisks).
  2. I cut off right spaces in the last line to save 1 byte. Sorry, Batman.
  3. Why the offset is 42? Just wanted :) And cripto-string looks nice.

Extra: Scipt for coding of the Emblem

(@"
           *                         *           
       ****          *     *          ****       
     ****            *******            ****     
   ******            *******            ******   
  *********         *********         *********  
 *********************************************** 
*************************************************
*************************************************
*************************************************
 *********************************************** 
  *****       *********************       *****  
    ****       ***    *****    ***       ****    
       **       *      ***      *       **       
"@ -replace"`n"-split'( +|\*+)'-ne''|%{[char]($_.Length+42)})-join''

mazzy

Posted 2017-06-13T22:10:12.150

Reputation: 4 832

1

Mathematica, 271 bytes

T=Table;f[x_]:=""<>T["*",x];m={f@49};n={f@47};g[y_]:=""<>T[" ",y];k[a_,b_,c_,d_,e_]:={(s=f@a<>g@b<>f@c<>g@d<>f@e)<>StringDrop[StringReverse@s,1]};Grid@{k[1,13,0,0,0],k[4,10,1,3,0],k[4,12,0,0,4],k[6,12,0,0,4],k[9,9,0,0,5],n,m,m,m,n,k[5,7,0,0,11],k[4,7,3,4,3],k[2,7,1,6,2]}

J42161217

Posted 2017-06-13T22:10:12.150

Reputation: 15 931

1

Braingolf, 590 580 579 577 428 423 312 bytes

-111 bytes because LeakyNun is a golfing god

14#
46*6394943[92+.6,5][8]#.[# ]#*[# ]#*#
[# ][#*][# ]#*[# ]#*[# ]#*...#
[# ][#*][# ][#*][# ]#*...#
# ..[#*][# ][#*][# ][#*]#
# .[#*][# ][#*][# ][#*]#
# [#*]#
&@#0[#*]#
!&@!&@# &@#.[#*]"
  "&@4645*643646366556[#*][# ][#*][# ][#*]"
    "[#*][# ]#*..# ...[#*]# ...#*..[# ][#*]#
[# ]#*.[# ]#*[# ]#*..[# ]#*[# ]#*.&@

Try it online!

Braingolf is not good at ASCII art, but dammit I tried.

No way in hell am I explaining this clusterf**k

Skidsdev

Posted 2017-06-13T22:10:12.150

Reputation: 9 656

1

gawk, 284 264 bytes.

Uses LZW compression.

BEGIN{d["#"]="\n";d["$"]=" ";d["%"]="*";n=38
split("$&'($%),--%#/%3.&+(7.3318;5';B@6;=*B95I4DL=L?:QJ)T0HWZ[\\F]_`Q#adaceh[1ilOERVi2F>MqJIusX,v8}~62#",x,"")
while(++i<96){c=x[i];c in d||d[c]=p substr(p,1,1)
p&&d[sprintf("%c",n++)]=p substr(d[c],1,1)
printf p=d[c]}}

PM 2Ring

Posted 2017-06-13T22:10:12.150

Reputation: 469

1

///, 171 166 bytes

5 bytes saved because I was using \r\n in the source, lol.

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

Try it online!

Compressed by using successive iterations of replacing the "most economical" substrings with a single character. This is nearly optimal, though one of two things could be the case:

  1. I could get away with using some meta replacements (e.g. dynamically insert regexes)
  2. It is somehow more beneficial to replace less economical substrings first (unlikely).

Conor O'Brien

Posted 2017-06-13T22:10:12.150

Reputation: 36 228

1

braingasm, 187 bytes

XXX represents a string of 154 mostly unprintable bytes (here's a hexdump of the whole program).

"XXX",76[->$[<s[32.]z[42.]q[10.]>]>]

The string is is dumped onto the tape and its bytes are read in pairs in a sort of run-length encoding scheme: The first byte is initially either 0, 1 or 8, but then decremented by one to become -1, 0 or 7. Each of these numbers will only pass one of the following tests:

  • s - signed => print 32 (space)
  • z - zero => print 42 (asterisk)
  • q - prime => print 10 (newline)

The second byte of each pair is the number of times to print.

daniero

Posted 2017-06-13T22:10:12.150

Reputation: 17 193

1

JavaScript (ES6, no string encoding), 233 bytes

Golfed:

[[11,1,13],[7,4,10,1,3],[5,4,12,4],[3,6,12,4],[2,9,9,5],[1,24],[0,25],[0,25],[0,25],[1,24],[2,5,7,11],[4,4,7,3,4,3],[7,2,7,1,6,2]].map(a=>a.map((b,c)=>' *'[c%2].repeat(b)).join``).map(a=>a+a.split``.reverse().join``.slice(1)).join`
`

Ungolfed:

[
    [11, 1, 13],
    [7, 4, 10, 1, 3],
    [5, 4, 12, 4],
    [3, 6, 12, 4],
    [2, 9, 9, 5],
    [1, 24],
    [0, 25],
    [0, 25],
    [0, 25],
    [1, 24],
    [2, 5, 7, 11],
    [4, 4, 7, 3, 4, 3],
    [7, 2, 7, 1, 6, 2]
]
    .map(row => row
        .map((val, idx) => ' *'[idx % 2].repeat(val))
        .join``
    )
    .map(str => str + str
        .split``
        .reverse()
        .join``
        .slice(1)
    )
    .join`
`

Explanation

The matrix represents the left half of the logo as numbers of alternating character always starting with space, and including the middle character. Thus each list is a half-palindrome line, each number the number of times to repeat a character, and the parity of its index whether the character is a space (even) or asterisk (odd).

The first map replaces lists of numbers with lists of repeated characters and joins into a single string (per line).

The second map mirrors each string excluding the already-included middle character.

Lastly the lines are joined with newlines and the final result of the expression is the complete string, to be assigned or used as an argument.

Demo

o.innerHTML = [[11,1,13],[7,4,10,1,3],[5,4,12,4],[3,6,12,4],[2,9,9,5],[1,24],[0,25],[0,25],[0,25],[1,24],[2,5,7,11],[4,4,7,3,4,3],[7,2,7,1,6,2]].map(a=>a.map((b,c)=>' *'[c%2].repeat(b)).join``).map(a=>a+a.split``.reverse().join``.slice(1)).join`
`
<pre id=o></pre>

HonoredMule

Posted 2017-06-13T22:10:12.150

Reputation: 121

Welcome to PPCG. Here is a very quickly golfed 216 byte version to help you get started.

– Shaggy – 2017-06-16T14:02:45.667

Thanks. I see some bits I can adopt to improve mine, while the encoded string I'll leave for someone else. I wanted to participate in the tribute to Adam West, but cheesy uses of compression and encoded strings are exactly why I won't be sticking around. :/ I'm not in it to win it - I'd rather restrict myself to more creative optimizations. – HonoredMule – 2017-06-16T14:20:55.027

Also, I just learned about ES6 tagged templates (https://stackoverflow.com/questions/29660381/backticks-calling-a-function) from your version, and wow, WTF. :P

– HonoredMule – 2017-06-16T14:22:46.890

1

sed, 244 bytes

Alphabetic RLE. Uppercase letters encode stars, lower case encode spaces, underscores encode newlines. So 'A' -> '*', 'B' -> '**' etc. This script doesn't take advantage of the pattern's left-right symmetry, thus some of the strings are longer than 26 bytes; those strings are encoded using two letters.

s/.*/kAyAk_gDjAeAjDg_eDlGlDe_cFlGlFc_bIiIiIb_aZUa_ZW_YX_ZW_aZUa_bEgUgEb_dDgCdEdCgDd_gBgAfCfAgBg/;:L;y/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy/*ABCDEFGHIJKLMNOPQRSTUVWXY abcdefghijklmnopqrstuvwx/;s/[A-Z]/&*/g;s/[a-z]/& /g;tL;s/_/\n/g

I don't think it's possible to run sed without giving it a file to read. This program ignores the contents of the file you pass it, and prints a Batman symbol for each line in the file. The easiest way to invoke it in Bash is by passing it an empty here-string, eg:

sed<<<'' -f batman.sed

Or don't bother saving it to a file, just run it directly in the CLI:

sed<<<'' 's/.*/kAyAk_gDjAeAjDg_eDlGlDe_cFlGlFc_bIiIiIb_aZUa_ZW_YX_ZW_aZUa_bEgUgEb_dDgCdEdCgDd_gBgAfCfAgBg/;:L;y/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy/*ABCDEFGHIJKLMNOPQRSTUVWXY abcdefghijklmnopqrstuvwx/;s/[A-Z]/&*/g;s/[a-z]/& /g;tL;s/_/\n/g'

The annotated version:

# The compressed data string.
# Uppercase letters encode stars, lower case  encode spaces, underscores encode newlines
# Convert the current input line to the data string.
s/.*/kAyAk_gDjAeAjDg_eDlGlDe_cFlGlFc_bIiIiIb_aZUa_ZW_ZW_ZW_aZUa_bEgUgEb_dDgCdEdCgDd_gBgAfCfAgBg/

# Interpret letters as string lengths
# Start the loop
:L

# Transliterate each letter to the previous letter in alphabetical order,
# except 'A' goes to star and 'a' goes to space
y/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy/*ABCDEFGHIJKLMNOPQRSTUVWXY abcdefghijklmnopqrstuvwx/

# Append a star to an uppercase string
s/[A-Z]/&*/g

# Append a space to a lowercase string
s/[a-z]/& /g

# Goto the 'L" label at the top of the loop unless no `s` substitution
# was performed since the last goto
tL

# Convert underscores to newlines
s/_/\n/g

# The result is now printed, and execution returns to the start of the script 
# to process the next input line, if it exists.

Here's a version that does take advantage of the pattern's left-right symmetry. However, it's longer than the previous program, since it uses a rather complicated loop to split off each half-line and combine it with its reversed version.

sed, 261 bytes.

Needs the -r option on the commandline (or in the shebang), since it uses extended Regular Expressions.

s/.*/kAm_gDjAc_eDlD_cFlD_bIiE_aX_Y_Y_Y_aX_bEgK_dDgCdC_gBgAfB_/;:L;y/ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklm/*ABCDEFGHIJKLMNOPQRSTUVWX abcdefghijkl/;s/[A-Z]/&*/g;s/[a-z]/& /g;tL;:a;h;s/_.*//;s/^(.*)(.)$/\1@&@/;:x;s/(@.)(.*)(.@)/\3\2\1/;tx;s/@//g;p;g;s/[^_]*_//;ta

This script shares some logic with the previous code, but here's an annotated version of the section that does the palindromisation, which was derived from the code for reversing a string given in the sed info pages.

# Palindromise a series of words.

# Start the outer loop    
:a
# Save the current pattern 
h

# Remove everything after the 1st word
s/_.*//

# Palindromise a line.

# Begin embedding the line between two markers
# Also insert the line, except for the last char, before the 1st marker
s/^(.*)(.)$/\1@&@/

# Loop to reverse the chars between the markers
:x;s/(@.)(.*)(.@)/\3\2\1/;tx

# Remove the markers
s/@//g

# Print the palindromised result and restore the pattern 
p;g

# Remove the word we just processed
s/[^_]*_//

# Goto to the 'a' label unless no `s` substitution was
ta

PM 2Ring

Posted 2017-06-13T22:10:12.150

Reputation: 469

Using capitals and lowercases, that's pretty darn smart. – Magic Octopus Urn – 2017-06-16T18:39:39.290

@carusocomputing Thanks! I also used that in some of my Python versions. – PM 2Ring – 2017-06-16T18:52:36.460

1

Scala (169 chars) (Based on @snowman's answer)

Golfed:

var b=false;";1I1074:151:4054<7<4036<7<6029999901_10a10a10a01_0257E570447345437407271636172".foreach{a⇒print((if(b) "*" else " ")*(a-48));if(a < 49)println()else b = !b}

Ungolfed:

object Batman extends App {
var b = false
 ";1I1074:151:4054<7<4036<7<6029999901_10a10a10a01_0257E570447345437407271636172".foreach { a ⇒
    print((if (b) "*" else " ") * (a - 48))
    if (a < 49) println() else b = !b
  }
}

Channing Walton

Posted 2017-06-13T22:10:12.150

Reputation: 111

1

C# (.NET Core), 312 280 bytes

An improvement (?) on this by Carlos Alejo.

Uses smaller (int32 instead of int64) constants for initial "bitmap", uses an int (z) on the redundant entries (5 wide bands in middle), uses reflection technique to mirror the partial output.

Downside: requires a using System; statement in the header.

()=>{var s="";int z=33554431;foreach(var i in new[]{8192,245768,983055,4128783,8372255,z/2,z,z,z,z/2,8128511,1966983,196867}){s+=Convert.ToString(i,2).PadLeft(25,' ').Replace('0',' ').Replace('1','*');for(int j=s.Length-2;j>=s.Length-49;j--)s+=s.Substring(j,1);s+='\n';}return s;}

Try it online!

The trick with using a var for the redundant lines is from this by Hagen von Eitzen. Problem with that answer is that the output is incorrect, only 47 chars wide instead of 49.

If Carlos Alejo used that trick on his answer, the score would go down to 278:

()=>{var s="";var z=(1L<<49)-1;foreach(var i in new[]{0x2000000800,0x3c008200780,0xf000fe001e0,0x3f000fe001f8,0x7fc01ff007fc,z/2-1,z,z,z,z/2-1,0x7c07ffffc07c,0x1e0387c380f0,0x30103810180})s+=Convert.ToString(i,2).PadLeft(49,'0').Replace('0',' ').Replace('1','*')+'\n';return s;}

Try it online!

an odder guest

Posted 2017-06-13T22:10:12.150

Reputation: 11

In fact, I have just changed my answer after a complete redesign of the algorithm and now I use less than 200 bytes. – Charlie – 2017-06-22T07:17:33.920

1

CJam, 78 bytes

"@ÇÏßÿÿÿÿÿÿÿÿÿÿÿÿýÿÿóÿ"{8{_2U#&'*S?\}fU;}/]25/{_24/~;W%N}%

Try it online!


How it works:

Like many other submissions, this takes advantage of vertical symmetry so that only the following data has to be encoded:

           *             
       ****          *   
     ****            ****
   ******            ****
  *********         *****
 ************************
*************************
*************************
*************************
 ************************
  *****       ***********
    ****       ***    ***
       **       *      **

Since all lines are 25 characters long, we can drop all newlines:

           *                    ****          *        ****            ****   ******            ****  *********         ***** *************************************************************************************************** ************************  *****       ***********    ****       ***    ***       **       *      **

This string only contains spaces and *, so it's the perfect candidate for a bitmap. 8 characters are chunked into one with a 1 bit meaning * and 0 meaning space. The string is 325 characters long, so it's padded with 3 additional spaces to be dividable by 8. This yields the binary string:

@ÇÏßÿÿÿÿÿÿÿÿÿÿÿÿýÿÿóÿ

Now, onto the code part:

{8{_2U#&'*S?\}fU;}/]25/{_24/~;W%N}%     e# for each character do:
 8{_2U#&'*S?\}fU                        e#   for U in 0..7 do:
   _2U#&'*S?\                           e#     push (char & pow(2, U)) ? '*' : ' '
   _                                    e#     duplicate the character
    2U#                                 e#     push pow(2, U)
       &                                e#     bitwise-AND the char with the value
        '*                              e#     push '*'
          S                             e#     push space
           ?                            e#     ternary select
            \                           e#     swap the pushed char with the original (for next loop iteration)
                ;                       e#   pop the character (from last loop iteration) from the stack
                    ]                   e# wrap all pushed chars in one array
                     25/                e# split array after every 25 elements (chars)
                        {_24/~;W%N}%    e# for each char group do:
                         _24/~;W%N      e#   mirror string and append newline
                         _              e#   duplicate string
                          24/           e#   split at 24 chars
                             ~          e#   dump array to stack
                              ;         e#   pop top stack element
                               W%       e#   select every -1th element (reverse)
                                 N      e#   push newline

Siguza

Posted 2017-06-13T22:10:12.150

Reputation: 719

1

Self-modifying Brainfuck, 700 bytes

<<...........>.<.........................>.<<.>.......>....<..........>.<.....>.<..........>....<<.>.....>....<............>.......<............>....<<.>...>......<............>.......<............>......<<.>..>.........<.........>.........<.........>.........<<.>.>...............................................<<.>>.................................................<<.>>.................................................<<.>>.................................................<<.>.>...............................................<<.>..>.....<.......>.....................<.......>.....<<.>....>....<.......>...<....>.....<....>...<.......>....<<.>.......>..<.......>.<......>...<......>.<.......>..
 *

Try it online!

Yes. This can probably be golfed. Do I want to though? Oh please no.

Datboi

Posted 2017-06-13T22:10:12.150

Reputation: 1 213

Pretty impressive that you're 80 bytes off of just printing it in cat. – Magic Octopus Urn – 2017-07-26T15:57:45.497

1

tcl, 325 317 303 302 300 299

Still very long:

proc F {n\ 5} {format %$n\s *}
proc R {n\ 49} {string repe * $n}
puts "[F 12][F 26]
[set f [F 8]][set T ***][F 11][F 6][F 12]$T
[F 6][set M $T[F 13]$T$T[F 13]]$T
   $T$M[R 5]
  [R 9][set H [F 10][R 8]]$H
 [R 47]
[R]
[R]
[R]
 [R 47]
  [R 5]$f[R 20]$f*$T
[F]$T$f**[F]*$T[F]**$f$T
$f*$f[F 7]**[F 7]$f*"

demo

sergiol

Posted 2017-06-13T22:10:12.150

Reputation: 3 055

1

Bubblegum, 70 bytes

00000000: cd8b a501 c000 10c4 fc4d f13a fbef 574e  .........M.:..WN
00000010: 195d a30e 6b81 ba82 2880 ddc1 9b75 54e6  .]..k...(....uT.
00000020: fab3 2856 6fc6 10c5 d2de 2629 be11 f8e3  ..(Vo.....&)....
00000030: a33e 1fc6 478d 20b2 efa2 5a42 13c5 d210  .>..G. ...ZB....
00000040: 350a bdc2 9c16                           5.....

Try it online!

ovs

Posted 2017-06-13T22:10:12.150

Reputation: 21 408

1

C (gcc), 170 169 160 bytes

-9 bytes thanks to ceilingcat.

char*s="1Q111O19Q81ii81imP1mopppppppppppppppopppm2mpa4ia17AQ",o[50];main(i){for(;*s;s+=4,o[24]=o[23],puts(o))for(i=24;i--;)o[i]=o[48-i]=s[i/6]-49>>i%6&1?42:32;}

Try it online!

gastropner

Posted 2017-06-13T22:10:12.150

Reputation: 3 264

1

Befunge, 139 bytes

I know this is a bit late now, but I wasn't around at the time the challenge was initially posted, and this looked like it would be a fun problem to solve in Befunge.

"YaA(!"***+"3{~X"7**+*"e~#"+*32223"a}|V"*+*v>,\2/34g1-:v:*55\+55\0-2<
_@#:*+** "+Ewn_"**+*"^iw/C"+*83:*9+**"+9_t"<^:g\8%2:p43_$$$>>:#,_$:#^

Try it online!

Explanation

* We start by pushing thirteen integers onto the stack, whose bits represent half of the pattern of the bat (the other half being a reflection). Each of these integers is offset by two, since that makes their Befunge representations slightly more compact.
* We then start the main loop, which will process one line/integer at a time. We subtract two to account for the offset, and we push push a null terminator and a newline onto the stack for later use when writing out the second half of the line.
* Next we get to the inner loop which iterates over the 25 bits in the number, taking the value mod 2 to extract a bit, and performing a table lookup on column 8 of the source (*) to obtain the character to output. The character is also pushed onto the stack for later use.
* Once this loop is complete, the first half of the line has been output, and the characters for the second half are in place on the stack in reverse order. We then simply output those characters with a standard string output sequence, and return to the start of the main loop.

Source code with execution paths highlighted

James Holderness

Posted 2017-06-13T22:10:12.150

Reputation: 8 298

1

Brainfuck, 369 bytes

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

Try it online!

General idea is to fill memory with counts for how many spaces, stars, and newlines to output (the character to write is the position modulo 3), terminated by a 255. To efficiently build the counts the symbol is broken into a bottom half, which is prefilled with 0 7 3, and the top half which is prefilled with 0 9 4.

+[[->>>+<<<]>+++++++>+++>+]- Fills the memory with 254 repetitions of 0 7 3 terminated with a 255, not all of them are used but its easier to create that many than any other count.

<-<<<--<-<<<-<<--<<<-<<+<+<<<<---<<++<---<<<<<+<---<+<++<<<+<[->++<]<<<<<++<-----<<[[-]<]+<-< Updates the counts of the bottom half, note the [[-]<] which zeros 3 consecutive cells and is used as a marker for changing the cell repetitions and to compact the middle 5 lines into a loop.

[++<<+<]>[>>>] Update remaining cells to be repetitions of 0 9 4.

<<<<+<+<<<+<<<+<<<+<--<[[->+++++>>]<[<<<]>]+<+<+++++<<<+++++<<<+++++<-------<+<++<+++<<[+++<]<++<------<+<<+++<<[+++<]<<----[<+<]<+[----<]<---<+<<<--<+<+[-<+++>]+<+<<---<++< Update the counts of the top half.

++++++++[-<+<++++<++++>>>]<--<+>>+[-[-<.>]<<<[->>>+<<<]>>>>+] Output the characters. The first loop builds 42 32 10, second loop outputs the right most character n times and then moves the left most character forwards 3 cells and repeats until a 255 is hit.

Blue Cheetah

Posted 2017-06-13T22:10:12.150

Reputation: 11

0

Taxi, 793 bytes

"           *                         *\n       ****          *     *          ****\n     ****            *******            ****\n   ******            *******            ******\n  *********         *********         *********\n ***********************************************\n*************************************************\n*************************************************\n*************************************************\n ***********************************************\n  *****       *********************       *****\n    ****       ***    *****    ***       ****\n       **       *      ***      *       **" is waiting at Writer's Depot.
Go to Writer's Depot:w 1 r 3 l 2 l.
Pickup a passenger going to Post Office.
Go to Post Office:n 1 r 2 r 1 l.
Go to Taxi Garage:n 1 r 1 l 1 r.

Try it online!

I would have hoped that something more fun than the naive solution would have been shorter.

JosiahRyanW

Posted 2017-06-13T22:10:12.150

Reputation: 2 600

0

T-SQL, 212 bytes

I wonder if I get extra bonus for making my script unreadable

Golfed:

DECLARE @x
bit=0,@ varchar(max)='=3Ke96<373<h76>9>h58>9>j4;;;;m3adcdcdcdad2479G9i669567659h9493858394'WHILE'!'<@
SELECT @=stuff(@,1,1,'')+replicate(char(32+10*@x),ascii(@)%50)+iif(ascii(@)>99,'
',''),@x-=1PRINT @

The way this works. The script takes a varchar and loop it for each character. The result is appended to the end of the varchar. The bit gets flipped every time the loop runs. This bit determine which character gets chosen.

Every character represents a number and will also include a line change when the ascii value is above 100+. The ascii value of each character determine how many characters to repeat(maximum 49).

values explained

2=ascii-50 produce 0 char no linebreak

3=ascii-51 produce 1 char no linebreak

:=ascii-60 produce 8 char no linebreak

d=ascii-100 produce 0 char linebreak

f=ascii-102 produce 2 char linebreak

Ungolfed:

DECLARE
  @x bit=0,
@ varchar(max)='=3Ke96<373<h76>9>h58>9>j4;;;;m3adcdcdcdad2479G9i669567659h9493858394'
WHILE @>'!'
  SELECT
    @=stuff(@,1,1,'')+
    replicate(char(32+10*@x),ascii(@)%50)+iif(ascii(@)>99,'
',''),
    @x-=1
PRINT @

Try it online ungolfed version

t-clausen.dk

Posted 2017-06-13T22:10:12.150

Reputation: 2 874

0

Stax, 43 bytes

¬H∙☼ßú¶ε╥M9rx⌠ªÅ`Fm■♦▓dL∩BF╚3♣æ7~εåIZ▼•sÿ4ú

Run and debug it

It's just the left-half, run-length encoded and then mirrored.

recursive

Posted 2017-06-13T22:10:12.150

Reputation: 8 616

0

Python 3, 234 224 bytes

-10 bytes thanks to @Blue

for i in range(637):print(' *'[0x301038101800F01C3E1C0781F01FFFFF01F1FFFFFFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFC7FC01FF007FC1F8007F000FC03C003F800780078010400F00002000000800>>i&1],end=['\n',''][(i+1)%49>0])

Try it online!

I made this version before searching through all the answers. It's different to all the other python answers, but definitely longer. As far as I can see, I'm using a different method to all of them, using bit shifting.

TheOnlyMrCat

Posted 2017-06-13T22:10:12.150

Reputation: 1 079

If you're using bit shifting, instead of the lengthy '*'if...else' ' construct, you could do ' *'[...] to save 6 bytes, for 12 bytes total. – Blue – 2019-08-06T14:03:16.020

@Blue Thanks! I've also applied this to the if...else at the end. I'll update this later. – TheOnlyMrCat – 2019-08-06T22:01:10.343

0

Julia, 177 bytes

println.(prod(get.(" ",reshape([fill.((1:38).%2,[11,1,20,4,10,1,8,4,12,4,3,6,12,4,2,9,9,5,1,99,1,24,2,5,7,11,4,4,7,3,4,3,7,2,7,1,6,2])...;],25,:),'*')[[1:25;24:-1:1],:],dims=1))

Stores only the left half encoded as the numbers of chars until the char changes. Could probably be improved upon with a better encoding.

Try it online!

user3263164

Posted 2017-06-13T22:10:12.150

Reputation: 381