65
\$\begingroup\$

The challenge: output this exact ASCII art of a spiderweb in a window:

 _______________________________
|\_____________________________/|
||    \         |         /    ||
||     \       /|\       /     ||
||     /\'.__.' : '.__.'/\     ||
|| __.'  \      |      /  '.__ ||
||'.     /\'---':'---'/\     .'||
||\ '. /'  \__ _|_ __/  '\ .' /||
|| |  /.   /\ ' : ' /\   .\  | ||
|| |  | './  \ _|_ /  \.' |  | ||
||/ '/.  /'. // : \\ .'\  .\' \||
||__/___/___/_\(+)/_\___\___\__||
||  \   \   \ /(O)\ /   /   /  ||
||\ .\'  \.' \\_:_// './  '/. /||
|| |  | .'\  /  |  \  /'. |  | ||
|| |  \'   \/_._:_._\/   '/  | ||
||/ .' \   /    |    \   / '. \||
||.'_   '\/.---.:.---.\/'   _'.||
||   '.  / __   |   __ \  .'   ||
||     \/.'  '. : .'  '.\/     ||
||     /       \|/       \     ||
||____/_________|_________\____||
|/_____________________________\|

Source: Joan Stark (slightly modified spider and frame, and remove the initials for the sake of the challenge).

Required characters: _|\/'.:-(+)O (12) + space & new-line (2)

Challenge rules:

  • One or multiple trailing spaces and/or new-lines are allowed.

General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
  • Default Loopholes are forbidden.
  • If possible, please add a link with a test for your code.
  • Also, please add an explanation if necessary.
\$\endgroup\$
  • 25
    \$\begingroup\$ Should've saved this one for Halloween. \$\endgroup\$ – steenbergh Jun 20 '17 at 8:19
  • 2
    \$\begingroup\$ @steenbergh Hmm, you're indeed right! Ah well, I'll think of something new by that time. :) \$\endgroup\$ – Kevin Cruijssen Jun 20 '17 at 8:20
  • 3
    \$\begingroup\$ There is a . 7 characters before the O. Is there supposed to be one 7 characters after too? \$\endgroup\$ – Neil Jun 20 '17 at 8:42
  • 7
    \$\begingroup\$ What are you quoting in the title? \$\endgroup\$ – lazarusL Jun 20 '17 at 21:49
  • 21
    \$\begingroup\$ @lazarusL Not really a direct quote, but Widowmaker from Overwatch: "When I was a girl, I had a fear of spiders. I was told they felt no emotion, that their hearts never beat. But I know the truth. At the moment of the kill, they are never more alive." (Animated short: "Alive") \$\endgroup\$ – Kevin Cruijssen Jun 21 '17 at 7:13

27 Answers 27

29
\$\begingroup\$

SOGL V0.12, 141 bytes

↑υΒΦøAo┼Λ■MšH⅛ K∞ΠΘK2╬{t÷ωÆ↓p║9<¤ΓuΞ∫⅛Χxc<Π³‼čΝ═ūψ°ņR⁷|└η▒°Mψ{√ΥΜ┌>½Ψ¹iš℮ē@‰‚ηΨ▓+⁰ρ→ƨ┘ο\β¶⁹ξA6‘'²nΓ:A⌡≥¹↕Ζ,'ŗa;+"⁴ø'½ø' Æ ⁄Æ    ø'⁄ø'Æ∑O’3n{_ζž

Explanation:

...‘                             push a quarter of the drawing
    '²n                          split into an array of items of length 17
       Γ                         palendromize horizontally, with overlap of 1
        :A                       save a copy of that on `A`
          ⌡≥¹                    reverse items in the array (for each item put it at the stacks bottom, then wrap in array)
             ↕                   vertically mirror chars (it tries its best but still has bugs)
              Ζ,'ŗ               replace ","s with "'"s (one of the bugs)
                  a              push the variable A
                   ;+            reverse add
                     "..’        push a list of codepage characters
                         3n{     for each group of 3 do
                            _      put all the arrays contents on the stack
                             ζ     convert the last from number to its codepage character
                              ž    replace [at X 1st number, Y 2nd number, with the 3rd number converted to character]

Try it Here! (the program contains tabs so here is a better program representation)

\$\endgroup\$
  • 28
    \$\begingroup\$ "it tries its best but still has bugs" surely having bugs on hand is useful when attempting to wrangle a spider \$\endgroup\$ – Bear Jun 20 '17 at 14:23
  • 8
    \$\begingroup\$ @Bear having bugs on window would be useful... on hand, not so much. \$\endgroup\$ – user253751 Jun 21 '17 at 1:33
58
\$\begingroup\$

Arnold C, 1257 1261 1256 1233 bytes

IT'S SHOWTIME
TALK TO THE HAND" _______________________________"
TALK TO THE HAND"|\_____________________________/|"
TALK TO THE HAND"||    \         |         /    ||"
TALK TO THE HAND"||     \       /|\       /     ||"
TALK TO THE HAND"||     /\'.__.' : '.__.'/\     ||"
TALK TO THE HAND"|| __.'  \      |      /  '.__ ||"
TALK TO THE HAND"||'.     /\'---':'---'/\     .'||"
TALK TO THE HAND"||\ '. /'  \__ _|_ __/  '\ .' /||"
TALK TO THE HAND"|| |  /.   /\ ' : ' /\   .\  | ||"
TALK TO THE HAND"|| |  | './  \ _|_ /  \.' |  | ||"
TALK TO THE HAND"||/ '/.  /'. // : \\ .'\  .\' \||"
TALK TO THE HAND"||__/___/___/_\(+)/_\___\___\__||"
TALK TO THE HAND"||  \   \   \ /(O)\ /   /   /  ||"
TALK TO THE HAND"||\ .\'  \.' \\_:_// './  '/. /||"
TALK TO THE HAND"|| |  | .'\  /  |  \  /'. |  | ||"
TALK TO THE HAND"|| |  \'   \/_._:_._\/   '/  | ||"
TALK TO THE HAND"||/ .' \   /    |    \   / '. \||"
TALK TO THE HAND"||.'_   '\/.---.:.---.\/'   _'.||"
TALK TO THE HAND"||   '.  / __   |   __ \  .'   ||"
TALK TO THE HAND"||     \/.'  '. : .'  '.\/     ||"
TALK TO THE HAND"||     /       \|/       \     ||"
TALK TO THE HAND"||____/_________|_________\____||"
TALK TO THE HAND"|/_____________________________\|"
YOU HAVE BEEN TERMINATED

This is my first try programming in the supreme language, so I'll eat my downvotes as I offer no intelligent solution to this problem although programming in the language descended from the heavens.

Here's a compiler if anyone by any chance questions this algorithm.

Stick around.

\$\endgroup\$
  • 13
    \$\begingroup\$ Hey Arnold, you got a spider on your hand! \$\endgroup\$ – Olivier Grégoire Jun 20 '17 at 14:52
  • 9
    \$\begingroup\$ Stop whining! - Arnold \$\endgroup\$ – bearacuda13 Jun 20 '17 at 15:19
  • 13
    \$\begingroup\$ If more golf players had this sense of humor, I'd watch the game more often. \$\endgroup\$ – can-ned_food Jun 21 '17 at 5:51
  • 3
    \$\begingroup\$ Can you golf a byte by removing the empty line? The compiler stopped whining when I did so. \$\endgroup\$ – Olivier Grégoire Jun 21 '17 at 6:44
  • 15
    \$\begingroup\$ 54 upvotes for an answer that makes no attempt at golfing? shakes head You could save 23 bytes just by removing all the spaces after TALK TO THE HAND! \$\endgroup\$ – Shaggy Jun 23 '17 at 9:11
24
\$\begingroup\$

vim, 373 371 bytes

A ________________
|\_______________
||    \         |
||     \       /|
||     /\'.__.' :
|| __.'  \      |
||'.     /\'---':
||\ '. /'  \__ _|
|| |  /.   /\ ' :
|| |  | './  \ _|
||/ '/.  /'. // :
||__/___/___/_\(+<ESC>:2,12y
Gp
:13,$g/^/m12
:17
8lr jr.ggqayyp!!rev
!!tr '\\/(' '/\\)'
kgJxjq23@a
:13,$!tr "\\\\/.'+" "/\\\\'.O"
qa/_
r ka
<ESC>k:s/ $/_/e
gJjhq33@aGk:s/ /_/g
gg$x

<ESC> is a standin for 0x1B.

Ungolfed

" First quadrant
A ________________
|\_______________
||    \         |
||     \       /|
||     /\'.__.' :
|| __.'  \      |
||'.     /\'---':
||\ '. /'  \__ _|
|| |  /.   /\ ' :
|| |  | './  \ _|
||/ '/.  /'. // :
||__/___/___/_\(+<ESC> 

" Copy to lower half, reverse lines, substitute characters
:2,12y
Gp
:,$g/^/m12

" Non-symmetric part
:17
8lr jr.

" copy left side to right and reverse
ggqayyp!!rev
!!tr '\\/(' '/\\)'
kgJxjq
23@a

" swap characters on the bottom half
:13,$!tr "\\\\/.'+" "/\\\\'.O"

" shift underscores up one line wherever an empty space is available
qa/_
r ka
<ESC>k:s/ $/_/e
gJjhq
33@a

" misc
Gk:s/ /_/g
gg$x

Try it online!

And to clarify the explanation you were given as a child: While it's true that the only emotion spiders feel personally is hatred, they are capable of sensing fear at a distance of over 50 meters.

\$\endgroup\$
  • \$\begingroup\$ Can't you base64 vim's inputs? :D \$\endgroup\$ – YSC Jun 21 '17 at 9:45
  • \$\begingroup\$ @YSC I'm concerned that the base64 encoded version might be less readable. :-) \$\endgroup\$ – Ray Jun 21 '17 at 21:38
  • \$\begingroup\$ I get that I need to hit <kbd>Enter</kbd> where it says <CR> but do lines ending with <CR> mean hit the key twice? Answer seems to be no in the two instances above, but then, lines with s/ /_/g and tr don't end with <CR> but I can't get it to work without hitting Enter. \$\endgroup\$ – antak Jun 23 '17 at 4:18
  • \$\begingroup\$ @antak The double <CR>s were a mistake, and line feed also works. (I'd entered the lines using <C-v><ENTER>, which generates <CR>; that's why it shows up as ^M instead of a newline.) I've modified the code to eliminate those two duplicates and replace the carriage returns with normal newlines/line feeds. All remaining newlines must be entered precisely once. (The ungolfed version still has a few extra blank lines; those do not correspond to actual keypresses. The golfed version is exactly what needs to be typed, except for the <ESC>s.) \$\endgroup\$ – Ray Jun 23 '17 at 8:49
  • 1
    \$\begingroup\$ @Jakob If you put those bytes into a file and redirect the input to vim, the result will be a buffer containing the target text. In practice, this will be tested via { cat foo.vim; echo ':wq'; } | vim a.txt so you aren't stuck in vim with no keyboard attached to stdin. The advantage is that I can actually run the program directly from a file instead of attempting to type it exactly each time I make a change. For this program, bytes and keystrokes are equivalent, but that isn't always the case. e.g. <C-v><ENTER> is three keystrokes, but produces one byte, \r. \$\endgroup\$ – Ray Sep 30 '17 at 18:40
17
\$\begingroup\$

Jelly,  206  205 bytes

“¢ṙgḤi¹z,:ṃ,açØẹȷE€İ%ĿœHFḢ®QṀẠṠṄ⁻Ṃç|ɠḌɱỌ⁴¦EṇÐ0tḊhƇtƬ©2:⁶ṂƊḄÞḌḶh_ịÑḶụ ɼh ⁵¶Ẏ=ɗuȯuṙæg⁹-©ɲdʠẹḶrU[ȦƁƊ@ȮLQ+İøA¶ȷØḤ©<ṿŀUrçȦ£ḞRzµ¢°ỊnçṄI¤`Ẉ⁾ẠaIkXṫ_Ẹ²ʋfƬ@²*#`cẓʋ⁷\"s’b9+“ṖṘṇọ‘¦3ị“ |\/'.:-(+O_”s17µŒBy@€“(\/“)/\”a⁸Y

A niladic link returning a list of characters, or a full program printing the art.

Try it online!

Could the rough-vertical symmetry be utilised?

How?

The first 158 bytes are a very large number written in bijective base 250 using the first 250 bytes of Jelly's code-page:

“¢ṙgḤi¹z,:ṃ,açØẹȷE€İ%ĿœHFḢ®QṀẠṠṄ⁻Ṃç|ɠḌɱỌ⁴¦EṇÐ0tḊhƇtƬ©2:⁶ṂƊḄÞḌḶh_ịÑḶụ ɼh ⁵¶Ẏ=ɗuȯuṙæg⁹-©ɲdʠẹḶrU[ȦƁƊ@ȮLQ+İøA¶ȷØḤ©<ṿŀUrçȦ£ḞRzµ¢°ỊnçṄI¤`Ẉ⁾ẠaIkXṫ_Ẹ²ʋfƬ@²*#`cẓʋ⁷\"s’

This number (of the order of 10372 is converted to a list of its digits in base-9 (391 numbers between 0 and 8) and then three is added to the 203rd, 204th, 220th, and 221st digits (which will be the spiders body):

“ ... ’b9+“ṖṘṇọ‘¦3
“ ... ’            - that huge number
       b9          - converted to a list of digits of it's base-9 representation
                ¦  - sparse application at indexes:
          “ṖṘṇọ‘   - ... code-page indexes = [203,204,220,221]
         +       3 -     add three

The result is then converted to the 12 characters of the left-hand side (up to and including the middle column) of the art:

... ị“ |\/'.:-(+O_”s17
...                    - the previous code
     “ |\/'.:-(+O_”    - the characters used in the left-hand side = " |\/'.:-(+O_"
    ị                  - index into
                       - ... note: adding three to the 6s, 7 and 8 makes the spider's body
                       -     from what would otherwise have been a collection of
                       -     the characters ".:-". Also note 0s become '_'s.
                   s17 - split into chunks of length 17 (separate the rows)

The full rows are then constructed by bouncing each left-hand side row (that is reflecting it as if its last character were a mirror), changing all the ( to ), the \ to / and the / to \, and then only using the new values on the right-hand side by using a vectorised and with the left-side from before. The result is finally joined up with newlines to create the art:

... µŒBy@€“(\/“)/\”a⁸Y
...                    - the previous code
    µ                  - monadic chain separation - call the result L
     ŒB                - bounce each row of L
          “(\/“)/\”    - list of lists of characters: [['(','\','/'],[')','/','\']]
       y@€             - for €ach (row) translate (with swapped @rguments)
                       - ... replaces '(' with ')', '\' with '/' and '/' with '\'
                    ⁸  - chain's left argument, L
                   a   - logical and (vectorises) with L
                       - ... use characters from L if we have them, else the new ones.
                     Y - join with newlines
                       - if running as a full program: implicit print
\$\endgroup\$
  • \$\begingroup\$ I never seen such long Jelly code. ;_; wew \$\endgroup\$ – RedClover Oct 2 '17 at 16:19
11
\$\begingroup\$

Charcoal, 239 238 bytes

UR¹⁶¦²²P×_¹⁶↘¹”“1T↘H‖⌕⦄Q⌈⌀MH⁷鱫cJε⎚#÷‖↧⸿ÿ_M±Gςθx↥<]˜t~⁻?T\`⪫F№⮌ξv‹⎇αδ¹9∨q¢←6X$⪫SA‹¤ü‖§D‹v⁸)⮌s?ANHτ!‰ZNσE⟲—>£'αlT↙№%Mü‴⟲@ιRQ$⟧.ηψf◧4\™¬‴χe@“σXN±I%T↧~w—A⁵6ζ▶‴À$“UX0⁰Ÿβ˜¤c⁷DFQm→>H⟧∨^‹α~ok∨A1ψς9œ⁸}'¶$β”P×_¹⁴M↓P×_¹⁵←_/↑²² P×_¹⁶M⁵¦²P↘⁸M¹⁹↓↗⁸‖B

Try it online! Link is to verbose version of code. Most of this is simply printing a large compressed string, but the repetitive parts have been coded separately to reduce the length of the string; in particular the Rectangle saves a number of bytes by avoiding the space padding to reach the 17th column and even the diagonal lines save a byte each.

Rectangle(16, 22);          For the |s in the 2nd and 17th columns
Multiprint(Times("_", 16)); Overwrite the 2nd row with _s
Print(:DownRight, 1);       Print the \ in row 2, column 2
Print(<compressed string>); Print the bulk of the web
Multiprint(Times("_" 14))   Print the _s in the penultimate row
Move(:Down);
Multiprint(Times("_" 15));  Overwrite the bottom row with _s
Print(:Left, "_/");         Print the / in the bottom row
Print(:Up, 22);             Print the |s in the 1st column
Print(" ");
Multiprint(Times("_" 16));  Print the `_`s in the 1st row
Jump(5, 2);
Multiprint(:DownRight, 8);  Print a long diagonal line
Move(19 :Down);
Print(:UpRight, 8);         Print the other long diagonal line
ReflectButterfly();         Mirror the first 16 columns (17th is axis)

Edit: Charcoal no longer seems to recognise the compressed string, and its current compression generates a shorter string which saves 51 bytes, and allows one of the diagonals lines to be moved back into the string for a further 2-byte saving. (Note that these aren't the counts displayed by -sl; indeed even the original count appears to have been off by 1.) However there are three additional savings that would also have applied to the original code: Try it online!

  • 1 byte by using (Box) instead of UR(Rectangle).
  • 1 byte by using ↙P×_¹⁶←/ instead of ↓P×_¹⁵←_/.
  • 1 byte by using ×_¹⁶J⁵¦¹ instead of P×_¹⁶M⁵¦².
\$\endgroup\$
10
\$\begingroup\$

PHP, 380 bytes

<?=gzinflate(base64_decode("fZLNrQMxCITvqYIbiZ4W7ttEGhiJRij+MfgnGyWKJSx2Pf4GY0v8HrfEz3XPW6bUgKyRO/P+XIot8cRVcFE41CJM5ZSROC6KXlmU3AQqh0JtUY7j0LPnSTBtBUotTkrtiawIElDrVVa7FNitKdJ1SBMMtNyKLI6zFjKY1P7cChclwunlxQD5IEQFrSjbWIH736PmymfMfkBW+P35QDdrxjwLeW0NxBll1UXR2y+VtrV3xzCKyrezECLwsGJYgBbql7OQvy9z3SO95llMg1vgVv22s2ewxxJq6255NV7dnoxK2A99fx/OH6U8ZST4eB/z3SB39lLE7OgYubN+wFS8Fr8N5D8="));

Try it online!

PHP, 494 bytes

<?=strtr(" 33311
|43331/|
||554222|222/550254255/|4255/25025/4817 : 817/4250 175422|22/581 0825/\'6':'6'/425704 8 /'541 _|_ 1/5'4 7 /0 |5/.2/4 ' : ' /42.45| 0 |5| 8/54 _|_ /547 |5| 0/ '/.5/8 // : 44 745.4' 401/1_/1_/_4(+)/_41_41_410542424 /(O)4 /2/2/504 .4'547 44_:_// 8/5'/. /0 |5| 745/5|545/8 |5| 0 |54'24/_._:_._4/2'/5| 0/ 7 42/55|5542/ 8 407_2'4/.6.:.6.4/'2_'.02'.5/ 12|21 45720254/758 : 7584/25025/2554|/255425011/3|3411||
|/3331\|",["||
||",__,"   ",_________,"\\","  ","---",".'","'."]);

Try it online!

\$\endgroup\$
9
\$\begingroup\$

brainfuck, 4086 bytes

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

Try it online!

This is just a hunt-and-pick method of generating the string.

Added newlines for more readability:

-[+>++[++<]>]>-[->+>+<<]>>--------------------------------------[->+>+<<]>>++[->+>+<<]>>
---[->+>+<<]>>+++++[->+>+<<]>>+++++++++++++[->+>+<<]>>------------[->+>+<<]>>-------[->+
>+<<]>>++++++++[->+>+<<]>>+++++++++++++++++++++++++++++++++++++++++++++[->+>+<<]>>++++++
++++++++++++++++++++++++++[->+>+<<]>>---------------------------------------------------
---------------------------------------------------------------[->+>+<<]>>++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[->+>+<<]>>------
---------------------------------------------------------.<.............................
..<<.<<.<<.>>>>>>.............................<<<<<<<<.>>>>.>>.<<..>>>>>....<<<<<<<.>>>>
>>>.........<<<<<.>>>>>.........<<<<<<<<<.>>>>>>>>>....<<<<<..>>.<<..>>>>>.....<<<<<<<.>
>>>>>>.......<<<<<<<<<.>>>>.<<.>>>>>>>.......<<<<<<<<<.>>>>>>>>>.....<<<<<..>>.<<..>>>>>
.....<<<<<<<<<.>>.<<<<.<<.>>>>>>>>>>>>..<<<<<<<<<<<<.>>.>>>>>>>>>>>.<<<<<<<<<<<<<<<.>>>>
>>>>>>>>>>>.<<<<<<<<<<<.<<.>>>>>>>>>>>>..<<<<<<<<<<<<.>>.>>.>>.>>>>>>>.....<<<<<..>>.<<.
.>>>>>.<..<<<<<<<<<<<<.>>.>>>>>>>>>>>..<<<<<<<.>>>>>>>......<<<<<.>>>>>......<<<<<<<<<.>
>>>>>>>>..<<<<<<<<<<<.<<.>>>>>>>>>>>>..>.<<<<<..>>.<<..<<<<<<.<<.>>>>>>>>>>>>>.....<<<<<
<<<<.>>.<<<<.<<<<<<...>>>>>>.<<<<.>>>>.<<<<<<...>>>>>>.>>.>>.>>>>>>>.....<<<<<<<<<<<<<.>
>.>>>>>>..>>.<<..<<.>>>>>>>.<<<<<<<<<<<.<<.>>>>>>>>>>>>>.<<<<<<<<<.<<.>>>>>>>>>>>..<<<<<
<<.>>>>>>..>.<.<<<<.>>>>.>.<..<<<<<<<<.>>>>>>>>>..<<<<<<<<<<<.>>>>.>>>>>>>.<<<<<<<<<<<<<
.>>.>>>>>>>>>>>.<<<<<<<<<.>>>>..>>.<<..>>>>>.<<<<<.>>>>>..<<<<<<<<<.<<<<.>>>>>>>>>>>>>..
.<<<<<<<<<.>>.>>>>>>>.<<<<<<<<<<<.>>>>>>>>>>>.<<<<<<<<<<<<<<<.>>>>>>>>>>>>>>>.<<<<<<<<<<
<.>>>>>>>>>>>.<<<<<<<<<.>>.>>>>>>>...<<<<<<<<<<<<<.>>>>>>.>>>>>>>..<<<<<.>>>>>.<<<<<..>>
.<<..>>>>>.<<<<<.>>>>>..<<<<<.>>>>>.<<<<<<<<<<<.<<.>>>>.>>>>>>>>>..<<<<<<<.>>>>>>>.<.<<<
<.>>>>.>.<<<<<<<<<.>>>>>>>>>..<<<<<<<.<<<<<<.>>.>>>>>>>>>>>.<<<<<.>>>>>..<<<<<.>>>>>.<<<
<<..>>.<<..<<<<.>>>>>>>>>.<<<<<<<<<<<.>>.<<<<.>>>>>>>>>>>>>..<<<<<<<<<.<<.<<.>>>>>>>>>>>
>>.<<<<<<<<<..>>>>>>>>>.<<<<<<<<<<<<<<<.>>>>>>>>>>>>>>>.<<<<<<<..>>>>>>>.<<<<<<<<<<<<<.>
>.>>>>.>>>>>>>..<<<<<<<<<<<<<.>>>>>>.<<<<.>>>>>>>>>>>.<<<<<<<.>>..>>.<<..>>>>..<<<<<<<<.
>>>>>>>>...<<<<<<<<.>>>>>>>>...<<<<<<<<.>>>>>>>>.<<<<<<.<<<<<<<<<<<<.<<.<<.>>>>>>>>>>>>>
>.>>>>>>>>.<<<<<<.>>>>>>...<<<<<<.>>>>>>...<<<<<<.>>>>>>..<<<<..>>.<<..>>>>>..<<<<<<<.>>
>>>>>...<<<<<<<.>>>>>>>...<<<<<<<.>>>>>>>.<<<<<<<<<.<<<<<<<<<<.<<<<<<.>>.>>>>>>>>>>>>>>>
>.>>>>>>>.<<<<<<<<<.>>>>>>>>>...<<<<<<<<<.>>>>>>>>>...<<<<<<<<<.>>>>>>>>>..<<<<<..>>.<<.
.<<.>>>>>>>.<<<<<<<<<<<<<.>>>>>>.<<<<.>>>>>>>>>>>..<<<<<<<.<<<<<<.>>.>>>>>>>>>>>.<<<<<<<
..>>>>>>.<<<<<<<<<<<<<<.>>>>>>>>>>>>>>.<<<<<<<<..>>>>>>>>>.<<<<<<<<<<<.<<.>>>>.>>>>>>>>>
..<<<<<<<<<<<.>>.<<<<.>>>>>>>>>>>>>.<<<<<<<<<.>>>>..>>.<<..>>>>>.<<<<<.>>>>>..<<<<<.>>>>
>.<<<<<<<<<<<<<.>>.>>>>.>>>>>>>..<<<<<<<<<.>>>>>>>>>..<<<<<.>>>>>..<<<<<<<.>>>>>>>..<<<<
<<<<<.<<.<<.>>>>>>>>>>>>>.<<<<<.>>>>>..<<<<<.>>>>>.<<<<<..>>.<<..>>>>>.<<<<<.>>>>>..<<<<
<<<.<<<<.>>>>>>>>>>>...<<<<<<<.<<.>>>>>>>>.<<<<<<<<<<<<.>>>>>>>>>>>>.<<<<<<<<<<<<<<.>>>>
>>>>>>>>>>.<<<<<<<<<<<<.>>>>>>>>>>>>.<<<<<<.<<.>>>>>>>>>...<<<<<<<<<<<.>>.>>>>>>>>>..<<<
<<.>>>>>.<<<<<..>>.<<..<<<<.>>>>>>>>>.<<<<<<<<<<<<<.>>.>>>>>>>>>>>.<<<<<<<.>>>>>>>...<<<
<<<<<<.>>>>>>>>>....<<<<<.>>>>>....<<<<<<<.>>>>>>>...<<<<<<<<<.>>>>>>>>>.<<<<<<<<<<<.<<.
>>>>>>>>>>>>>.<<<<<<<.>>..>>.<<..<<<<<<<<.>>.>>>>>>>>>>.>...<<<<<<<<<<<.>>>>.<<.<<<<.<<<
<...>>>>.<<.>>.<<<<...>>>>.>>>>>>.<<.<<.>>>>>>>>>>>...<.<<<<<<<<<<.<<.>>>>>>>>..>>.<<..>
>>>>...<<<<<<<<<<<.<<.>>>>>>>>>>>>>..<<<<<<<<<.>>>>>>>>>.<..>...<<<<<.>>>>>...<..>.<<<<<
<<.>>>>>>>..<<<<<<<<<<<<<.>>.>>>>>>>>>>>...<<<<<..>>.<<..>>>>>.....<<<<<<<.<<.<<<<.>>.>>
>>>>>>>>>..<<<<<<<<<<<.<<.>>>>>>>>>>>>>.<<<<<<<<<<<<<<<.>>>>>>>>>>>>>>>.<<<<<<<<<<<<<.>>
.>>>>>>>>>>>..<<<<<<<<<<<.<<.>>>>>>.<<.>>>>>>>>>.....<<<<<..>>.<<..>>>>>.....<<<<<<<<<.>
>>>>>>>>.......<<<<<<<.>>.<<<<.>>>>>>>>>.......<<<<<<<.>>>>>>>.....<<<<<..>>.<<..>>>>...
.<<<<<<<<.>>>>>>>>.........<<<<.>>>>.........<<<<<<.>>>>>>....<<<<..>>.<<.<<<<.>>>>>>>>.
............................<<<<<<.>>.
\$\endgroup\$
  • 1
    \$\begingroup\$ Any particular reason why you have, e.g. --------------------------------------------------------------- instead of something like >++++++++[-<-------->]<+? \$\endgroup\$ – Ray Jun 22 '17 at 21:14
  • \$\begingroup\$ @Ray I tried to use as little cells as possible to minimize the number of >s and <s would appear later on in the code. I don't know how many (if any) bytes my approach saves. I'll look into using more cells. \$\endgroup\$ – Conor O'Brien Jun 22 '17 at 21:15
  • 1
    \$\begingroup\$ You can use as many extra cells as you want during the initialization phase without affecting the >>> sequences later on, since they're just used as temporary space for the factorizations. In particular, if you fill the cells left-to-right, you can use, e.g. cell 5 as temporary space for setting up cell 4, and then (since cell 5 is zeroed in the process of setting cell 4), store a new value in cell 5 while using cell 6 as temporary space. As long as the final values of the cells are unchanged, you can alter anything prior to the first . without needing to modify the later code. \$\endgroup\$ – Ray Jun 22 '17 at 21:22
  • \$\begingroup\$ @Ray Good point, I'll look into that. \$\endgroup\$ – Conor O'Brien Jun 22 '17 at 21:33
  • \$\begingroup\$ Dang, you beat mine :) \$\endgroup\$ – Graviton Jun 23 '17 at 19:45
8
\$\begingroup\$

JavaScript (ES6), 471 bytes

Packed with an ES6 variant of RegPack.

let f =

_=>[..."ghijklmnopqrstuvwxyz{}~"].reduce((p,c)=>(l=p.split(c)).join(l.pop()),` mx
|zm/gq~r~wq~ws~{wrw/|rw/w{w/zvxuovxu/zw{ xu~r~~q~~svx {vw/z'n':'n'/zwu{pvj'~zx _|_ xs'puj{ q/.y/p'o'jh.r| {tvsp_|_ szut{i'/.~/vj/ozpur.z' z{x/l/l/_z(+)/_zlzlzx{~hhp/(O)p/y/ys{p.z'~zu zz_:_/ivs'/.j{tursqr/vt{ qz'yk_._:_._ky's| {iu hs~q~hiv z{u_y'k.n.:.n.k'y_v{yv~ixy|yx ruy{wku~vou~vkw{wswz|swzw{xx/}|}zxx|g/mz|y }xxxl{|g|z\\y~ l_w~yv'.u.'t q| s/~rz~q|~pz o : n---m}}}xlx_kz/j /i/ hzyg|
|`)

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

\$\endgroup\$
8
\$\begingroup\$

Java (JDK), 494 bytes

n->{String r="",m="ZZO+():-\n'.\\/_| ";for(int b:"ýaÝøëaÜèîb¿bbïbbÏÿþèîbûbÿüëbÿübþèîbü¹­ÚŸošÝ©ËbþèîýÚŸûbÿïbüÿšÝþèîšbü¹wyiwyËbúžèî¿šüŸûÝýíýÜÿ›úŸÎèîþÿÊÿü¿ŸoŸËÿú¿þþèîþÿïšÏûýíüÿºŸïþþèîÏœ¯üšüÏo»ú›ÿ«Ÿ¾èîÝÍÝÍÝÍ´5ͽݽݽÞèîÿ¿ÿ¿ÿ¿Ä%¿ÏÿÏÿÏþèî¿«Ÿû©û½mÌù¬ÿœ¯Îèîþÿï©¿üÿïûÿɯïþþèîþÿ¹ÿûÍ­m­¼ÿùÏþþèîÏ©ûÿübïÿûÿüù¯¾èî©ßÿ›Êwzjwz¼ŸÿÙ®èîÿù¯üýßÿïÿÝûÿ©ÿþèîbûÊŸù¯o©ÿš¼bþèîbübÿûìbÿûbþèîÝÝÍÝÝÝÝíÝÝÝݽÝÞèìaÛè".replace("a","Ý".repeat(14)).replace("b","ÿÿ").getBytes("cp1252"))r=r+m.charAt(b>>4&15)+m.charAt(b&15);return r;}

Try it online!

Thanks Kevin Cruijssen for golfing a few bytes, plus 6 bytes by changing Windows-1252 to cp1252, and to ASCII-only to compress the string a bit :)

Note: the file must be encoded as Windows-1252 for byte-count, but can safely be copy/pasted in UTF-8 for testing!

The long chain is actually the string, as is, with its characters mapped to a flexible character encoder (for once, I'm happy to use CP-1252). The rest is only the unmapping method.

The mapping was found using a permutation, first initialized to the frequency of each char in the ascii art. Mappings resulting in the characters '"' and '\\' were explicitly discarded to be the shortest valid string as possible.

Ungolfed

unusedVariable -> {
  String r = "",                   // result buffer
         m = "ZZO+():-\n'.\\/_| ", // mapping
    ;
  for (int b :
     "ýaÝøëaÜèîb¿bbïbbÏÿþèîbûbÿüëbÿübþèîbü¹­ÚŸošÝ©ËbþèîýÚŸûbÿïbüÿšÝþèîšbü¹wyiwyËbúžèî¿šüŸûÝýíýÜÿ›úŸÎèîþÿÊÿü¿ŸoŸËÿú¿þþèîþÿïšÏûýíüÿºŸïþþèîÏœ¯üšüÏo»ú›ÿ«Ÿ¾èîÝÍÝÍÝÍ´5ͽݽݽÞèîÿ¿ÿ¿ÿ¿Ä%¿ÏÿÏÿÏþèî¿«Ÿû©û½mÌù¬ÿœ¯Îèîþÿï©¿üÿïûÿɯïþþèîþÿ¹ÿûÍ­m­¼ÿùÏþþèîÏ©ûÿübïÿûÿüù¯¾èî©ßÿ›Êwzjwz¼ŸÿÙ®èîÿù¯üýßÿïÿÝûÿ©ÿþèîbûÊŸù¯o©ÿš¼bþèîbübÿûìbÿûbþèîÝÝÍÝÝÝÝíÝÝÝݽÝÞèìaÛè"
       .getBytes("cp1252")) { // Read bytes from the String, using CP-1252
    r = r                                    // r += doesn't work as expected here
        + m.charAt(b>>4 & 15)                // append first char
        + m.charAt(b & 15)                   // append second char
      ;
  }
  return r;
};

Mapping discovery

public static void main(String[] args) throws Exception {
  String characters = "O+():-\n.'\\/|_ "; // All characters of the web, ordered up by frequency
  PermUtil perm = new PermUtil(characters.toCharArray()); // Tool for a fast permutation of a char[].
  outer:
  for (int p = 0; p < 100000000; p++) {
    String mapping = "ZZ" + new String(perm.next());
    String printableMapping = mapping.replace("\\", "\\\\").replace("\n", "\\n");
    byte[] bytes = new byte[WEB.length() / 2];
    for (int i = 0; i < bytes.length; i++) {
      int b = bytes[i] = (byte) ((mapping.indexOf(WEB.charAt(i * 2)) << 4) + mapping.indexOf(WEB.charAt(i * 2 + 1)));
      b &= 0xff;
      if (b < 0x20                                       // Unmappable CP-1252
          || b==0x81||b==0x8d||b==0x8d||b==0x8d||b==0x8d // Invalid CP-1252
          || b==0x22||b==0x5c) {                         // '"' and '\\'
        continue outer;
      }
    }
    System.out.printf("Mapping = \"%s\"%n", printableMapping);
    System.out.printf("Result  = \"%s\"%n", new String(bytes, "Windows-1252"));
    return;
  }
}
\$\endgroup\$
  • 1
    \$\begingroup\$ Nice answer +1! Btw, you can save a byte by changing () to a random character. I've never said anything about no input, so you can use an unused Object which is null as input. Relevant meta-post.. Oh, and you can save another byte by changing byte to int in the for-each loop. \$\endgroup\$ – Kevin Cruijssen Jun 20 '17 at 13:20
  • 2
    \$\begingroup\$ @Nathan Nope, I can't :( because r+=a; is equivalent to r = r + (a) and with chars, that means they're added to each other before being concatenated so they're now considered as ints, and the resulting string is similar to 127190190190190190190190190190.... I wrote a comment about that in the code ungolfed version ;) \$\endgroup\$ – Olivier Grégoire Jun 20 '17 at 14:41
  • 1
    \$\begingroup\$ I know it's been a while, but Windows-1252 can be golfed to cp1252. Explanation here. \$\endgroup\$ – Kevin Cruijssen Jan 16 at 14:44
  • 1
    \$\begingroup\$ why not this????? (why can string not be golfed???) \$\endgroup\$ – ASCII-only Jan 17 at 0:34
  • 1
    \$\begingroup\$ -2 bytes: b>>4 doesn't need parens, remember bitwise are very, very low precedence \$\endgroup\$ – ASCII-only Jan 17 at 9:57
7
\$\begingroup\$

Retina, 465 463 425 bytes


1ic¶|\i/|¶||4\9|9/4b5\7/|\7/5b5/\dcekdce/\5b1cem6|6hdc1bd5/\'j':'j'/\5ebgd1/'mc1_|_1ch'ge1/b1|2/.3/g'k'1/\3.\2|1bfdhg_|_1h\efb/1'/.2/d1//k\ge\2.\'1\bc/c_/c_/_\(+)/_\c_\c_\cbm3\3g/(O)g/3/3hbg.\'me1\\_:_//1dh'/.1/bfe\2h|m2/dfb1|m'3l_._:_._l3'h|1b/1e1\3/4|4\3/1d1\be_3'l.j.:.j.l'3_db3d2/1c3|3c1\2e3b5le2dke2dl5b5/7\|/7\5bcc/a|a\cc||¶|/i\|
m
2\
l
\/
k
1:1
j
---
i
aaac
h
/2
g
\1
f
1|2|1
e
.'
d
'.
c
__
b
||¶||
a
_________
\d
$* 

Try it online!

\$\endgroup\$
7
\$\begingroup\$

C# (.NET Core), 935 676 636 627 bytes

_=>{var m=new char[782];int i=0,p,t=0;string r=@"a`_agb^_cD|nbJ gJ cn7bocgbock7#0l3a80l3#k6l3fbG gG 20lah0k#dpdmdpd#k3h:0acdfblajgjal2d:3ac61ceic:585#iebf461402:jgja2b3a14hcadcefc0aC/a8C\a3bfeb5bhlcqcqcjbB(B+B)cjbqbqblhf$$:cB(BOB):cici2h:ebdfb3aC\jmjC/a02dceac6143bf21bfc0a1461bdi%jejmjej%id24hca3a$cngn$ca0abh3jid%epemepe%dij0hi0fcaligilabf3i7%3f0a83f0%k7cobgcobkhE_cJ_gJ_bE_D|c^_bg",g=@"cb#bi$bc%de0gf1cf2ed3ga4da5ha6hk7ma8fd9ba:B aB\bB/cB'dB.eC fB|gE|hD iB_jF kC_lB:mE nH oD-pD_q";for(;i<93;i+=3)r=r.Replace(""+g[i+2],""+g[i]+g[i+1]);for(i=0;i<796;i+=2)for(p=0;p++<r[i]-65;){m[t++]=r[i+1];if(t%34==33)m[t++]='\n';}return m;}

Try it online!

I wanted to try another approach and RLE'd the drawing. Ended up with a code that had more bytes than the drawing itself (782 bytes). Then I compressed the RLE'd string by creating a dictionary with the most used groups, and after compressing it I created more dictionaries and compressed again until the string could be reduced no more. The drawing is thus created by first expanding those groups and then uncompressing with RLE.

\$\endgroup\$
  • \$\begingroup\$ Nice answer +1, but I see one small mistake with the bottom part of the spider. The spaces seem to be at the wrong side of its legs (if you compare your TIO-output with the challenge-ascii). \$\endgroup\$ – Kevin Cruijssen Jun 20 '17 at 12:12
  • \$\begingroup\$ @KevinCruijssen I totally messed up the drawing when I copied it into VS, I hope it's fixed now (and saved 2 bytes with the new encoding). \$\endgroup\$ – Charlie Jun 20 '17 at 12:29
7
\$\begingroup\$

Python 2.7, 414 405 401 bytes

import zlib
print zlib.decompress('fY9BauhADEP3OcXbueUz1j6X6AUEuogP/xeTpCmUGgxK5iFZ5O85xn++a44ZAHPPPEoAcxMPovEbeBFyddLFyRbyi0i6Hpd5HKqTTVTfLmutOmutdTt0zRwzphoVOCETEkGZLrRTBtSATHFSyEAbhocYqgUmEwTu2r9njhlRalA1Eic2XYZ24ZljJlHu9ce/T8XJvTsFc68+vj6Ndl0EV5d27Wg7Z6R9VKlfXWZHC7alql+XMuACrHTOdCyg9OrSha9ohusoUX116QpQVq+1+uy1VlsFpPrqQjWI5PJIMHRxdQHA6oJqTraw4Aexv8HzqG8iSZR75lFOkpljvh9/G89/'.decode('base64'),-9)

Simply decompresses the string and prints it. :)

\$\endgroup\$
  • 1
    \$\begingroup\$ Can shave a bit more off by removing the newlines the base64 encoder added (but doesn't need for decompression) and using custom compression (wbits=-9, Z_FILTERED) that avoids headers and checksums. Drops it to 401 bytes. \$\endgroup\$ – ShadowRanger Jun 22 '17 at 1:31
  • \$\begingroup\$ Changed line: print zlib.decompress('fY9BauhADEP3OcXbueUz1j6X6AUEuogP/xeTpCmUGgxK5iFZ5O85xn++a44ZAHPPPEoAcxMPovEbeBFyddLFyRbyi0i6Hpd5HKqTTVTfLmutOmutdTt0zRwzphoVOCETEkGZLrRTBtSATHFSyEAbhocYqgUmEwTu2r9njhlRalA1Eic2XYZ24ZljJlHu9ce/T8XJvTsFc68+vj6Ndl0EV5d27Wg7Z6R9VKlfXWZHC7alql+XMuACrHTOdCyg9OrSha9ohusoUX116QpQVq+1+uy1VlsFpPrqQjWI5PJIMHRxdQHA6oJqTraw4Aexv8HzqG8iSZR75lFOkpljvh9/G89/'.decode('base64'),-9) \$\endgroup\$ – ShadowRanger Jun 22 '17 at 1:31
  • \$\begingroup\$ @ShadowRanger I'm not sure how to do that. Everything I've tried is showing compress[obj]() takes no keyword arguments \$\endgroup\$ – Daffy Jun 22 '17 at 1:40
  • \$\begingroup\$ compress doesn't, but compressobj takes additional arguments (though not as keywords before 3.3, you have to pass the arguments positionally). Creating a compressor, calling compressor.compress(thedata), then doing compresseddata = compressor.flush() is three step equivalent to zlib.compress, but you can configure the compressobj more finely. Only downside is that using wbits=-9 means you must pass -9 to decompress (so it knows not to look for header or checksum). \$\endgroup\$ – ShadowRanger Jun 22 '17 at 1:43
  • \$\begingroup\$ @ShadowRanger Got it and edited it, thanks for the tip! \$\endgroup\$ – Daffy Jun 22 '17 at 2:17
7
\$\begingroup\$

Python 3, 404 398 bytes

import zlib,base64
print(zlib.decompress(base64.b85decode('eUD3yLoo;h_c;YSCmI>{zC<p7#6>v#bmLDv(kMuN!q4SuEb+Y_>0i$+ADM!3*_EfW+HT??mVN^lVcs-Cn+%za`9;*pw&XF8oJ7-Y>Akm6-(}ENgo75N1$QE`f(FMq#;O#EP0J!Rhm=8`k%vfljI+?e2KVz2CXEVXmcillJ0(rL2*k!-{``62i+-({QV*TWp6{14X0P=Y`YPHzMj)z&VzynARx~e_jzi_2w@@N(p>Sw8Bbr@rp?^gam$iduzC~N`iktS{b=235(rCKgLK=4>mIDneN@x?Dfj>YFnN7`d6LSwTPxm1LWw9$y=d}g#IsC6Ye*p'),-9).decode())

Try it online!

Same cheat as the Python 2.7 version, just tweaked for Py3 required bytes <-> str conversion. Still smaller than the 2.7 code despite the additional imports and required decoding by virtue of Python 3 providing base85 encoding as a built-in, reducing the size required to represent the compressed data in ASCII printable format by 28 bytes.

Edit: Shaved six more bytes by recompressing with wbits=-9 so no header or checksum is put on data (in exchange for needing to add ,-9 arg to zlib.decompress).

\$\endgroup\$
  • \$\begingroup\$ Welcome to the site! :) \$\endgroup\$ – DJMcMayhem Jun 22 '17 at 1:29
6
\$\begingroup\$

Java 8, 719 bytes

u->{String a="______________";return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x   x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");}String r(String a,String b){return a.replace("x","\\")+b+(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");}

Can definitely be golfed, but it's just a start and something other Java golfers can (try to) beat. ;)

Explanation:

Try it here.

u->{                          // Method (1) with unused Object parameter and String return-type
  String a="______________";  //  Temp String we use multiple times
  return r(" _"+a,"_")+r("||    x         ","|")+r("||     x       /","|")+r("||     /x'.__.' ",":")+r("|| __.'  x      ","|")+r("||'.     /x'---'",":")+r("||x '. /'  x__ _","|")+r("|| |  /.   /x ' ", ":")+r("|| |  | './  x _","|")+r("||/ '/.  /'. // ","|")+r("||__/___/___/_x","(+)")+r("||  x   x   x /","(O)")+r("||x .x'  x.' xx_",":")+r("|| |  | .'x  /  ","|")+r("|| |  x'   x/_._",":")+r("||/ .' x   /    ","|")+r("||.'_   'x/.---.",":")+r("||   '.  / __   ","|")+r("||     x/.'  '. ",":")+r("||     /       x","|")+r("||____/_________",":")+r("|/"+a,"_");
                              //  Return the result
}                             // End of method (1)

String r(String a,String b){  // Method (2) with two String parameters and String return-type
  return a.replace("x","\\")  //  Return the first halve of the row
         +b                   //   + the middle character(s)
         +(new StringBuffer(a).reverse()+"\n").replace("/","\\").replace("x","/");
                              //   + the reversed first halve
}                             //  End of method (2)
\$\endgroup\$
  • 3
    \$\begingroup\$ "[...] Java golfers can (try to) beat [...]". That looks like a challenge, sir! Challenge accepted and done, sir! You're welcome, sir! \$\endgroup\$ – Olivier Grégoire Jun 20 '17 at 13:17
  • 2
    \$\begingroup\$ Okay, I decided to give +1 for the try and the idea of using symmetry. ;) \$\endgroup\$ – Olivier Grégoire Jun 20 '17 at 14:18
5
\$\begingroup\$

brainfuck, 5173 bytes

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

Try it online!

How it works

In a nutshell: finds the ascii index each character in the line; then prints it. Then find the ascii index for a newline and prints that. Rinse and repeat my son.

The first line (all underscores, so relatively easy):
++++[->++++++++<]>.[->+++<]>-...............................

New line:
>++++++++++.

Second line:
>--[-->+++<]>-..[---->+<]>+....-[->+++<]>-.+[--->+<]>+.........-[->++++<]>.[---->+<]>+.........[-->+++<]>-.+[--->++<]>....-[->++++<]>..

New line:
>++++++++++.
.
.
.
and so on...
\$\endgroup\$
5
\$\begingroup\$

256 bytes, machine code (16-bit x86)

I was hoping I'll be able to beat at least Charcoal solution, but I haven't managed to squeeze more out of this (so far).

00000000: e8 7d 00 00 01 03 02 05 04 07 04 08 09 0a 0b 0c  .}..............
00000010: 08 0a 0a 10 28 29 5c 2f 27 2e 2b 4f 20 3a 5f 7c  ....()\/'.+O :_|
00000020: 2d 5f 5f 20 0a fd fd 1b 12 fe de 3b 7f 12 ff 1f  -__ .......;....
00000030: 5b a2 e3 5b a3 12 14 15 3d 15 14 29 3b 2d 1d 15  [..[....=..);-..
00000040: 14 42 2f 1f 6b 3b 14 15 1f 83 12 14 5c 14 19 3b  .B/.k;......\..;
00000050: 12 24 15 23 62 3d 2d 5b 2b 43 15 63 12 1f 14 1f  .$.#b=-[+C.c....
00000060: 19 3b 2b 4b 24 15 13 42 2d 5b 13 24 13 15 43 14  .;+K$..B-[.$..C.
00000070: 15 23 13 1f 19 3b 3d 13 5d 13 5d 13 1d 12 10 16  .#...;=.].].....
00000080: be 25 01 bf 00 03 57 57 b1 cc b0 08 f2 aa 5f 47  .%....WW......_G
00000090: ac d4 10 d0 ec 73 06 10 e1 f2 aa eb 05 10 e1 f2  .....s..........
000000a0: ae aa 81 fe 80 01 75 e8 ba 0c 00 5e bf 00 04 5b  ......u....^...[
000000b0: 57 b1 11 f3 a4 4e 4e b1 10 fd ac 3c 03 77 02 34  W....NN....<.w.4
000000c0: 01 fc aa e2 f4 83 c6 12 b0 10 aa 4a 75 e3 b2 0c  ...........Ju...
000000d0: be 76 05 b1 22 ac d7 aa e2 fb 83 ee 44 4a 75 f3  .v..".......DJu.
000000e0: 83 c3 11 b0 04 bf f6 04 aa 83 c7 0f aa bf 4a 06  ..............J.
000000f0: aa 83 c7 0f aa b9 0e 03 5e 89 f7 ac d7 aa e2 fb  ........^.......

Running: save to codegolf.com, dosbox to see the result you need to set breakpoint at cs:200 and dump memory at ds:400 of legth 30e... or you can append following piece, that will dump it to stdout

00000100: 31 db b9 0e 03 ba 00 04 b4 40 cd 21 cd 20        1........@.!.

This is my third code golf entry. Previous one was xor encryption.

Again: done using HT hexeditor, without compiler, but using Ctrl-a assemble instruction.

successfull attempt

How

This one took a bit to make it...

I've started with a simple approach, with one quadrant and trying to mirror it. That resulted in ~250 bytes and having only 2 of 4 quadrants. Big part of that was first quadrant itself, that took 204 bytes.

I knew this can be better.

I quickly checked that lz4 produces file with 144 bytes (skipping headers). GZ results in ~120 bytes, but clearly I wouldn't be able to create decompressor in 30 or so bytes.

So another attempt was handcrafting first quadrant by drawing it (including skipping, 4-bit encoding and such). That along with code resulted in 164 bytes (mind that's first quadrant only), nice but I was quite convinced I could do better.

I came up with some encoding, that ends up in 85 bytes for data. Along with translation table (that is not used yet) and decoder, I ended up with 144 bytes. NOICE, I'm =lz4 and already have decoder.

Next step was to merge initial mirroring from ~250 attempt to this one, this required some data tuning, but went easier than expected and resulted in 184bytes.

I realized I will need some additional markers to do horizontal mirror, which extended data to 91b and code to 190bytes (that went into trash later).

Along with horizontal mirror and final translation I've ended up with ~250 bytes.

I've managed to eat few bytes here and there, but had to add that ugly chars, that are incorrectly mirrored. That yielded 259 bytes... That is bad, cause I was using memory starting at 0x200 and did not want to redo that.

I've replaced conditions in horizontal mirror, to loop using translation table, that itself didn't save much, but combined with changing offending chars to spaces and fixing them later, saved few bytes, resulting in final 256 bytes.

You can see nice gallery, that I've done, while making this here

Dissection

As previous entries, this one also relies on initial values, although not that much as previous ones:

:0100 E8 7D 00                    call    0x180

skip data, there are 3 tables following:

:0103  db 00h,01h,03h,02h,05h,04h,07h,04h,08h,09h,0Ah,0Bh,0Ch,08h,0Ah,0Ah,10h

Translation table will be use for horizontal mirroring

:0114  db "()\/'.+O :_|-__ \n"

Translation table will be used for final substitution, to convert codes to actual ascii

:0125  db FDh,FDh,1Bh,12h,FEh,DEh,3Bh,7Fh,12h,FFh...

Encoded data, encoding is pretty simple:

  • low nibble is character code
  • high nibble:
    • if lowest bit is 1 interpret other 3 bits as 'repeat' (+ additional 1) of low nibble code
    • else interpret as number of bytes to 'skip' then place low nibble code
:0180 BE 25 01            mov     si, 125h
:0183 BF 00 03            mov     di, 300h
:0186 57                  push    di
:0187 57                  push    di
:0188 B1 CC               mov     cl, 0CCh
:018A B0 08               mov     al, 8
:018C F2 AA               repne stosb

fill 12*17 bytes with what will become space (8)

:018E 5F                  pop     di
:018F 47                  inc     di
:0190
:0190 AC                  lodsb
:0191 D4 10               aam     10h
:0193 D0 EC               shr     ah, 1
:0195 73 06               jnb     short 0x19D
:0197 10 E1               adc     cl, ah
:0199 F2 AA               repne stosb
:019B EB 05               jmp     short 0x1A2
:019D
:019D 10 E1               adc     cl, ah
:019F F2 AE               repne scasb
:01A1 AA                  stosb
:01A2
:01A2 81 FE 80 01         cmp     si, 180h
:01A6 75 E8               jnz     short 0x190

"Decompress" the data as described under table 3. Mind usage of beloved AAM instruction, and abuse of scasb to skip bytes.

:01A8 BA 0C 00            mov     dx, 0Ch
:01AB 5E                  pop     si
:01AC BF 00 04            mov     di, 400h
:01AF 5B                  pop     bx
:01B0 57                  push    di
:01B1
:01B1 B1 11               mov     cl, 11h          <--
:01B3 F3 A4               rep movsb                  |
:01B5 4E                  dec     si                 |
:01B6 4E                  dec     si                 |
:01B7 B1 10               mov     cl, 10h            |
:01B9                                                |
:01B9 FD                  std                   <--  |
:01BA AC                  lodsb                   |  |
:01BB 3C 03               cmp     al, 3           |  |
:01BD 77 02               ja      short 0x1C1 --  |  |
:01BF 34 01               xor     al, 1        |  |  |
:01C1                                          |  |  |
:01C1 FC                  cld                <--  |  |
:01C2 AA                  stosb                   |  |
:01C3 E2 F4               loop    0x1B9          --  |
:01C5 83 C6 12            add     si, 12h            |
:01C8 B0 10               mov     al, 10h            |
:01CA AA                  stosb                      |
:01CB 4A                  dec     dx                 |
:01CC 75 E3               jnz     short 0x1B1       --

This part is pretty ugly, it sets destination at 0x400:

  • copies row
  • mirrors a row
  • adds 'newline' (10h at 0x1C8)

Mind that mirror is done by abusing std/cld, to go through SI in reverse. Only \/() characters needs to be mirrored, that is done by xor at 0x1BF.

:01CE B2 0C               mov     dl, 0Ch
:01D0 BE 76 05            mov     si, 576h
:01D3
:01D3 B1 22               mov     cl, 22h    <--
:01D5                                          |
:01D5 AC                  lodsb        <--     |
:01D6 D7                  xlat           |     |
:01D7 AA                  stosb          |     |
:01D8 E2 FB               loop    0x1D5 --     |
:01DA                                          |
:01DA 83 EE 44            sub     si, 44h      |
:01DD 4A                  dec     dx           |
:01DE 75 F3               jnz     short 0x1D3 --
:01E0 83 C3 11            add     bx, 11h         (adjust bx for final xlat below)

This does horizontal mirror by using table 1, and using wonderful 1-byte XLAT

Then comes the boring part that fixes 4 "pixels", I'll skip it from here it's boring

:01F5 B9 0E 03            mov     cx, 30Eh
:01F8 5E                  pop     si
:01F9 89 F7               mov     di, si
:01FB
:01FB AC                  lodsb
:01FC D7                  xlat
:01FD AA                  stosb
:01FE E2 FB               loop    0x1FB

Final step of translating to ascii.

PHEW! That was fun.

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

JavaScript (ES6), 517 ... 459 457 456 433 431 418 409 397 392 bytes

Includes a trailing line of spaces plus a trailing space on the first line. Some of this is still not optimally golfed - I put a lot of time into just getting it all to work.

o.innerText=(

_=>[(g=n=>` b8b8
|af8f7
zj4aj9|
z 5a 7k|
z 5kacibbic :
z bbic  a jj 3|
zcij 3dkac-3c:
za ci kh  abb b|
z |  ki 3kajcj:
z |  | cik  a b|
zk cki  kci kkj:
zbbkb3kb3kba(e`[r="replace"](/.\d/g,([x,y])=>x.repeat(y))[r](/\w/g,x=>`\\_' +_O'. /`[[i=parseInt(x,21)-10,10-i][n]]||`||`))(0),...g(1).split`
`.reverse()].join`
`[r](/.*/g,x=>x+x[r](/./g,_=>(z=x[--y])?`)\\/`[`(/\\`.indexOf(z)]||z:``,y=16))

)()
body{align-items:center;background:#222;color:#ddd;display:flex;font-size:14px;height:100vh;justify-content:center;}
<pre id=o>

Originally based on Traktor53's since abandoned 556 byte solution. Posted with permission.


To-Do List

  1. Find a less expensive way of palindromising the strings.
  2. Try to improve the RLE replacement.
  3. See if the last 4 replacements can be golfed down in any way.
  4. Investigate if building the image in quarters would lead to any significant savings - I suspect not!
  5. Add updated explanation.
\$\endgroup\$
  • \$\begingroup\$ You were speculating if quadrant compression could provide worthwhile gains... I got it to work in my case but wider applicability is uncertain. \$\endgroup\$ – traktor53 Sep 30 '17 at 5:12
  • \$\begingroup\$ @Traktor53: Very nicely done :) That item went missing from my to-do list in an edit, hoping to have some time to look into it tomorrow. \$\endgroup\$ – Shaggy Oct 2 '17 at 16:14
  • \$\begingroup\$ I'm impressed. BTW, string1[string2.indexOf( char) ]|| char is a construction I tried but couldn't manage to reduce bytes with. Well done! \$\endgroup\$ – traktor53 Oct 3 '17 at 23:08
3
\$\begingroup\$

JavaScript 556 468 462 448 438 387 379 bytes

let f =

_=>(t="",y=(s,X,L,R)=>{x=M=>{c=s.charCodeAt(i);for(r=c>>4;--r;)t+=(":_| -"+X+M)[c&15]};for(i=0;s[i];i++)x(L);for(--i;i--;)x(R);t+=`
`},`#qqA!
",qq1!
2U,uE"
2c,s#-"
2c-,)*6*)# 
2#6*)3,#5C"
2)*%C(-,)D) 
2,#)*#-'3,6#&"
2#"3-*C-,%)% 
2#"3"#)*-3,#&"
2-#)-*3-)*#=% 
26-F-F-&,.+`.split(`
`).map(s=>y(s," _' '.+","\\/(","/\\)")||s).map((_,i,a)=>i&&y(a[12-i],"_  '.'O","/\\(","\\/)")),t)

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

Less Golfed

_=>(
  t="",
  y=(s,X,L,R)=>{
     x=M=>{
         c=s.charCodeAt(i);
         for(r=c>>4;--r;)
             t+= ( ":_| -" + X + M )[c&15]
     };
     for(i=0;s[i];i++)
         x(L);
     for(--i;i--;)
         x(R);t+=`
`},
   stringLiteral //  of compressed strings separated by '\n'
   .split(`
`) .map(s=>y(s," _' '.+","\\/(","/\\)")||s)
   .map((_,i,a)=>i&&y(a[12-i],"_  '.'O","/\\(","\\/)"))
   ,t
)

Compression

The original post (556 bytes) used decimal digits to indicate repetition of a previous character in the spider web. More recent versions compresses the left hand half of the web into 7 bit characters where the least significant nibble is an index into a character set, and three higher order bits specify the number of characters to output plus 1: values 000 and 001 are not used, 010 means 1 character and 111 means six. This construction avoids production of control characters.

Thanks to @Shaggy for tips and tricks useful in the rewrite.

How it works

The top left quadrant was rewritten to include placeholders for top and bottom halves of the web:

  • 's' to swap space with underscore,
  • 'u' to swap underscore with space,
  • 'q' to swap quote with space, and
  • 'h' to swap space with (hidden) quote

giving:

 ________________
|\_______________
||ssss\sssssssss|
||     \       /|
||     /\'.uu.' :
|| uu.'  \ ss   |
||'.s   h/\'---':
||\ '. /q  \uu u|
|| |  /.   /\s's:
|| |  | './  \ u|
||/ '/.  /'. //s:
||uu/uuu/uuu/u\(+

which was compressed using

charset ::=  ":_| -suqh'.+\/("

Decompression

Decompression maps encoded characters to actual characters for each quadrant. In code,

  • X is an indexed character list that varies between upper and lower web sections. It provides values for "suqh" placeholders, and hard character reflections such as between '+' and 'O'.
  • 'L' and 'R' are character lists that provide character reflections between left and right halves of the web.

Encoding

Encoding the center character is constrained to use a single character expansion. Character set order is constrained so as to not produce DEL (0x7F), Grave (0x60) or backslash (0x5C) characters during compression.


This is a late update in response to activity on the question.

\$\endgroup\$
  • \$\begingroup\$ Here's a 517 byte version (note: you only need count the bytes of the function itself). I wrote this up very quickly while on a smoke break so it can probably be golfed down further but it should give you a start. Let me know if you've any questions. \$\endgroup\$ – Shaggy Jun 24 '17 at 20:53
  • \$\begingroup\$ @Shaggy thanks for the tips and advice. Rest assured I shall be studying your pen to see how you worked in the .reduce and .map which I could not. In the mean time I've changed the algorithm to get 468 bytes! Happy weekend. \$\endgroup\$ – traktor53 Jun 25 '17 at 6:45
  • \$\begingroup\$ All these months later and I took another pass over your original solution, golfing it down to 460 bytes (so far). Do you mind if I post it now that you've gone for a different method? \$\endgroup\$ – Shaggy Sep 28 '17 at 15:40
  • \$\begingroup\$ Not at all @Shaggy , go write ahead :-) I look forward to reading the result. \$\endgroup\$ – traktor53 Sep 28 '17 at 23:54
  • \$\begingroup\$ Much thanks. Posted. \$\endgroup\$ – Shaggy Sep 29 '17 at 8:46
2
\$\begingroup\$

///, 463 bytes

/=/---//</ : //;/"""0//9/% //8/|!//7/\/\///6/%!75/&!74/ 8| 73/.'72/'.71/!,70/__7,/! 7&/\\\7/%/\\\&/#/||
||7"/0000_7!/  / ;0
|%;&|
|8!6!18!15!#161&|61&1#1&%203<203&%1# 03!6!!8!!520 #21&%'=':'='&%13#92 &'!%0 _|_ 05'93 &# 8&.,&9'<' &%,.6| #4259_|_ 5%34#& '&.!&2 &&<%936.%' %#0&0_&0_&_%(+)&_%0_%0_%0#!%,%,9&(O)9&,&,5#9.%'!%3 %%_:_&& 25'&. &#436586&24# 8%',%&_._:_._%&,'5| #& 3 %,5!8!%,& 2 %#3_,'%&.=.:.=.%&',_2#,2!& 0,|,0 63,#1%&3!2<3!2%&1#151%|51%1#00&"|"%00||
|&;%|

Try it online!

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

Bash, 391 bytes

base64 -d<<<H4sIAPPWTlkAA32SS47EMAhE9zkFO7o1CuxziblASVyEww+FP53WSLGEReLyK4wt8TyOxOO655EpNSBr5M68P5diSzxxF9wUDrUIU7lkJI6bolcWJTeByqFQW5TzPPXqeRJMW4FSi5NSeyIrggTUepXVLgV2a4p0HdIEAy23IovjrIUMJrU/t8JFiXB6eTFAPghRQSvKNlbg9fOuufIZsx+QFf76faObNWOehby2BuKKsuqi6O23Stvau2MYReXXWQgReFgxLEAL9dtZyN+Xue6RXvMspsEtcKt+29Uz2GMJtXW3vBqvbk9GJeyHfr8P549SXjIS/Hsf890gd/ZRxOzoGLmzfsBUeDwN5PEH4O6M4A0DAAA=|gunzip

Try it online!

Kudos to everyone who was able to beat off-the-peg compression - this is me throwing in the towel! I acknowledge the Python folks who got in with the zlib/gzip approach first.

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

Perl 5 439 402 bytes

Rather than using base64/gzip, this approach is to mirror and flip the top left quadrant, with appropriate substitutions

use 5.010;map{s^t^___^g;s!p!||!g;s%s%  %g;y&b&\\&;my@b=split//;@c=reverse@b[0..15];map{y;\\/(;/\\);;push@b,$_}@c;unshift@a,\@b;say@b}(split/n/," ttttt_n|btttttnpssbssss |npss bsss /|npss /b'.__.' :np __.'sbsss|np'.ss /b'---':npb '. /'sb__ _|np |s/.s /b ' :np |s| './sb _|np/ '/.s/'. // :np__/t/t/_b(+");for$j(0..10){for$i(0..34){$_=$a[$j][$i];y:\\/.'+_:/\\'.O :;s/ /_/ if$a[$j+1][$i]=~s/_/ /;print}say}

Try it online

For those interested, a commented version:

# use 5.010 is shorter for the says
use 5.010;

map{
# sed replace keys in long string
s^t^___^g;
s!p!||!g;
s%s%  %g;
y&b&\\&;

my@b=split//;
# don't mirror the middle
@c=reverse@b[0..15];

map{
# transliterate the right mirror
y;\\/(;/\\);;
# add to end of current line
push@b,$_
}@c;

# build bottom array
unshift@a,\@b;
#print completed line
say@b

}(split/n/,
# this string is the top left quadrant.
" ttttt_n|btttttnpssbssss |npss bsss /|npss /b'.__.' :np __.'sbsss|np'.ss /b'---':npb '. /'sb__ _|np |s/.s /b ' :np |s| './sb _|np/ '/.s/'. // :np__/t/t/_b(+");

# handle _ changes and print
for$j(0..10){
for$i(0..34){
$_=$a[$j][$i];
# transliterate the bottom chars
y:\\/.'+_:/\\'.O :;
# handle _ adjustments
s/ /_/ if$a[$j+1][$i]=~s/_/ /;
print
}
say
}
\$\endgroup\$
1
\$\begingroup\$

C#, 484 bytes

Note: I'm not 100% on how to score these. With the header and footer it's 544 bytes.

var w=@" uuuuu_n|\uuuuun||ww\wwww |n||ww \www /|n||ww /\'.__.' :n|| __.'w\www|n||'.ww /\'---':n||\ '. /'w\__ _|n|| |w/.w /\ ' :n|| |w| './w\ _|n||/ '/.w/'. // :n||__/u/u/_\(+".Replace("u", "___").Replace("w", "  ").Split('n');for(int i=0;i<23;i++){var s=w[i<12?i:23-i].Skip(0);if(i>11)s=s.Select((x,j)=>x=='_'||x==' '?w[22-i][j]=='_'?'_':' ':(x+"\\/o.'")["/\\+'.".IndexOf(x)+1]);Console.WriteLine(s.Concat(s.Reverse().Select(x=>(x+"\\/()")["/\\)(".IndexOf(x)+1]).Skip(1)).ToArray());}

Ungolfed:

var w = @" uuuuu_n|\uuuuun||ww\wwww |n||ww \www /|n||ww /\'.__.' :n|| __.'w\www|n||'.ww /\'---':n||\ '. /'w\__ _|n|| |w/.w /\ ' :n|| |w| './w\ _|n||/ '/.w/'. // :n||__/u/u/_\(+".Replace("u", "___").Replace("w", "  ").Split('n');
for (int i = 0; i < 23; i++)
{
    // mirror the web vertically and convert the strings to IEnumerable
    var s = w[i < 12 ? i : 23 - i].Skip(0);
    if (i > 11)
    {
        // shift _ characters up a row, then flip all the mirrored characters (also replace + with o)
        s = s.Select((x, j) => x == '_' || x == ' ' ? w[22 - i][j] == '_' ? '_' : ' ' : (x + "\\/o.'")["/\\+'.".IndexOf(x) + 1]);
    }
    // mirror each string horizontally and flip the mirrored characters
    Console.WriteLine(s.Concat(s.Reverse().Select(x => (x + "\\/()")["/\\)(".IndexOf(x) + 1]).Skip(1)).ToArray());
}

Try It Online!

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

Ruby 1.9.3, 1102 763 bytes

a=" 9_9_9_4_\n|\\9_9_9_2_/|\n2|4 \\9 |9 /4 2|\n2|5 \\7 /|\\7 /5 2|\n2|5 /\\'.2_.' : '.2_.'/\\5 2|\n2| 2_.'2 \\6 |6 /2 '.2_ 2|\n2|'.5 /\\'3-':'3-'/\\5 .'2|\n2|\\ '. /'2 \\2_ _|_ 2_/2 '\\ .' /2|\n2| |2 /.3 /\\ ' : ' /\\3 .\\2 | 2|\n2| |2 | './2 \\ _|_ /2 \\.' |2 | 2|\n2|/ '/.2 /'. 2/ : 2\\ .'\\2 .\\' \\2|\n2|2_/3_/3_/_\\(+)/_\\3_\\3_\\2_2|\n2|2 \\3 \\3 \\ /(O)\\ /3 /3 /2 2|\n2|\\ .\\'2 \\.' 2\\_:_2/ './2 '/. /2|\n2| |2 | .'\\2 /2 |2 \\2 /'. |2 | 2|\n2| |2 \\'3 \\/_._:_._\\/3 '/2 | 2|\n2|/ .' \\3 /4 |4 \\3 / '. \\2|\n2|.'_3 '\\/.3-.:.3-.\\/'3 _'.2|\n2|3 '.2 / 2_3 |3 2_ \\2 .'3 2|\n2|5 \\/.'2 '. : .'2 '.\\/5 2|\n2|5 /7 \\|/7 \\5 2|\n2|4_/9_|9_\\4_2|\n|/9_9_9_2_\\|\n"
.split '';r='';loop{e=a.shift;break unless e;e.to_i==0 ? r<<e : r<<a.shift*e.to_i};puts r

Try It Online!

\$\endgroup\$
  • 5
    \$\begingroup\$ Given that the actual data to print is only 780 bytes, a simple script using puts and a multiline string should take ~790 bytes. Your huge string to scan and the code to process it ends up being longer than the naïve solution... \$\endgroup\$ – ShadowRanger Jun 22 '17 at 16:44
  • 1
    \$\begingroup\$ 1022 bytes: Try it online! \$\endgroup\$ – Conor O'Brien Jun 22 '17 at 21:01
  • \$\begingroup\$ 680 Bytes \$\endgroup\$ – Cyoce Oct 2 '17 at 20:23
1
\$\begingroup\$

C#, 401 399 397 396 389 bytes

Wrote this one as an excuse to try Huffman coding

BigInteger v=0;foreach(var c in @"!P~`]~~R'vZWB';uq4w_HVe,OinAa6=/[ k5)HMJCPVyy)ZtdpW<P*-KAp=b`(p|jvUoBs/d!S4pqmw@ >|b3e;?\o<Hw2Ndi2B+|r}]B'*qHwXv%Zt :Hj[@,^/^/Kq^ep:A!2<GjH5i8yo]thre{B=U:""^DTzb`-xA")v=95*v+c-32;String t=@"wtb/\nb::heb++OO)(--..__heb''\/||  ",s="";for(int p=0;v>0;v/=2)if(t[p+=v%2>0?t[p]-95:1]/24!=4&&(s=(s!=""?t[p+1]+s:s)+t[p]).Length>32+(p=0))Console.WriteLine(s,s="");

Ungolfed:

BigInteger v = 0;
foreach (var c in @"!P~`]~~R'vZWB';uq4w_HVe,OinAa6=/[ k5)HMJCPVyy)ZtdpW<P*-KAp=b`(p|jvUoBs/d!S4pqmw@ >|b3e;?\o<Hw2Ndi2B+|r}]B'*qHwXv%Zt :Hj[@,^/^/Kq^ep:A!2<GjH5i8yo]thre{B=U:""^DTzb`-xA")
    v = 95 * v + c - 32;
String t = @"wtb/\nb::heb++OO)(--..__heb''\/||  ", s = "";

for (int p = 0; v > 0; v /= 2)
    if (t[p += v % 2 > 0 ? t[p] - 95 : 1] / 24 != 4
        && (s = (s != "" ? t[p + 1] + s : s) + t[p]).Length > 32 + (p = 0))
        Console.WriteLine(s, s = "");

Older version ungolfed with comments:

BigInteger v = 0;
// the data here is an encoded version of the right half of the web
foreach (var c in @"!P~`]~~R'vZWB';uq4w_HVe,OinAa6=/[ k5)HMJCPVyy)ZtdpW<P*-KAp=b`(p|jvUoBs/d!S4pqmw@ >|b3e;?\o<Hw2Ndi2B+|r}]B'*qHwXv%Zt :Hj[@,^/^/Kq^ep:A!2<GjH5i8yo]thre{B=U:""^DTzb`-xA")
    v = 95 * v + c - 32; // converts from base-95, I'm using every single-byte printable character in UTF-8
// our binary decision tree for our Huffman coding
// a loweralpha character asks for a bit
//      on zero you increase your pointer by 1
//      on 1 you increase your pointer by an amount equal to the loweralpha character
// every other character is a character that gets printed, followed by its mirrored counterpart
String t = @"wtb/\nb::heb++OO)(--..__heb''\/||  ", s = "";
for (int p = 0, l = 0; v > 0; v /= 2)
{
    p += v % 2 > 0 ? t[p] - 95 : 1; // begin reading one bit at a time and going through the decision tree
    if (t[p] / 24 != 4) // "good enough" for determining if the character is a loweralpha or not
    {
        s = (l++ > 0 ? t[p + 1] + s : s) + t[p]; // add the character and its mirror to both sides of the string, unless we're just starting
        if (l > 16) { Console.WriteLine(s); s = ""; l = 0; } // once the string is long enough, print it
        p = 0;
    }
}

Try It Online!

\$\endgroup\$
  • \$\begingroup\$ Nice answer! +1. You can golf two bytes by changing the while(v>0){ to a for, and placing the integers and v/=2 inside it: for(int p=0,l=0;v>0;v/=2){ \$\endgroup\$ – Kevin Cruijssen Jun 24 '17 at 7:59
  • \$\begingroup\$ @KevinCruijssen That's brilliant, thanks! I guess it'll be pretty rare for a while to take up the same space as a for, now. \$\endgroup\$ – Geoffrey Jun 25 '17 at 18:08
  • \$\begingroup\$ Well, only in those cases where you don't have any variables, and only have a single line body they are the same length. I.e. these three all do the same and all three are the same length: for(;someCondition;someAction); vs for(;someCondition;)someAction; vs while(someCondition)someAction;. But overall for is indeed shorter than while, so I use almost always for myself. \$\endgroup\$ – Kevin Cruijssen Jun 25 '17 at 18:41
1
\$\begingroup\$

Python 2, 395 bytes

print'eNp9kk2uwzAIhPc9BTtaPQX2uUQvMBIX4fCPwT9NVSmWbJF4/A3GSNyPR+J23/ORKTUga+SOvD+XYks8cRVcFA61CFM5ZQSOi6J3FiU3gcqhUFuU4zj07HUSTFuBUouTUmciawYJqP1Kq10K7NYU6TykCQZabkUWx5kLGQzqfG6FixLh9PJigHwQooJWlG2sieffq9aK55z1gKzpz/cLXaw5513Ia2sgziirTorefsm0rb0rhpFUft2FEIGHFcMCtFC/3IX8/ZjrHek172IaPAK3qredvYI1llBbb8un8ar2ZFTAeuh3fzh/lPKUEeCnP2bfIHf0UcSs6Bi5o25gKvy2k5H/H7zBvA=='.decode('base64').decode('zlib')

Try it online!

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

Whitespace, 4723 4584 bytes

S S S T T   T   T   S N
S S T   T   S N
S S S T N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S T T   T   T   N
S S S T T   T   T   S N
S S T   T   S T S T S S N
S T S S T   N
S N
S S S S T   N
S N
S S N
S S N
S S S T T   S N
S S S T N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S S S T N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S T T   T   T   N
S S S T N
S N
S S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S T T   S N
S T S S T   N
S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S T T   T   T   N
S S S T T   T   T   S N
S S T   T   S N
S T S S T   T   N
S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S T T   T   T   N
S T S S T   N
S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S T T   S T T   T   T   N
S S T   T   S N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S S T   T   T   T   T   T   S N
S N
S S T   S S T   S N
S S T   T   T   S S S S N
S T S S T   S N
S S T   T   S S T   S S N
S T S S T   N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   S N
S N
S S T   S S T   S N
S S T   T   T   S S S S N
S S T   T   S T T   T   T   N
S S T   T   S N
S T S S T   S S N
S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S N
S S S T T   T   S T T   T   N
S S T   T   T   S S S S N
S T S S T   S N
S N
S S S T T   S N
S T S S T   N
S S S T N
S N
S S T   S S T   S N
S N
S S N
S S S S T   T   T   T   S N
S T S S T   N
S N
S S N
S S S S T   N
S N
S S T   S S T   S N
S S T   T   S T T   T   T   N
S T S S T   N
S N
S S S T T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   S N
S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   S S S S N
S S T   T   T   S T T   T   N
S S S T N
S S T   T   T   T   T   T   S N
S N
S S N
S S S T T   T   S T T   T   N
S S T   T   S T T   T   T   N
S S T   T   S N
S S T   T   T   S S S S N
S S T   T   T   S S S T N
S N
S S N
S S S T T   T   S S S S N
S S T   T   S S T   S S N
S T S S T   N
S S T   T   T   S S S T N
S N
S S N
S S T   S S T   T   N
S S T   T   S T T   T   T   N
S S T   T   S N
S S T   T   T   S T T   T   N
S S T   T   T   T   T   T   S N
S N
S S N
S S S S T   N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   S N
S S T   T   T   T   T   T   S N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   S N
S S T   T   S T T   T   T   N
S T S S T   N
S N
S S N
S S S T T   S N
S T S S T   N
S N
S S N
S S N
S S S S T   T   T   T   S N
S T S S T   N
S N
S S N
S S N
S S S T T   S T T   T   T   N
S T S S T   N
S N
S S N
S S S T T   S N
S T S S T   N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S T S S T   S N
S S T   T   S T T   T   T   N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   S N
S N
S S S T T   T   T   T   T   S N
S T S S T   N
S T S S T   N
S N
S S S T T   S T T   T   T   N
S S T   T   T   S T T   T   N
S T S S T   S N
S N
S S N
S S S T T   S T T   T   T   N
S S T   T   S N
S S S T N
S S T   T   T   S S S S N
S S S T N
S S T   T   S S T   S S N
S S S T N
S T S S T   T   N
S S S T N
S S T   T   S T T   T   T   N
S S T   T   S N
S S T   T   T   T   T   T   S N
S N
S S N
S S S T T   T   S T T   T   N
S S T   T   S N
S T S S T   S N
S N
S S S S T   T   T   T   S N
S T S S T   S N
S T S S T   N
S N
S S S T T   S T S T S S N
S T S S T   S N
S N
S S S T T   T   T   T   T   S N
S T S S T   N
S T S S T   N
S N
S S T   S S T   S N
S T S S T   N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S S T   T   S T T   T   T   N
S T S S T   T   N
S N
S S S T T   S N
S T S S T   N
S N
S S S S T   T   T   T   S N
S T S S T   N
S N
S S S T T   S T T   T   T   N
S T S S T   S N
S N
S S S T T   S N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S T S S T   T   N
S S S T T   T   T   S N
S T S S T   N
S N
S S T   S S T   S N
S T S S T   N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   S T T   T   T   N
S S T   T   T   T   T   T   S N
S S T   T   T   S S S S N
S T S S T   S N
S S T   T   T   S T T   T   N
S T S S T   T   N
S N
S S S T T   S T T   T   T   N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   T   N
S S T   T   S T T   T   T   N
S N
S S S S T   N
S S T   T   S S T   S S N
S S S T N
S S T   T   S N
S N
S S S T T   T   T   T   T   S N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S S T   T   S N
S T S S T   T   N
S N
S S S T T   T   S T T   T   N
S S T   T   S N
S S T   T   T   S S S S N
S T S S T   T   N
S S T   T   S N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S S T T   S T T   T   T   N
S T S S T   N
S N
S S N
S S T   S S T   T   N
S T S S T   N
S N
S S N
S S T   S S T   T   N
S T S S T   N
S S T   T   S N
S S T   T   T   S T S T N
S S T   T   T   T   T   N
S S T   T   T   S T T   S N
S S T   T   S T T   T   T   N
S S T   T   T   T   T   T   S N
S S T   T   S N
S T S S T   N
S N
S S N
S S S T T   S N
S T S S T   N
S N
S S N
S S S T T   S N
S T S S T   N
S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   S N
S N
S S S S T   N
S N
S S S T T   S N
S S S T N
S N
S S N
S S S T T   S N
S S S T N
S N
S S N
S S S T T   S N
S S S T N
S S T   T   S T T   T   T   N
S S T   T   T   S T S T N
S S T   T   T   S S T   T   N
S S T   T   T   S T T   S N
S S T   T   S N
S S S T N
S S T   T   S T T   T   T   N
S S S T N
S N
S S N
S S T   S S T   T   N
S S S T N
S N
S S N
S S T   S S T   T   N
S S S T N
S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   S N
S N
S S S T T   S N
S S T   T   T   T   T   T   S N
S S T   T   T   S T T   T   N
S S T   T   S N
S S T   T   T   S S S S N
S T S S T   T   N
S N
S S S T T   S N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S T S S T   T   N
S S T   T   S N
S N
S S T   S S T   S N
S S T   T   S S T   S S N
S T S S T   N
S S T   T   S T T   T   T   N
S N
S S T   S S T   S N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   T   N
S T S S T   T   N
S N
S S S T T   T   S S S S N
S T S S T   T   N
S S T   T   T   S T T   T   N
S S T   T   T   T   T   T   S N
S T S S T   S N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S T S S T   N
S T S S T   N
S N
S S T   S S T   S N
S T S S T   N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S S T   T   S N
S T S S T   T   N
S N
S S S T T   S T T   T   T   N
S T S S T   N
S S S T N
S S S T T   T   T   S N
S S S T N
S T S S T   T   N
S S T   T   S N
S T S S T   N
S N
S S S T T   S T T   T   T   N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   T   N
S S S T T   T   T   S N
S T S S T   N
S N
S S T   S S T   S N
S T S S T   N
S T S S T   N
S N
S S S T T   S T S T S S N
S T S S T   S N
S N
S S S T T   T   T   T   T   S N
S T S S T   N
S T S S T   N
S N
S S S T T   S N
S S T   T   T   S S S S N
S T S S T   S N
S N
S S N
S S S T T   S N
S S T   T   S T T   T   T   N
S T S S T   S N
S S T   T   T   S T T   T   N
S T S S T   N
S S T   T   S S T   S S N
S T S S T   N
S T S S T   T   N
S T S S T   N
S S T   T   S N
S S T   T   S T T   T   T   N
S T S S T   S N
S N
S S N
S S S T T   T   S S S S N
S S T   T   S T T   T   T   N
S T S S T   S N
S N
S S S S T   T   T   T   S N
S T S S T   N
S T S S T   N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   S T T   T   T   N
S S T   T   T   T   T   T   S N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S T S S T   S N
S S T   T   S N
S T S S T   T   N
S T S S T   S N
S N
S S S T T   S T T   T   T   N
S S S T N
S N
S S S T T   T   T   T   T   S N
S S S T N
S S S T T   T   T   S N
S S S T N
S T S S T   T   N
S S S T N
S N
S S S T T   S N
S S T   T   T   T   T   T   S N
S N
S S S T T   T   S T T   T   N
S S T   T   S T T   T   T   N
S T S S T   T   N
S S T   T   T   S S S S N
S S T   T   T   S T T   T   N
S T S S T   S N
S S T   T   S N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   S T T   T   N
S S T   T   T   S S S S N
S S T   T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S T T   S N
S S T   T   S T T   T   T   N
S S T   T   T   S T T   T   N
S S T   T   T   S S S T N
S N
S S N
S S T   S S T   T   N
S S T   T   S S T   S S N
S T S S T   N
S S T   T   T   S S S T N
S N
S S N
S S T   S S T   T   N
S S T   T   S N
S S T   T   S T T   T   T   N
S S T   T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S T T   T   S S S S N
S S T   T   T   S T T   T   N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S S S T N
S N
S S S T T   T   S S S S N
S S T   T   T   S T T   T   N
S S T   T   T   T   T   T   S N
S N
S S S T T   S T T   T   T   N
S T S S T   N
S N
S S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S T S S T   N
S N
S S N
S S N
S S N
S S N
S S S T T   S N
S T S S T   N
S N
S S S T T   T   S T T   T   N
S S T   T   T   S S S S N
S S S T N
S N
S S S T T   T   T   T   T   S N
S S S T T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S T T   S N
S S T   T   S T T   T   T   N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S S S T N
S N
S S T   S S T   S N
S S T   T   T   S T T   T   N
S S T   T   T   T   T   T   S N
S S T   T   S S T   S S N
S T S S T   N
S S T   T   T   S T T   T   N
S S T   T   T   S S S S N
S S S T N
S N
S S T   S S T   S N
S S T   T   T   S T T   T   N
S S T   T   S N
S S T   T   S T T   T   T   N
S S T   T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S N
S S N
S S N
S S S T T   S T T   T   T   N
S T S S T   N
S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S N
S S S T T   T   T   S N
S S T   T   S T T   T   T   N
S T S S T   T   N
S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S N
S T S S T   N
S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S N
S S S T T   T   T   T   T   S N
S N
S S N
S S N
S S S T T   S T T   T   T   N
S T S S T   N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S S T   T   T   T   S N
S T S S T   N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S N
S T S S T   N
S N
S S N
S S N
S S S S T   T   T   T   S N
S N
S S S T T   S T S T S S N
S T S S T   N
S S T   T   S T T   T   T   N
S S S T N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S T T   S N
S S S T T   T   T   S N
S S T   T   S T S T S S N
S S S T N
S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S N
S S S T T   T   T   T   T   S N
N
S S N
S S S T S T T   T   T   S N
T   S S S T N
S S N
S N
N

Letters S (space), T (tab), and N (new-line) added as highlighting only.

Try it online.

Explanation:

I use the approach explained in this Whitespace tip of mine. The approach described is as follows:

  • First push the values minus a constant value for every character we want to output in reversed order to the stack
  • Then create a LOOP, and inside this loop we do:
    • Pop the current top of the stack
    • Add the constant value to this current value
    • Print this new value as character to STDOUT
    • Go to the next iteration of the loop
  • This will exit with an error that it needs two values on the stack when using the add function after we've outputted every character.

The ideal constant value was 94, which I've generated with this Java program. Using 94 would give a Whitespace program with a total length of 7508 bytes (7481 + 27 bytes for the loop), or 5791 bytes (5764 + 27) if we already implement Duplicate Top (SNS) wherever two of the same characters are adjacent.

After that I manually used Copy 1st (STSSTN), Copy 2nd (STSSTSN), and Copy 3rd (STSSTTN) (1-indexed) wherever it would save bytes. Which can also be found at the Whitespace tips. Which in total resulted in the 4584 bytes program you see here.

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

05AB1E, 204 bytes

" '(+-./:O\_|"•5ñǝ¶P
вUÅxSǝTѸ;ÕØ+F&нλ–?°тW¬¬0ZÂ*d’E9U<Tèñˆwãœ&ì‰0Kíš7ùθ²£PŸíн¥°8{²wëp¥‡Λ¿®gs0₂.ÙmòÓÛ‚ÄîÅß∍Ô!мH{gµJõa¦ñCÅ2’‡†ºÞ§Tx]š\å≠„”ak…²¥\‘ôVиHâθDëX₄à&*%ƒ²í3ߨÑ:r‹ÈOê.‡}¬ú[@ÊǝªZ˜f¬Î†Ÿ!1в•12вèR17ôJ».º

Try it online.
Verify that it's correct.

Explanation:

" '(+-./:O\_|"  # Push string " '(+-./:O\_|"
•5ñǝ¶P
вUÅxSǝTѸ;ÕØ+F&нλ–?°тW¬¬0ZÂ*d’E9U<Tèñˆwãœ&ì‰0Kíš7ùθ²£PŸíн¥°8{²wëp¥‡Λ¿®gs0₂.ÙmòÓÛ‚ÄîÅß∍Ô!мH{gµJõa¦ñCÅ2’‡†ºÞ§Tx]š\å≠„”ak…²¥\‘ôVиHâθDëX₄à&*%ƒ²í3ߨÑ:r‹ÈOê.‡}¬ú[@ÊǝªZ˜f¬Î†Ÿ!1в•
                # Push compressed integer 82884728546083544802114826866811347888294234139952249449993042546851026466586575621019053395214928564814179141524271139630560365410986413280485520009435856058156273218115974685512908452464400236161169136625844093046037549003472551358816347180245088496758636921040209372081258608689916152211637687400211864355841371146514354551178114229365000601858316896536398050410654536115253951187868762637231796211074036336817668524952
 12в            # Convert it to Base-12 as list: [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,6,11,11,10,10,10,10,10,10,10,10,10,6,10,10,10,10,11,11,11,9,0,0,0,0,0,0,0,6,0,0,0,0,0,11,11,7,0,5,1,0,0,1,5,6,9,0,0,0,0,0,11,11,11,0,0,0,10,10,0,6,0,0,5,1,0,0,0,11,11,7,5,4,4,4,5,6,9,1,0,0,0,10,1,5,11,11,11,0,0,0,0,6,0,0,0,9,0,1,5,0,6,11,11,7,10,5,10,6,9,0,0,0,1,9,0,0,11,0,11,11,11,0,0,6,0,0,9,1,5,0,11,0,0,11,0,11,11,7,10,9,9,0,1,5,9,0,0,1,9,5,0,9,11,11,8,2,6,0,9,0,0,0,9,0,0,0,9,0,0,11,11,3,2,9,10,6,10,10,10,6,10,10,10,6,10,10,11,11,7,0,6,6,0,5,1,6,0,0,5,6,1,0,6,11,11,11,10,0,9,0,0,6,5,1,0,11,0,0,11,0,11,11,7,0,1,0,9,6,0,0,0,5,6,0,0,11,0,11,11,11,10,0,10,10,9,0,0,1,6,0,5,1,0,9,11,11,7,1,4,4,4,1,9,6,0,0,0,0,0,5,1,11,11,11,0,0,0,0,0,0,9,0,0,1,5,10,10,0,11,11,7,0,1,5,10,10,5,1,9,6,0,0,0,0,0,11,11,11,6,0,0,0,0,0,0,0,9,0,0,0,0,0,11,11,11,0,0,0,0,0,0,0,0,0,9,0,0,0,0,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,9,11,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,0]
    è           # Index each into the string
     R          # Reverse the list of characters
      17ô       # Split it into chunks of size 17
         J      # Join each chunk of characters to a single string
          »     # Join the list of strings by newlines
           .º   # Mirror it with overlap (and output implicitly)
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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