| Bytes | Lang | Time | Link |
|---|---|---|---|
| 052 | Vyxal 3 | 250512T171734Z | Themooni |
| 200 | Raku Perl 6 rakudo | 250513T174103Z | xrs |
| 164 | Zsh +coreutils | 221206T110755Z | roblogic |
| 299 | Tcl | 170704T165957Z | sergiol |
| 213 | Acc!! | 240520T062252Z | engineer |
| 332 | Clojure | 170614T194309Z | Bob Jarv |
| 053 | Vyxal j | 210530T063003Z | emanresu |
| 139 | Duocentehexaquinquagesimal | 210414T224311Z | Makonede |
| 222 | TSQL | 170614T212701Z | BradC |
| 369 | Brainfuck | 190810T094046Z | Blue Che |
| 224 | Python 3 | 190806T093541Z | TheOnlyM |
| 128 | PowerShell | 181004T130620Z | mazzy |
| 177 | Julia | 190806T132326Z | Simeon S |
| 043 | Stax | 190806T040450Z | recursiv |
| 160 | C gcc | 171113T151909Z | gastropn |
| 212 | TSQL | 190331T194652Z | t-clause |
| 793 | Taxi | 181004T142742Z | JosiahRy |
| 139 | Befunge | 171127T020328Z | James Ho |
| 2686 | Wordfuck | 170613T231314Z | Uriel |
| 048 | Charcoal | 170614T094253Z | Neil |
| 070 | Bubblegum | 170726T144428Z | ovs |
| 175 | C# .NET Core | 170614T103854Z | Charlie |
| 059 | MATL | 170613T223934Z | Luis Men |
| 700 | Selfmodifying Brainfuck | 170626T125009Z | Datboi |
| 314 | LaTeX | 170625T064344Z | siracusa |
| 233 | JavaScript ES6 | 170615T220710Z | HonoredM |
| 078 | CJam | 170622T020238Z | Siguza |
| 280 | C# .NET Core | 170617T215818Z | an odder |
| 168 | Perl 5 | 170619T230424Z | msh210 |
| 282 | Coffeescript 282 Bytes | 170619T210050Z | cjbrooks |
| 169 | Scala | 170617T141458Z | Channing |
| nan | Various solutions | 170614T204102Z | PM 2Ring |
| 244 | sed | 170616T181932Z | PM 2Ring |
| 305 | PowerShell | 170614T185830Z | Chirishm |
| 191 | C gcc | 170616T145313Z | Hagen vo |
| 164 | Python 3 | 170615T104541Z | L3viatha |
| 264 | gawk | 170614T130833Z | PM 2Ring |
| 156 | vim | 170614T031825Z | Ray |
| 524 | Python | 170614T191813Z | rrauenza |
| 187 | braingasm | 170615T213224Z | daniero |
| nan | 170614T172045Z | user1893 | |
| nan | Bash | 170614T172529Z | marcosm |
| 151 | Mathematica 151 Bytes | 170614T133301Z | Ian Mill |
| 166 | /// | 170614T191322Z | Conor O& |
| 142 | Python | 170613T222736Z | Uriel |
| 312 | Braingolf | 170614T100253Z | Mayube |
| 137 | PHP | 170613T225102Z | Jör |
| 047 | 05AB1E | 170614T104927Z | Emigna |
| 044 | Jelly | 170613T234701Z | Dennis |
| 271 | Mathematica | 170614T002528Z | ZaMoC |
| 134 | Python 2 | 170614T002036Z | xnor |
| 102 | V | 170613T230042Z | DJMcMayh |
| 146 | JavaScript ES6 | 170613T223207Z | Arnauld |
| 075 | Bubblegum | 170613T224015Z | Digital |
Vyxal 3, 52 bytes
"=∥[¶⌈{•›m⎄⎊z⧢⇄!⍰⎊⁜∩ᐵ²▲⌽6B{≊YT★δø%ƶyγ⑴c⦷Nᐵ“Ꮬ* ⊢13÷⨪”
-1 byte by using ⊢
I really tried but none of the other compression techniques i tried yielded better results. I'm not happy with it but what can you do.
"=∥[¶⌈{•›m⎄⎊z⧢⇄!⍰⎊⁜∩ᐵ²▲⌽6B{≊YT★δø%ƶyγ⑴c⦷Nᐵ“Ꮬ* ⊢13÷⨪”
"=∥[¶⌈{•›m⎄⎊z⧢⇄!⍰⎊⁜∩ᐵ²▲⌽6B{≊YT★δø%ƶyγ⑴c⦷Nᐵ“ # push compressed integer 68334897735830805988511475713772848869837897556449999540327873023105767056987364683977755467775740
# the binary representation of that integer is half of the bat, with 1 as spaces and 0 as an asterisk
Ꮬ* # literal string "* "
⊢ #base conversion
13÷ # split in 13 pieces
⨪ # palindromize
” # join on newlines
💎
Created with the help of Luminespire.
<script type="vyxal3">
"=∥[¶⌈{•›m⎄⎊z⧢⇄!⍰⎊⁜∩ᐵ²▲⌽6B{≊YT★δø%ƶyγ⑴c⦷Nᐵ“Ꮬ* ⊢13÷⨪”¶p
##¶p is to prepend a newline for prettier display
</script>
<script>
args=[]
</script>
<script src="https://themoonisacheese.github.io/snippeterpreter/snippet.js" type="module"/>
Raku (Perl 6) (rakudo), 200 bytes
for <1R4ZLSSG 1GM7XAF0G 5UGR339I8 OJXYV5I48 1DSFVMN18C 2RRVTHNXTQ 5JJRMZBVNJ 5JJRMZBVNJ 5JJRMZBVNJ 2RRVTHNXTQ 1CC99CDVGC BP484HD68 165BQM6PS> {print $_>0??"*"!!" "for :36($_).base(2).flip.comb;say ""}
Zsh +coreutils, 164 bytes
code formatted slightly for readability
basenc -d --z85<<<'01Ybg1onC>0TF?+0Pj1R06ywM0r8%uGz>(JFiS8]%nSc0}#uY@%nSc0%nSc0%nS
c0%nSbl%nSc0%bRZg%m^aQ&5D9z4/^BL90=@M'|basenc --base2msbf -w49|head -13|tr 01 ' *'
Similar to my Arecibo answer; I first encoded the bat logo into binary then converted to z85. This yielded a string of length 101. The script then decodes the z85-encoded string and turns 1,0 into *, (space).
Tcl, 325 317 303 302 300 299 bytes
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*"
Acc!!, 213 bytes
Count i while i-13 {
51397972070007971908114644954640006735062249040965047432312218527997252394168473615313186269956096/2^(25*i)%2^25
Count j while j-49 {
Write 32+(_/2^j+_/2^(48-j)*0^0^(j-24)^2)%2*10
}
Write 10
}
Explanation
Count i while i-13 { # For each line:
# Encodes the left half of the Batman symbol, including the center strip.
# Each character is 1 bit (32/' ' = 0, 42/'*' = 1)
# Bit 0 is line 0 char 0, bit 1 is line 0 char 1, bit 48 is line 0 char 48, bit 49 is line 1 char 0, etc.
51397972070007971908114644954640006735062249040965047432312218527997252394168473615313186269956096 / 2^(25*i) % 2^25
Count j while j-49 { # For each character:
# 32 + 10 * bit
# Bit j for 0<=j<=24 and 48-j for 25<=j<=48
# At j=24 both expressions will grab a bit, so the 48-j expression is thrown out when j=24.
Write 32 + (_/2^j + _/2^(48-j)*0^0^(j-24)^2)%2*10
}
Write 10
}
Clojure, 833 437 342 332 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 p[](loop[l[[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]]](loop[a(first l)c " "](print(apply str(repeat(first a)c)))(if(>(count a)1)(recur(rest a)(if(= c " ")"*" " "))(println)))(if(>(count l)1)(recur(rest l)))))
Un-golfed version:
(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]] ]
; (print-bat-signal-line (first lines))
(loop [ aLine (first lines)
c " " ]
(print (apply str (repeat (first aLine) c)))
(if (> (count aLine) 1)
(recur (rest aLine) (if (= c " ") "*" " "))
(println)))
(if (> (count lines) 1)
(recur (rest lines)))))
RIP Adam West. No matter how ridiculous those shows were, those of us who were kids salute you.
Duocentehexaquinquagesimal, 523 139 bytes
IŸcÓ|»lì8тï₃"—"šÙ‹çnFÙ}Xíâµ∞A!pβòΩž>qLqÖlŒηεÅBO&ô-}ܘāńŢÚā´ÏΛ¯—¨ïAÚ∞·ÏƵŸ9ße³āEΔëнj'`Ï×"ë‡LkYмâÿÒAE;ýäÇη¼ÉÊÌg¡θ’A(wBlΣ<–£¼–7₄:*Â3
Åö0δ¬ë
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#47111&$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:
#7gets replaced by+REPLICATE('*',7)$4gets 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:
* *
**** * * ****
**** ******* ****
****** ******* ******
********* ********* *********
***********************************************
*************************************************
*************************************************
*************************************************
***********************************************
***** ********************* *****
**** *** ***** *** *****
** * *** * **
Brainfuck, 369 bytes
+[[->>>+<<<]>+++++++>+++>+]-<-<<<--<-<<<-<<--<<<-<<+<+<<<<---<<++<---<<<<<+<---<+<++<<<+<[->++<]<<<<<++<-----<<[[-]<]+<-<[++<<+<]>[>>>]<<<<+<+<<<+<<<+<<<+<--<[[->+++++>>]<[<<<]>]+<+<+++++<<<+++++<<<+++++<-------<+<++<+++<<[+++<]<++<------<+<<+++<<[+++<]<<----[<+<]<+[----<]<---<+<<<--<+<+[-<+++>]+<+<<---<++<++++++++[-<+<++++<++++>>>]<--<+>>+[-[-<.>]<<<[->>>+<<<]>>>>+]
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.
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])
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.
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''
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:
- Concatenate all emblem lines to one string
- Count spaces and asterisks
- Encode length of each segment + 42 as a char
Decoding (this script):
- Get code of the char minus 42 for each char from the cripto-string. This is a length of a segment
- Append segment, consisting of a space or asterisk repeated
Lengthtimes - Insert new line each 49 symbols to split lines
Some smart things
- 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
½tos*t(73 asterisks, 0 spaces, 74 asterisks). - I cut off right spaces in the last line to save 1 byte. Sorry, Batman.
- 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''
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.
Stax, 43 bytes
¬H∙☼ßú¶ε╥M9rx⌠ªÅ`Fm■♦▓dL∩BF╚3♣æ7~εåIZ▼•sÿ4ú
It's just the left-half, run-length encoded and then mirrored.
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;}
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
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.
I would have hoped that something more fun than the naive solution would have been shorter.
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_$$$>>:#,_$:#^
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.

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)
Charcoal, 69 54 52 48 bytes
E⪪”|↖y{{﹪yc›on↗π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?) and a further 4 bytes by using the alphabet for the run length encoding. Saved a further 2 bytes because ⸿ character,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);
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.....
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;}
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.
MATL, 61 59 bytes
' *'60:'*u9|K9j[~F9R,>ejc4Q,7;F\1l_=7sFR'F11:ZaY"13e)25ZvZ)
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
1to11, so the sequence of run lengths is compressed by base conversion, from base11to base94(printable ASCII chars except single quote, which would need escaping).
Self-modifying Brainfuck, 700 bytes
<<...........>.<.........................>.<<.>.......>....<..........>.<.....>.<..........>....<<.>.....>....<............>.......<............>....<<.>...>......<............>.......<............>......<<.>..>.........<.........>.........<.........>.........<<.>.>...............................................<<.>>.................................................<<.>>.................................................<<.>>.................................................<<.>.>...............................................<<.>..>.....<.......>.....................<.......>.....<<.>....>....<.......>...<....>.....<....>...<.......>....<<.>.......>..<.......>.<......>...<......>.<.......>..
*
Yes. This can probably be golfed. Do I want to though? Oh please no.
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
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>
CJam, 78 bytes
"@ÇÏßÿÿÿÿÿÿÿÿÿÿÿÿýÿÿóÿ"{8{_2U#&'*S?\}fU;}/]25/{_24/~;W%N}%
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
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;}
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;}
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.
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, '*'));
});
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
}
}
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.
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
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)
)
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];}
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
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]}}
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.
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)
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 => print32(space)z- zero => print42(asterisk)q- prime => print10(newline)
The second byte of each pair is the number of times to print.
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();
}
}
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 \ \*
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 \ \*
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.
///, 171 166 bytes
5 bytes saved because I was using \r\n in the source, lol.
/-/ //,/!!//'/**//&/*"//%/--//#/,,,,,!*//"/%-//!/''/"% &""" *
" !"%*% &%!
% !""!'&"!
- !*&"!'&"!'
-,&- ,&- ,*
#'
!#
!#
!#
#'
-!& ,,!& !*
%!" '*%!*%'& !
" *& &'&& '
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:
- I could get away with using some meta replacements (e.g. dynamically insert regexes)
- It is somehow more beneficial to replace less economical substrings first (unlikely).
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])
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[#*][# ][#*][# ][#*]"
"[#*][# ]#*..# ...[#*]# ...#*..[# ][#*]#
[# ]#*.[# ]#*[# ]#*..[# ]#*[# ]#*.&@
Braingolf is not good at ASCII art, but dammit I tried.
No way in hell am I explaining this clusterf**k
PHP, 137 bytes
<?=gzinflate(base64_decode(U1CAAy0FXECLC8YAAnQNyAJAwIVFIYSPRYgLLkWEYrByLS10WTwiXAgmcYCLRPV00kGyN6BhgB4eyABZjgstyqAsuDpU5YjEgJIOEKoQigE));
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";
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," *");
Jelly, 44 bytes
“¡©İ'¹!ðkW>ṅṙẏṙlœf:ߌÆ@Ƥ’b25o99Jx$ị⁾ *s25ŒBY
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.
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]}
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]
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.
V, 102 bytes
i±³ *±±
³ *± ´*·
´*±² ´*µ
´*±² ¶*³
µ*¹ ¹*
²´* Ä3o²µ*jo±±*· µ*
³*´ ³*· ´*´
**¶ *· **· Îæ$vp
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.
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>
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......