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 code-golf 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!