92
\$\begingroup\$

It's that time of year when many of us get our advent calendars! If you are unfamiliar with an advent calendar, these are special calendars used to count down advent in anticipation of Christmas. In my experience the doors are placed randomly, and part of the fun as a child was working out where tomorrow's door was! Often these days, calendars have chocolates behind each door, but instead of buying an advent calendar this year, you should build an ASCII one!

Task

Given input of an integer (n) in the range 0-24, produce an ASCII advent calendar with the numbered doors up-to n, opened. You must use the same order as in the below example: 2, 17, 8, 12, 1, 6, 11, 20, 5, 22, 3, 10, 15, 23, 7, 16, 9, 24, 18, 4, 13, 19, 21, 14.

Doors

The closed door must be:

.-----------.
|           |
|           |
|           |
|       nn  |
|___________|

where n represents the number of the door (leading zeros are optional) and the opened door is:

.-----------.
|\          |
| |         |
| |         |
| |         |
| |_________|
 \|

except for door 24, which is instead:

.--------------------------.
|                          |
|                          |
|                          |
|                      24  |
|__________________________|
.--------------------------.
|\                         |
| |                        |
| |                        |
| |                        |
| |________________________|
 \|

These doors are arranged within a frame of 37 lines of 79 characters, with two spaces between each column, and an empty line between each row.

Opened Doors

When the doors are opened you must display one of the (tenuously Christmas related - apologies for my terrible art skills!) pictures below within the door:

 . _ .    _'_        +       .^o     _(")_     _n_       $        .     
 }\O/{    ) (^.^_   /~\     (';')   (_ . _)    (")      |,|    __/ \__  
 }/*\{    \./v`v'  /~*~\   {\|+|/}   / : \   >( o )<    | |    `.   .'  
 /***\     oO8    /~*~~*\    d-b    (_/ \_)  (  o  )  ._|_|_.   /.^.\   

 .\^/.     ____   __.==,_    .*.     _   _    . . .   _______   _   _   
<->o<->   /_%_/|  --|XX|-    /.\    (O X O)  .i_i_i.  _j_j_j_  ( `v' )  
 '/v\`   |_|_| |   _|  |    |_-_|    / ^ \   |-~~-~|   ||__|    \   /   
         |_|_|/   (____'   (.-o-.)   \/ \/   |_____|  _|/$$|_     V     

   i       |~|     //'`\     |=|    _{/ _{/   ,   *   \  ====     b     
 .'%'.     | |    //....\    / \      \_/    +  . +   \\\|+-|   .'''.   
|^~~.~|     Y     ||()()|   |(%)|     /O \     . ' .  \\\\\+|  {*=*=*}  
_'._.'_    _|_    ||_[]_|   |___|   @__,/\\  ~~~~~~~  \\\\\\\   '._.'   

    _    |  _  |  .W. .W.  .&%$+*.    \O/       .;'   ..,.;..   ('v')    
  .'.'O  | ($) |  |*| |*|  */'"'\&  [ ]|_.     .m_.   |\\|//|  //   \\   
 /___\   |  " o|  |*| |*|  $\._./%  |_____)   C|  |    \\|//   |\   /|   
(_____)  | === |  'M' 'M'  '%&*+$'  ------'    |__|    _=|=_     Y Y    

 \   /      .==.    .-.     -._.-   __/\__     ...       .-.   
._o_O_.  .--'  |  \|   |/    .+.    \_\/_/    '*  `     //`);  
|/\/\/|  \_____/  /|   |\   ( W )   /_/\_\   |_/\*_|   %%      
"""""""  `====='    '-'      `"`      \/     [_____]  //       

Each image is 7 characters long and covers 4 lines so they will fit within the windows. You are free to choose any of the above images and use them in any order, but you may not repeat an image. For the 24th, you must also add a message:

       ~       
   ~ MERRY ~   
 ~ CHRISTMAS! ~
     ~~~~~     

which fits alongside one of the above pictures, you can choose whether the text is to the right or the left of the image.

Examples

Given input 0, output the calendar with no doors opened:

.-----------------------------------------------------------------------------.
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |        2  |  |       17  |  |        8  |  |       12  |  |        1  |  |
|  |___________|  |___________|  |___________|  |___________|  |___________|  |
|                                                                             |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |        6  |  |       11  |  |       20  |  |        5  |  |       22  |  |
|  |___________|  |___________|  |___________|  |___________|  |___________|  |
|                                                                             |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |        3  |  |       10  |  |       15  |  |       23  |  |        7  |  |
|  |___________|  |___________|  |___________|  |___________|  |___________|  |
|                                                                             |
|  .-----------.  .-----------.  .--------------------------.  .-----------.  |
|  |           |  |           |  |                          |  |           |  |
|  |           |  |           |  |                          |  |           |  |
|  |           |  |           |  |                          |  |           |  |
|  |       16  |  |        9  |  |                      24  |  |       18  |  |
|  |___________|  |___________|  |__________________________|  |___________|  |
|                                                                             |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |           |  |           |  |           |  |           |  |           |  |
|  |        4  |  |       13  |  |       19  |  |       21  |  |       14  |  |
|  |___________|  |___________|  |___________|  |___________|  |___________|  |
|                                                                             |
|_____________________________________________________________________________|

For input 5, output something similar to:

.-----------------------------------------------------------------------------.
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\   . _ .  |  |           |  |           |  |           |  |\  __.==,_ |  |
|  | |  }\O/{  |  |           |  |           |  |           |  | | --|XX|- |  |
|  | |  }/*\{  |  |           |  |           |  |           |  | |  _|  |  |  |
|  | |  /***\  |  |       17  |  |        8  |  |       12  |  | | (____'  |  |
|  | |_________|  |___________|  |___________|  |___________|  | |_________|  |
|   \|                                                          \|            |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |           |  |           |  |           |  |\  _{/ _{/ |  |           |  |
|  |           |  |           |  |           |  | |   \_/   |  |           |  |
|  |           |  |           |  |           |  | |   /O \  |  |           |  |
|  |        6  |  |       11  |  |       20  |  | | @__,/\\ |  |       22  |  |
|  |___________|  |___________|  |___________|  | |_________|  |___________|  |
|                                                \|                           |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\    _n_   |  |           |  |           |  |           |  |           |  |
|  | |   (")   |  |           |  |           |  |           |  |           |  |
|  | | >( o )< |  |           |  |           |  |           |  |           |  |
|  | | (  o  ) |  |       10  |  |       15  |  |       23  |  |        7  |  |
|  | |_________|  |___________|  |___________|  |___________|  |___________|  |
|   \|                                                                        |
|  .-----------.  .-----------.  .--------------------------.  .-----------.  |
|  |           |  |           |  |                          |  |           |  |
|  |           |  |           |  |                          |  |           |  |
|  |           |  |           |  |                          |  |           |  |
|  |       16  |  |        9  |  |                      24  |  |       18  |  |
|  |___________|  |___________|  |__________________________|  |___________|  |
|                                                                             |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\     +    |  |           |  |           |  |           |  |           |  |
|  | |   /~\   |  |           |  |           |  |           |  |           |  |
|  | |  /~*~\  |  |           |  |           |  |           |  |           |  |
|  | | /~*~~*\ |  |       13  |  |       19  |  |       21  |  |       14  |  |
|  | |_________|  |___________|  |___________|  |___________|  |___________|  |
|   \|                                                                        |
|_____________________________________________________________________________|

For input 14:

.-----------------------------------------------------------------------------.
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\   . _ .  |  |           |  |\     .    |  |\    ____  |  |\  __.==,_ |  |
|  | |  }\O/{  |  |           |  | | __/ \__ |  | |  /_%_/| |  | | --|XX|- |  |
|  | |  }/*\{  |  |           |  | | `.   .' |  | | |_|_| | |  | |  _|  |  |  |
|  | |  /***\  |  |       17  |  | |  /.^.\  |  | | |_|_|/  |  | | (____'  |  |
|  | |_________|  |___________|  | |_________|  | |_________|  | |_________|  |
|   \|                            \|             \|             \|            |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\      _   |  |\     $    |  |           |  |\  _{/ _{/ |  |           |  |
|  | |   .'.'O |  | |   |,|   |  |           |  | |   \_/   |  |           |  |
|  | |  /___\  |  | |   | |   |  |           |  | |   /O \  |  |           |  |
|  | | (_____) |  | | ._|_|_. |  |       20  |  | | @__,/\\ |  |       22  |  |
|  | |_________|  | |_________|  |___________|  | |_________|  |___________|  |
|   \|             \|                            \|                           |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\    _n_   |  |\   _(")_  |  |           |  |           |  |\    |=|   |  |
|  | |   (")   |  | | (_ . _) |  |           |  |           |  | |   / \   |  |
|  | | >( o )< |  | |  / : \  |  |           |  |           |  | |  |(%)|  |  |
|  | | (  o  ) |  | | (_/ \_) |  |       15  |  |       23  |  | |  |___|  |  |
|  | |_________|  | |_________|  |___________|  |___________|  | |_________|  |
|   \|             \|                                           \|            |
|  .-----------.  .-----------.  .--------------------------.  .-----------.  |
|  |           |  |\  \  ==== |  |                          |  |           |  |
|  |           |  | | \\\|--| |  |                          |  |           |  |
|  |           |  | | \\\\\-| |  |                          |  |           |  |
|  |       16  |  | | \\\\\\\ |  |                      24  |  |       18  |  |
|  |___________|  | |_________|  |__________________________|  |___________|  |
|                  \|                                                         |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\     +    |  |\    ,  *  |  |           |  |           |  |\     i    |  |
|  | |   /~\   |  | | +  .  + |  |           |  |           |  | |  .'%'.  |  |
|  | |  /~*~\  |  | |  .  ' . |  |           |  |           |  | | |^~~.~| |  |
|  | | /~*~~*\ |  | | ~~~~~~~ |  |       19  |  |       21  |  | | _'._.'_ |  |
|  | |_________|  | |_________|  |___________|  |___________|  | |_________|  |
|   \|             \|                                           \|            |
|_____________________________________________________________________________|

For input 24:

.-----------------------------------------------------------------------------.
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\   . _ .  |  |\   //''\  |  |\     .    |  |\    ____  |  |\  __.==,_ |  |
|  | |  }\O/{  |  | | //....\ |  | | __/ \__ |  | |  /_%_/| |  | | --|XX|- |  |
|  | |  }/*\{  |  | | ||()()| |  | | `.   .' |  | | |_|_| | |  | |  _|  |  |  |
|  | |  /***\  |  | | ||_[]_| |  | |  /.^.\  |  | | |_|_|/  |  | | (____'  |  |
|  | |_________|  | |_________|  | |_________|  | |_________|  | |_________|  |
|   \|             \|             \|             \|             \|            |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\      _   |  |\     $    |  |\    |~|   |  |\  _{/ _{/ |  |\   . . .  |  |
|  | |   .'.'O |  | |   |,|   |  | |   | |   |  | |   \_/   |  | | .i_i_i. |  |
|  | |  /___\  |  | |   | |   |  | |    Y    |  | |   /O \  |  | | |-~~-~| |  |
|  | | (_____) |  | | ._|_|_. |  | |   _|_   |  | | @__,/\\ |  | | |_____| |  |
|  | |_________|  | |_________|  | |_________|  | |_________|  | |_________|  |
|   \|             \|             \|             \|             \|            |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\    _n_   |  |\   _(")_  |  |\  |  _  | |  |\  .W. .W. |  |\    |=|   |  |
|  | |   (")   |  | | (_ . _) |  | | | ($) | |  | | |*| |*| |  | |   / \   |  |
|  | | >( o )< |  | |  / : \  |  | | |  " o| |  | | |*| |*| |  | |  |(%)|  |  |
|  | | (  o  ) |  | | (_/ \_) |  | | | === | |  | | 'M' 'M' |  | |  |___|  |  |
|  | |_________|  | |_________|  | |_________|  | |_________|  | |_________|  |
|   \|             \|             \|             \|             \|            |
|  .-----------.  .-----------.  .--------------------------   .-----------.  |
|  |\   _   _  |  |\  \  ==== |  |\  .&%$+*.       ~        |  |\    \O/   |  |
|  | | (O X O) |  | | \\\|--| |  | | */'"'\&   ~ MERRY ~    |  | | [ ]|_.  |  |
|  | |  / ^ \  |  | | \\\\\-| |  | | $\._./% ~ CHRISTMAS! ~ |  | | |_____) |  |
|  | |  \/ \/  |  | | \\\\\\\ |  | | '%&*+$'     ~~~~~      |  | | ------' |  |
|  | |_________|  | |_________|  | |________________________|  | |_________|  |
|   \|             \|             \|                            \|            |
|  .-----------.  .-----------.  .-----------.  .-----------.  .-----------.  |
|  |\     +    |  |\   ,   *  |  |\     |    |  |\    .*.   |  |\     i    |  |
|  | |   /~\   |  | | +  . +  |  | |  .'''.  |  | |   /.\   |  | |  .'%'.  |  |
|  | |  /~*~\  |  | |   . ' . |  | | {*=*=*} |  | |  |_-_|  |  | | |^~~.~| |  |
|  | | /~*~~*\ |  | | ~~~~~~~ |  | |  '._.'  |  | | (.-o-.) |  | | _'._.'_ |  |
|  | |_________|  | |_________|  | |_________|  | |_________|  | |_________|  |
|   \|             \|             \|             \|             \|            |
|_____________________________________________________________________________|

Rules

This is so the shortest code in bytes, in each language, wins.

  • Any reasonable format can be used for I/O assuming it is consistent.
  • Any amount of whitespace before and after the calendar is fine, as well as additional spaces/unprintables at the end of each line, but nothing before each line as this must fit into 80 characters.
  • All standard loopholes are forbidden.

Thanks

James Holderness for contributing ASCII images!

\$\endgroup\$
1
  • 15
    \$\begingroup\$ This is so cute! \$\endgroup\$ Commented Nov 30, 2017 at 17:37

9 Answers 9

40
\$\begingroup\$

Charcoal, 666 bytes

J⁶³¦³⁰←×⁷⁷_↑³⁶.→⁷⁷↓.↓³⁶↖J±⁷±⁴”}➙◧﹪ε⎆T⎆¿⊘W?⁸ω⁷{↙n,θ<YθTLUeK%I(+↥C…hχRνGζ)ητR✳⮌⁹πj,⊞R∕!lD)CN✳χG-=ê⊕l⟧RP↙§m∧E⁴F≧GW!↨⪪⟧⟦⟦X=G﹪ς←´:¦B^⟲⊟H⌀SM⦃}´↶E$zfI⮌εÞ⁶ι⟦⁺~W]XιθZ¦@|θ⦃‴1₂↑dA=÷PTι^V⪪Na÷⌈b#lQ+;BT⟲⌀6↑↥\⁺◨ⅉ8'Àq;?.6μ″D⎇M3§ν⁻φG>2Σ¿⟧u←@6nh¹⮌↧,‴¹f↧M⁵|Dυχ¶3⊘>γQ·UB×NO³{Lκ3¤³ν⊕φβ.¤+xl⁷MΠ⦄η+L➙⁺[Dσ◧;≔e=F⊘ξρHλκL`S"d|N℅⊗0§χ~vH⍘À§⊕g↖c@Π]R¦⎆πEx⁶⪪~;⸿j}⊗⊙↷A‹›N·?CX[´m'Jχ0`-⪫νd⪫⎆/M⍘ζG&G⟲F¿G⍘×.#ςςm≧ω²Eⅉmv`⊞ω9Þ·'ZNN→J&γQ«T~_J6◨z⪫OBg¤upε↷~⁵T«P{Zr»λ≔u⧴⁰ⅈ|≕q⊕≔χz⮌…@MυA➙⭆/TLF}¤N*N⁰⁶↖¬∕κE>α;|W"h↙⊘⁹}Σ1⁰g⮌FRü0AÀ⊗"⁸$”F⁵F⁵«J×¹⁵ι×⁷κ←×¹¹_↑⁵.¹¹↓.↓⁵»F²³«J×¹⁵I§”o⊞O↧▷⁰$ê;”¦ι×⁷I§”o⊞-Y~Fι,]”¦ι¿‹ιIθ«Mχ←↓ →\↑⁵← \»«↖UO±⁷±⁴ ←←⮌I⊕ι»»J³⁴¦¹⁷↓  H ←____↗↑ ~  ⁴¿‹²³Iθ«J²⁰¦¹⁷↘¹↓⁵↖↑\ »«J⁴⁴¦²⁰UO±²²±⁴ ← 42

Try it online! Link is to verbose version of code. Not really golfed, but I'm not sure I want to...

J²⁵¦³⁰←×_³⁸↑³⁶.→³⁸‖OF²⁴«J×I§”o⊞∧№qGo⁴↨'”¦ι¹⁵×I§”o⊞Þ‹wα≕YQ”¦ι⁷≔⎇⁼²³ι²⁶⊕χη←×_η↑⁵.η↓.↓⁵↑¿‹ιIθ«Mη← ¶\↑⁵← \M⁴→…⪪✂”}⊞μ↓↙J∧W⎚2⁻⁹]jι|T◨%êⅈπ↔{Mⅈ⎇_u9⁹F⪫4AGhd⪫CNb↷a^AnQ⌀oV←×⟦c″⁵FιO↗ωsXςb⁶β|(α)ⅈ,gB№$¹ξU=◨↷…Yn´;⎆Σd$=1%▷≦″“}υ⌈ν§V?Wξ⌈‖⦃⊗↓⎚K⎚✳V✳V?↗⎆¶﹪⊙⟦≧*(▶″$Q;\⟲↶A⊗s≧»Πj⁸⎆↑´T≡⁵K⊙αηI3⊙✂“↗⌕N~e%⬤Iη◨γ·y⁸_Gλ↙%EO)⎆$YP“¦7ê⁵№¹▷⟦α)ν&℅◨⦄S“⁹aEX>➙8)↨§+φ✳⁸WR&;⎚◧⎆¬▶B³u▷J±÷δ+⁺↖M≧;↧χw➙Oθ✂⁺⁶r⟦GεCVY↖<⁻◧⁹DK‴1⌀✂$k\φ{0·M℅,ρ)S⎇⸿3oψJ5$\`↗⁰⊙0c¤?&?⌕↗Uε¦⎆~b&d⊞÷f¬;T-χUnν⁶{⊖″;f._⟦#⊗V2⍘¬T.(⁻<V⊗№êx⊕₂⦃ΣσGτ¹yΣ2⁶⧴em⁷WÀI>]≔A↘_2↓⁴⸿¦y⌕ⅉ﹪B7”×ι²⁸φ¹⁻η⁴¦⁴»«↖←←←⮌I⊕ι

Try it online! Link is to verbose version of code. This is a version that draws the presents separately for 577 541 530 bytes after I've stolen several ideas from @Charlie to golf a few more bytes off.

\$\endgroup\$
2
  • 61
    \$\begingroup\$ Satan Clause is coming to town. \$\endgroup\$
    – LiefdeWen
    Commented Nov 30, 2017 at 12:47
  • \$\begingroup\$ Don't worry, I also borrowed a couple of ideas from you, so we're even. :-) \$\endgroup\$
    – Charlie
    Commented Dec 1, 2017 at 5:47
25
\$\begingroup\$

Charcoal, 676 639 614 607 598 590 564 561 bytes

P⁴⁰↓.↓³⁷M↗׳⁹_‖OF²⁴«≔⌕”%↖∧F◨℅V⊖⎚λJ↷;φε⊟ ↧”§βιε≔⎇⁼²³ι²⁶⊕χαJ×﹪ε⁵¦¹⁵×÷ε⁵¦⁷M³¦².α↓.↓⁵↖←×⁻α²_¿‹ιIθ«M±¹±⁴↘¹↓⁵↖↖\↑⁵M⁴¦¹EE⁴⁺×﹪ι⁸¦⁷×⁵⁶⁺κ×⁴÷ι⁸✂”}⊞r⌕⁸⸿‹;β/|∧±⪪I÷=EE%±÷ü5>ü⊘-▶⁹⦃vy⌈#$“o⊟ⅈ‖zMq‖s0YV↔↔|⎈⁹'⁸γ₂βxM¿yH⌕.➙↧↘⁻³]υ|tψ⧴À‹>8Φπ;V}Qλjgd↔⟲|WU(‖J⁴⁹XJx#aα➙?⁰N@⁵=πX⭆›*≡ηΦzgQ±tJ;∨≦K⪫9⁸πcω2-0CγN8|x43,BDua←A9M№»⎚‴dN|k9<·⊖R?Tρe»∧=₂₂~⁰i³e4⮌↖λ″OÞν%≧Jj◧SLÀ·Π_B₂Tσ-*¬y&XWP›J↔À≕²ψT↘b▶“ζX↙ΣψSCμ#×I?K%H6Kⅉ⁸OH…⁸Uⅈ«j×⟦χ~gP% ¦◨⦄⟲24;⦄▷Y>≕À▶;DψJψYN(N-⊞K‹▷⦃Ug∧⦃8⊕|·HO;JZ⎇*>GPM⮌Σ�“P²⁼↶w66›λ⁼±⧴ι⊟uβρ⁻C⊙Z+%oΣVLtY1O≦ O|ηf±h﹪φ⊟”¦κ⁺κ⁷M⁸±⁴¿⁼²³ι”¶<↑?≡DTh¤WSWV~≔✂r₂b…wSεGl≔TêE¶(…R↘�”»«←__↑⁵M⁻Ღ⁴←⮌I⊕ι

Try it online!

Here you have the verbose version of the code, quite understandable. My approach is the opposite from @Neil's. He draws all the gifts and then covers those not needed. I only draw the gifts needed.

  • 5 bytes saved thanks to Neil!
\$\endgroup\$
5
  • \$\begingroup\$ Save 3 bytes: Print(Map(Map(4,Add(Times(Modulo(i,8),7),Times(56,Add(k,Times(4,IntDivide(i,8)))))),Slice("...",k,Add(k,7)))); instead of the for (4) loop. \$\endgroup\$
    – Neil
    Commented Dec 1, 2017 at 9:07
  • \$\begingroup\$ @Neil I understand your code and it seems a good idea, but I cannot get it to work on TIO. \$\endgroup\$
    – Charlie
    Commented Dec 1, 2017 at 9:22
  • \$\begingroup\$ Don't try to copy/paste it; Stack Exchange inserts zero-width characters into comments. \$\endgroup\$
    – Neil
    Commented Dec 1, 2017 at 9:53
  • \$\begingroup\$ @Neil That must be the reason, because when I wrote the code myself suddenly it started to work. :-) \$\endgroup\$
    – Charlie
    Commented Dec 1, 2017 at 9:59
  • \$\begingroup\$ Oh, it's a 5 byte saving? My fault for trusting Charcoal's l option... \$\endgroup\$
    – Neil
    Commented Dec 1, 2017 at 10:02
24
\$\begingroup\$

Python 2, 1322 1319 1287 1265 1061 1059 1056 1032 1030 bytes

n=input();k=' '
print'.'+'-'*77+'.'
for l in'','','\n','	','\r':
 for L in zip(*[['| ']*7]+[['.'+'-'*q+'. ']+['|'+[(['\  ']+[' | ']*6)[j]+"eJxNUkFuGzEM/Mo0qKFd2Uvdm7pAERRoD0bgpIoTRDGNoJcc2tx6saK3d0a7CEphwSVHpIYjweAwZLyV63SWT7HIpxhjwR7wPw7GGC5G+i8DXjF+zgPoMe4xmdsk3NamfQMOGBWfLk5QvR1fez5cBubPpa5reiP+a3oW7uzryINY+Mhz8QlFcUJx9gc+op9fN3X2kDevXCbchHvf7/mkyAL72NFm/jTN4ytPNauKHWafsHe37XbjeZrq/X2dMojyAJ5PC6y3vrK9OJflOrU2NdXLKvnzPPHH6W8A+RfGSTxxhz5/bf/zZu5hnocEZnw755NKM+qwGqu82hPfcHdEXmvOddcZAZbbbJr/ufezEAJ5nuOWi/oG3ov4d3q9Lli4lg7uZZmv68t7J/6IJ8qJZa6ReshC1/cy9PrfwnE16wMRrL0/BbRs3MxcLr0+5dNWFqhvKtK/eEm8opwUF9WXJH3sQHkP1DVSn1jffdgF8FP/l2W+learx9aM+nufz/W+rL+7EPnkxD+V6DU/dh5Pql/j3driJXcrS2r37ebmoUNUp0XlG66+3/y4/bn7evsBLSvb4rJf1v/+AYT9zU8=".decode('base64').decode('zip').split('Q')[i-1].split('U')[j],k*(q-4)+'%2s '%(`i`*(j>2))][i>n]+' | 'for j in 0,1,2,3]+[['| |'+'_'*e+'| ','|'+'_'*q+'| '][i>n],[' \|',k*3][i>n]+k*q]for i in map(ord,l)for(q,e)in[[11,26,9,24][i>23::2]]]):print k.join(L),'|'
print'|'+'_'*77+'|'

Try it online!

-4 bytes thanks to Mr.Xcoder

-24 bytes thanks to Lynn


Compressed version (thanks to Lynn and ovs):

Python 2, 1021 1017 1013 bytes

exec'eJxNVG1P2zAQ/s6vuFWrHDuOQ1JGWVmRJjRpk6hQYR6gOLhCY1IK6wuwfRgmv33POWHaRdX17nxvj323mjarza+nRB7eTQWJnc1Ds3oSRqQiE2o8TvF358f6ge6pWVWlLsb6QBfgta72dVHocle/02UJcaSLXV1AGOkxxGJfv9flni4OIIDBDLnQxV492SEOeYKQ9KfZJKqqRCBRq3GdVkn1mn2L5NCmMIqod9SJFA/vy2pZp4PBgAx5/Cy9uNP8mXmuHPNcKeVoTuRXniBTMpDgRwmtSX6wCYGTnFNmvMnYblLD5xK6IMnyYrAg9jfX66gXhwL6ZxfSkL/A/j27YbtHXE824Sq8RF6akGM5J+cRn+gtxfxBh44Tc+MDPsN2w3Yfz3u7YMkIxDHXpqsfxP34oc+DZS9E6HhOc+/NdKq9zbJweRkyS7AiAfKDBPxN/KxpPD5jQ9a2Wcv+TAH1Ix/XT4vfglA/cEYPqJO+Uew/tP/XDd1V1w8K6OzTTp+zq6WQDGVgzuFh1zityKbcZxpxJkHGth1x/zcxnhECN26f1RQf8BW4F64/lhf98DROGQfvXd9fxBf3DntFNeCkvi8JPJhExPdQRP+fbKfjDh/iAkOMDwCNNTgMnXXRP7eLKZMAvrlj/J13Oa7I5iw79nc542MuAO8FcFXAR4V/XMwwULOYv+n7G3J/4bptDfD3sT/P78vEdycUnhzXnzvlg61iHTX7p/SP2p4z3K3rVbNPZ2dX0QR0WsX6lo4/n305/zr7eP6GWsvaVvXnmeI/TI953Nw3T4mYC1k1WVG/ylbwfOk7lWyzPZmKYflIYpgsmoVKlkellHXVHK3qNE4jj/OSxxkbQJd6hCnlkcbcCi/UbcrjrUUvbqPYuWtMswsCaUZ9vDu1rSXHazjePW+KZKtvJdZPxfumWyt8uBxNJmVd13ISlxbdmeW6WSUnkjP1i6xPyYsMur+PXj21'.decode('base64').decode('zip')

Try it online!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ This is extremely impressive. Well done! \$\endgroup\$ Commented Nov 30, 2017 at 12:57
23
\$\begingroup\$

Befunge, 1220 1198 1186 bytes

<v5,,$$_\#!:,#-\#1<,".N-."+55p00&
v>1-:10p:1-!30p7>1-::0`\5`+3+8g40p::6\`\1-!+6+8g50p" |",:,,:530g
>-1-:20p:1-!30g* 35**60p10g5*+9+8g57*-:70p00g`!\6\`*40g,v
|01g07p09!`3%7+5 :p08+*27-\*4/8-1g07:,g05,g8+2`4:,g8!%5:_:2-v
>-8%7*60g7+:!v!:-1\+1,+*g05< v!\$_1#!-#:\:#,<:g05-*3\+9g06:!<
# +%68*+,:,v$_\: 80gg90g*:!^v_70g:55+/:68*+\!88+*-,55
^^<<<<0<<<<>$50>0$#<>#5g#$,#<40g,48*:,,:v>1
"|_M|"+55_^#!:$_^#!,,"|"+55$_>#!:$#g02$#<^v!:\,<
 \| |.- _1860'5;,3#*:2-&9(7.)$/+4%   @,,$$_1-\:^
   +    _(")_   _n_     $      .     ____ __.==,_  |~|
  /~\  (_ . _)  (")    |,|  __/ \__ /_%_/|--|XX|-  | |
 /~*~\  / : \ >( o )<  | |  `.   .'|_|_| | _|  |    Y
/~*~~*\(_/ \_)(  o  )._|_|_. /.^.\ |_|_|/ (____'   _|_
 . . .  _   _    i   _{/ _{/    _     b   \  ====   .-.
.i_i_i.( `v' ) .'%'.   \_/    .'.'O .'''. \\\|+-|  //`);
|-~~-~| \   / |^~~.~|  /O \  /___\ {*=*=*}\\\\\+| %%
|_____|   V   _'._.'_@__,/\\(_____) '._.' \\\\\\\//
  \O/  __/\__  ('v')  \   /    .==.   .;'   ...  .&%$+*.       ~
[ ]|_. \_\/_/ //   \\._o_O_..--'  |  .m_.  '*  ` */'"'\&   ~ MERRY ~
|_____)/_/\_\ |\   /||/\/\/|\_____/ C|  | |_/\*_|$\._./% ~ CHRISTMAS! ~
------'  \/     Y Y  """""""`====='  |__| [_____]'%&*+$'     ~~~~~

Try it online!

Might still be possible to golf this further by compressing the pictures, but that would likely require the use of extended ASCII characters which aren't currently supported on TIO.

\$\endgroup\$
5
  • \$\begingroup\$ How is Extended ASCII not supported? \$\endgroup\$
    – Adalynn
    Commented Dec 1, 2017 at 16:37
  • \$\begingroup\$ @Zacharý On TIO the Befunge interpreters are configured to use a UTF-8 character set, so if you try to include an extended ASCII character in the source, it will be converted into some multibyte UTF-8 sequence instead. \$\endgroup\$ Commented Dec 1, 2017 at 19:29
  • \$\begingroup\$ Is one of the Befunges you used for the befunge-polyglot answer able to handle extended ascii? \$\endgroup\$
    – Adalynn
    Commented Dec 1, 2017 at 21:11
  • 1
    \$\begingroup\$ @Zacharý It's not the interpreter that's the problem - most interpreters can handle extended ASCII just fine. The problem is in the way TIO translates the webpage input before it passes it on to the interpreter. \$\endgroup\$ Commented Dec 1, 2017 at 23:29
  • \$\begingroup\$ I love that the pictures are fully visible in this! \$\endgroup\$ Commented Dec 5, 2017 at 17:42
13
\$\begingroup\$

Python 3 + numpy,
1164 1159 1123 1103 1097 1065 1061 996 994 bytes

Compress all things and use numpy to bind them together.

First build closed doors, then replace the doors that need to be opened. Finally, output everything.

-22 bytes thanks to Mr. Xcoder.
-5 bytes thanks to notjagan.

EDIT: <1000 bytes!

import lzma,base64,numpy
def g(i):
 a,b,c=[numpy.array([*map(list,i.split('#'))])for i in lzma.decompress(base64.b85decode('T>t=p0RR90|NsC0{{R;Yb2=9ZB3vrGRZhN&js}K8Jmx>v0UA+%!XNuvypanfw-On6yWAqj;f`A@KhRXYG|EfWG~vnf74-|TMD9O<F~(ETm1ht`IL9PRn$&D6@Y`ipqj|2Ks2<w>M0$9alb)6kEp5V>=}iliy4by-zIAEIDqtxiie`c-6+Y_|0z6A#o^?bVc8rNg(dZq)&RMVNZfUWe9`uW87eke^e(U)p=MxBK<aHfTf^JIaEkVa{$4ct<>U}>seZ>tXR2yYjN4W~W;4T16Lv_gAVbahgLo23$DPcrdfNc#QKNxGKmP}?>l;j`Eqj*EArIMnEHDC^u(JA0-eXP$Dx!}mqnSiX}lV507wtt#)-Y{K8q<bZx*3<UiIyS__cP#9?=eN*+sh{-OgeVPlr}`jFjZnFR5NVI(DC8>d%B9EZ=gGyMp)jVbx#uVGLDHNS8Ht`@nS~?ji$ls${$28WROQ@UlY>?I1yXSuWNx7+$YlLSM2tP^f1Vl92;=q~#2jV2qwZB}$El*yJ9lpEpg5&X=pYfDIT;IHs;wMLzIOhXWsm-1n5J{Afro^Zv~Fw$_ylaND7>_!(y1hiO*la?Xms}*M82nm86zo6Lpf%>K)!16qKK7m8<A!0_88GZtXScr*7YoejPFWfmdKNN&;MKgQUoU')).decode().split(':')]
 if i>23:a[23:27,45:59]=c[:,168:]
 while i:i-=1;h=ord('EAKUIFOCQLGDVYMPBTWHXJNR'[i]);v,u=h//5*7-89,h%5*15+6;a[v:6+v,u-3:u]=b;a[v:4+v,u+1:u+8]=c[:,i*7:i*7+7]
 for i in a:print(''.join(i))

Try it online!

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

C (gcc), 1296 1291 1211 1166 1164 bytes

That super-long string, though (59% of the whole thing!). There's gold in them hills; I can feel it.

Edit: If there is gold, I've only found specks so far.

Edit: -2 bytes thanks to ceilingcat

#define D"BQHLAFKTEVCJOWGPIX@RDMSUN"[p=r*5+c]-64
#define O D<=n
#define P printf(
#define G(x)for(x&&P"  |\n|"),c=0;w=D^24?7:22,c<5;c+=1+(D==24))
#define m(c,n)memset(calloc(n+1,1),c,n)
char*x[]={"_|","\\","33 ","6 ","__",".'","  "," ."},*v,*u;U(char*q){for(;*q;q++)*q>47&*q<56?U(x[*q-48]):(*u++=*q);}t[4],r,c,s,w,p;f(n){P".%s.\n",m(45,77));for(v=u=m(r=0,732),U(".W.7W.|*| |*||*| |*|'M' 'M'_'_3 ) (^.^_1./v`v' oO833+36/~13/~*~1 /~*~~*16.^o3(';') {1|+|/}6d-b3_(\")_ (_7 _) / : 1 (_/ 1_)6_n_3 (\")6>( o )<(6o6)3$36|,|3 | |6.00_.3.34/ 14`.35 /.^.16.1^/. <->o<-> '/v1`23446/_%_/||00 ||00/ 4.==,_--|XX|- 06| (44'3.*.3 /.13|_-0 (.-o-.) _3_ (O X O) / ^ 161/ 1/6.777i_i_i.|-~~-~||4404444j_j_j_ ||_0 0/$$|_ _3_ ( `v' ) 13/3 V33i3 5%'. |^~~.~|_'._5_ 4/142~2 1_1/_/3~ MERRY ~3 /_/1_1 ~ CHRISTMAS! ~31/2~~~~~2|=|3 / 13|(%)|6|4037;'3.m_.6C|6|3|_06,3* +6. +3. '7~~~~~~~3.-.3//`); %%3 //2 b3 5''. {*=*=*} '._536_3 55O /4_1 (44_)");r<5;r++){P"|");G(s=0)P"  .%s.",m(45,w+4));for(;s<4;s++)G(1)sprintf(t,"%d ",D),P"  |%2s %*.*s |",O?s?"|":"\\ ":"",w,w,O?v+p*28+p/18*32+w*s:s^3?"":t);G(1)P"  |%s%s|",O?" |":"__",m(95,w+2));G(1)P"   %-*s",w+5,O?"\\|":"");P"  |\n");}P"|%s|",m(95,77));}

Try it online!

Non-ASCII version

-30 bytes thanks to ceilingcat.

GCC on my machine produces something that crashes immediately, making it unlikely that I will pursue this fork. (Not to mention that TiO reckons 1120 bytes for some reason (same as its reported amount of characters).).

#define D"BQHLAFKTEVCJOWGPIX@RDMSUN"[p=r*5+c]-64
#define P printf(
#define G(x)for(x&&P"  |\n|"),c=0;w=D^24?7:22,c<5;c-=~(D==24))
#define m(c,n)memset(calloc(n+1,1),c,n)
char*v,*u;U(char*q){for(;*q;q++)*q<48|*q>55?*u++=*q:U(L"籟\\\x203333‶彟✮†⸠"+*q-48);}t[4],r,c,s,w,p;f(n){P".%s.\n",m(45,77));for(v=u=m(r=0,732),U(".W.7W.|*| |*||*| |*|'M' 'M'_'_3 ) (^.^_1./v`v' oO833+36/~13/~*~1 /~*~~*16.^o3(';') {1|+|/}6d-b3_(\")_ (_7 _) / : 1 (_/ 1_)6_n_3 (\")6>( o )<(6o6)3$36|,|3 | |6.00_.3.34/ 14`.35 /.^.16.1^/. <->o<-> '/v1`23446/_%_/||00 ||00/ 4.==,_--|XX|- 06| (44'3.*.3 /.13|_-0 (.-o-.) _3_ (O X O) / ^ 161/ 1/6.777i_i_i.|-~~-~||4404444j_j_j_ ||_0 0/$$|_ _3_ ( `v' ) 13/3 V33i3 5%'. |^~~.~|_'._5_ 4/142~2 1_1/_/3~ MERRY ~3 /_/1_1 ~ CHRISTMAS! ~31/2~~~~~2|=|3 / 13|(%)|6|4037;'3.m_.6C|6|3|_06,3* +6. +3. '7~~~~~~~3.-.3//`); %%3 //2 b3 5''. {*=*=*} '._536_3 55O /4_1 (44_)");r<5;r++){P"|");G(s=0)P"  .%s.",m(45,w+4));for(;s<4;s++)G(1)sprintf(t,"%d ",D),P"  |%2s %*.*s |",D>n?"":L"|⁜"+!s,w,w,D>n?s^3?"":t:v+p*28+p/18*32+w*s);G(1)P"  |%s%s|",D>n?"__":" |",m(95,w+2));G(1)P"   %-*s",w+5,D>n?"":"\\|");P"  |\n");}P"|%s|",m(95,77));}

Ideone link

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

C (gcc), 2798 1976 1963 ... 1862 1742 1703 1651 1634 1632 bytes

-2 Bytes thanks to ceilingcat

I've replaced a few icons to avoid unnecessary ESC '\' characters.

(*L)()=printf;
#define E else L
#define W"  |"
#define V W" | %.7s "
#define S(x)else if(i<x)L
#define D(x)for(i=0,++j;i++<x;)
#define R L("%s.%1$s.%1$s",I);L(q^7?".%s.%1$s":"%2$s----.%1$s",I,I+3);L(".  |\n|");D(30)d(n)
char*P="_______   +    _(\")_   _n_     $      .     ____ __.==,_  .*.   _   _  . . .  _   _   |~|   //'`\\   |=|   ,   *    j   .&%$+* |  _  | ('v')    .==..W. .W.  ...     .-. _j_j_j_  /~\\  (_ . _)  (\")    |,|  __/ \\__ /_%_/|--|XX|-  /.\\  (O X O).i_i_i.( `v' )  | |  //....\\  / \\  +  . +  .'''. */'\"'\\&| ($) |//   \\\\.--'  ||*| |*| '*  `   //`); ||__|  /~*~\\  / : \\ >( o )<  | |  `.   .'|_|_| | _|  |  |_-_|  / ^ \\ |-~~-~| \\   /    Y   ||()()| |(%)|   . ' .{*=*=*}$\\._./%|  \" o||\\   /|\\_____/|*| |*||_/\\*_| %%    _|/$$|_/~*~~*\\(_/ \\_)(  o  )._|_|_. /.^.\\ |_|_|/ (____' (.-o-.) \\/ \\/ |_____|   V     _|_  ||_[]_| |___| ~~~~~~~ '._.' '%&*+$'| === |  Y Y  `=====''M' 'M'[_____]//     CRIMBGLUFWDKPXHQJYASENTVO",*I="  .-----------",*T="_________";q,i,j,k,l,g;d(o){l=(i-1)%5+j*5;k=7*l+168+168*(i>10)-(g=7*(l>17));if(q=P[672+l]-65)if(q>o)if(q^24)if(i<16)L(W"%9c"W,32);S(21)(W"%10d |",q);S(26)(W"_%s_|",T);E("%15c",32);S(16)(W"%26c|",32);S(21)(W"%25d |",q);S(26)(W"%s%1$s%s|",T,T+1);E("%30c",32);else if(q^24)if(i<6)L(W"\\%9.7s |",P+7*l-g);S(16)(V"|",P+k);S(21)(V"|",P+7*l+504-g);S(26)(W" |%s|",T);E("   \\|%10c",32);S(6)(W"\\%9.7s %7c%9c",P+7*l,'~','|');S(11)(V"%s"W,P+k,"  ~ MERRY ~  ");S(16)(V"%s |",P+k,"~ CHRISTMAS! ~");S(21)(V"%9.7s    "W,P+7*l+504,P+608);S(26)(W" |%s%1$s%s|",T,T+3);E("   \\|%25c",32);i%5||L(W"\n|");}f(n){L(".");D(77)L("-");L(".\n|",j=-1);R;R;R;R;R;D(77)L("_");L("|");}

Try it online!

\$\endgroup\$
4
  • \$\begingroup\$ I don't know if it'll cost you any bytes, but the images aren't quite in the right position within the windows... \$\endgroup\$ Commented Dec 5, 2017 at 17:47
  • \$\begingroup\$ @DomHastings Thanks, I hadn't noticed it. It's fixed now. \$\endgroup\$
    – cleblanc
    Commented Dec 5, 2017 at 18:27
  • \$\begingroup\$ @ceilingcat That's a really neat trick. I like it a lot. \$\endgroup\$
    – cleblanc
    Commented Jul 9, 2018 at 13:29
  • \$\begingroup\$ 1576 bytes \$\endgroup\$
    – ceilingcat
    Commented Apr 22, 2019 at 20:31
2
\$\begingroup\$

Ruby, 966 bytes

->n{a=%w{8. 99|/ 99|1 8' .;.. |//| |// |=_ 9.W. 9|*| 9|*| 9'M' _99| $)9| "9o| ==9| ~| 9| Y9 |__ .9. i_i. ~8~| ___| $ ,| 9| _|_. ^/. o<8> v1` 9 _9. O/{ *1{ **1 n_ ") o9)< o99) v') 9911 99/| 9Y *. .1 8_| o8.) _.8 +. W9) "` 993 _O_. /1/| """" + ~1 *~1 ~451 . 91__ 99.' ^.1 =| 91 %)| __| ")_ .9_) :91 91_) 99_ X9O) ^91 91/ 99_ v'9) 99/ V ^o ;') +|/} 8b b ''. *=*} _.' i9 %'. ~2~| _.'_}
b=(0..34).map{?|+" "*77+?|}
96.times{|i|z="EAKUIFOCQLGDVYMPBTWHXJNR"[j=i/4].ord-65;y=z/5*7
t=j<n
b[l=1+y+k=i%4][x=z%5*15+3]=b[l][x+12+m=i/92*15]=?|
b[y+(k+4)%7][x,13+m]=["|%*d  |"%[9+m,j+1],(t ?"| |":?|).ljust(12+m,?_)+?|,(t ?" \\|":"").ljust(13+m),?.+?-*(11+m)+?.][k]
w=i>91?["~%14s"%".-. ","~ MERRY ~     //`);","~ CHRISTMAS! ~ %%    ","~~~~~     %-6s "%"//  "][k].rjust(24):(a[i][1,3].reverse.tr("1/;o)8~`></1{)O3451')/bo}~2"[j,5],"/1, (~8'<>1/}(o1*~/`(1d.{^~"[j,5])+a[i]).center(9)
t&&b[l][x+1,11+m]="\\  | | |"[k*2,2]+w.tr('1345298','\\\\/~*. -')}
puts ?.+?-*77+?.,b,?|+?_*77+?|}

Try it online!

More golfed, but harder to see the pictures in the code.

Ruby, 974 bytes

This is a function, to be assigned to a variable such as f and called as f[n]. It prints to stdout.

Turned out longer than expected. I think there are a few more bytes to squeeze out by laying out the picture data differently, which I will try later.

I use symmetrical or near symmetrical pictures, and only the righthand half is found in the code. The left half may have up to 5 character subsitutions compared to the right. The code for making the substitutions is quite long, which partially negates the compression. Only about 60 bytes are saved.

->n{a=%q[8.
  |/
  |1
8'
.;..
|//|
|//
|=_
 .W.
 |*|
 |*|
 'M'
_  |
$) |
" o|
== |
~|
 |
Y 
|__
. .
i_i.
~8~|
___|
$
,|
 |
_|_.
^/.
o<8>
v1`
 
_ .
O/{
*1{
**1
n_
")
o )<
o  )
v')
  11
  /|
 Y
*.
.1
8_|
o8.)
_.8
+.
W )
"`
  3
_O_.
/1/|
""""
+
~1
*~1
~451
.
 1__
  .'
^.1
=|
 1
%)|
__|
")_
. _)
: 1
 1_)
  _
X O)
^ 1
 1/
  _
v' )
  /
V
^o
;')
+|/}
8b
b
''.
*=*}
_.'
i 
%'.
~2~|
_.'_].split($/)
b=(0..34).map{?|+" "*77+?|}
96.times{|i|z="EAKUIFOCQLGDVYMPBTWHXJNR"[j=i/4].ord-65;y=z/5*7
t=j<n
b[l=1+y+k=i%4][x=z%5*15+3]=b[l][x+12+m=i/92*15]=?|
b[y+(k+4)%7][x,13+m]=["|%*d  |"%[9+m,j+1],(t ?"| |":?|).ljust(12+m,?_)+?|,(t ?" \\|":"").ljust(13+m),?.+?-*(11+m)+?.][k]
w=i>91?["~%14s"%".-. ","~ MERRY ~     //`);","~ CHRISTMAS! ~ %%    ","~~~~~     %-6s "%"//  "][k].rjust(24):(a[i][1,3].reverse.tr("1/;o)8~`></1{)O3451')/bo}~2"[j,5],"/1, (~8'<>1/}(o1*~/`(1d.{^~"[j,5])+a[i]).tr('134528','\\\\/~*.-').center(9)
t&&b[l][x+1,11+m]="\\  | | |"[k*2,2]+w}
puts ?.+?-*77+?.,b,?|+?_*77+?|}

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ Nice! It was my intention for the picture choices to be the focus of golfing! \$\endgroup\$ Commented Dec 5, 2017 at 17:44
1
\$\begingroup\$

Clojure, 1530

Try it out

The clojure solution probably could be a little shorter, but here's my first attempt.

(defn a[x](let[k clojure.string/join b" . _ .  }\\O/{  }/*\\{  /***\\  _'_    ) (^.^ \\./v`v  oO8     +     /~\\   /~*~\\ /~*~~*\\  .^o   (';') {\\|+|/}  d-b   _(\")_ (_ . _) / : \\ (_/ \\_)  _n_    (\")  >( o )<(  o  )   $     |,|    | |  ._|_|_.   .   __/ \\__`.   .' /.^.\\  .\\^/. <->o<-> '/v\\`          ____  /_%_/||_|_| ||_|_|/ __.==,_--|XX|- _|  | (____'   .*.    /.\\   |_-_| (.-o-.) _   _ (O X O) / ^ \\  \\/ \\/  . . . .i_i_i.|-~~-~||_____|________j_j_j_ ||__| _|/$$|_ _   _ ( `v' ) \\   /    V      i    .'%'. |^~~.~|_'._.'_  |~|    | |     Y     _|_   //'`\\ //....\\||()()|||_[]_|  |=|    / \\   |(%)|  |___| _{/ _{/  \\_/    /O \\ @__,/\\\\ ,   * +  . +   . ' .~~~~~~~\\  ====\\\\\\|+-|\\\\\\\\\\+|\\\\\\\\\\\\\\   b    .'''. {*=*=*} '._.' " z(fn[n]#(.substring %1(* n %2)(+ (* n %2)n)))i(z 28)j(z 7)s str r #(apply s(repeat %1 %2))m["       ~       ""   ~ MERRY ~   "" ~ CHRISTMAS! ~""     ~~~~~     "] c #(let[w(if(= 24 %)26 11)](concat[(s"."(r w"-")".")](for[i[0 1 2]](s"|"(r w" ")"|"))[(s"|"(r(- w 4)" ")(if(< % 10)" ")%"  |")(s"|"(r w"_")"|")(r(+ w 2)" ")]))o #(let[w(if %2 26 11)](concat[(s"."(r w"-")".")(s"|\\  "(j %1 0)(if %2(m 0))" |")](for[i[1 2 3]](s"| | "(j %1 i)(if %2(m i))" |"))[(s"| |"(r(- w 2)"_")"|")(s" \\|"(r(- w 1)" "))]))d #(if(< x %)(c %)(o(i b(- % 1))(= % 24)))](println(s"."(r 77"-")".\n|  "(->>(for[p[[2,17,8,12,1][6,11,20,5,22][3,10,15,23,7][16,9,24,18][4,13,19,21,14]]](map #(d %1)p))(mapcat #(apply map vector %))(map #(k"  " %))(k"  |\n|  "))"  |\n|"(r 77" ")"|\n""."(r 77"-")"."))))
\$\endgroup\$
1
  • \$\begingroup\$ I wonder if you'd be able to save bytes using run length encoding? I don't know how short the decoding would be, but there are quite a few runs of identical characters... \$\endgroup\$ Commented Dec 10, 2017 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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