The House of Santa Claus
Javascript (ES6), 119 116 96 92 91 bytes
for(i=8;i--;)console.log(`834
3554
2610
2160
7777`.replace(/./g,c=>'|/|/\\_\\- '[c<i?8:c]))
Jelly, 40 39 36 bytes
“ḥ%DtƊVḍI’ḃ9W;“|_/-\/\|‘Ė¤y@\FỌ»⁶s4Y
Try it online!
How it works
“ḥ%DtƊVḍI’
is a bijective base-250 literal; each character corresponds to its code point in Jelly's code page. The result is the integer 13192938935880491074.
ḃ9
converts the generated integer to bijective base 9, yielding the integer array
[9, 6, 7, 9, 6, 2, 2, 7, 1, 5, 3, 8, 1, 3, 5, 8, 4, 4, 4, 4]. The integers correspond to the order of the stroke, with the exception of 9, which indicates a space.
W
wraps the generated array into a singleton array, which will be required to prepend it to the array we'll generate now.
“|_/-\/\|‘Ė¤
works as follows. ¤
combines the two links to the left into a niladic chain. The first one, “|_/-\/\|‘
yields the code points of the specified characters, yielding [124, 95, 47, 45, 92, 47, 92, 124]. Then, Ė
enumerates the code points, yielding
[[1, 124], [2, 95], [3, 47], [4, 45], [5, 92], [6, 47], [7, 92], [8, 124]]. The pair [n, c] means that the nth stroke will be the ASCII character with code point c.
;
concatenates the generated arrays. The result is the array
[[9,6,7,9,6,2,2,7,1,5,3,8,1,3,5,8,4,4,4,4],[1,124],[2,95],[3,47],[4,45],[5,92],[6,47],[7,92],[8,124]].
y@\
performs a cumulative (i. e., showing all intermediate steps) reduce, using transliteration (y
) with swapped arguments (@
). In the first step, e.g., we replace each 1 in the original array with 124, which is the code point of the character |.
FỌ
flattens the result and replaces all code points with the corresponding ASCII characters. In all steps, this will generate some unprintable characters with code points 1 to 9.
»⁶
takes the character-wise maximum with the space character, replacing all unprintable characters with spaces.
s4Y
splits the generated string into chunks of length four and joins them with a linefeed as separator.
Batch, 356 344 341 337 bytes
@set s=@set "
%s%g=@goto 1
%s%r=
%s%c=
%s%u=|
%s%l=|
%s%f=
@for /l %%i in (1,1,7)do @call:%%i
%s%u=|\/|
%s%l=|/\|
%g%
:7
%s%u=|\/
%s%l=|/\
%g%
:6
%s%f=----
%g%
:5
%s%u=|\
%s%l=| \
%g%
:4
%s%c=/__\
%g%
:3
%s%r= /\
%s%c=/ \
%g%
:2
%s%r= /
%s%c=/
:1
@for %%l in ("%r%" "%c%" "%u%" "%l%" "%f%")do @echo(%%~l
Stupid Batch |
quoting rules... if you want a |
in a variable, you need to quote it with three ^
s, so it's cheaper to use @
instead and substitute it on output, although to achieve this I have to start with the left wall. Line one has a trailing space.echo(
is used because the r
, c
, and f
variables could be empty and we don't want ECHO is off.
printed.
Edit: Saved 12 bytes by using fallthrough for the last part. Saved 3 bytes by using a for
loop to print each part, this means that I now use |
s in my variables which makes the code slightly easier to read. Saved 4 bytes by using explicit @
characters instead of @echo off
. I think starting with the left wall still requires the fewest bytes.