Help Trump build the wall!
CJam, 52 bytes
F,ri*"s@;b6(MBZF,fu"128b6b"_
|-—"f=N/ff=zN*
Includes a bunch of unprintable ASCII characters. The hexdump of the first string literal pushed is:
01 73 06 40 3B 62 36 28 1E 4D 07 42 5A 14 1B 46 2C 66 75
Try it here!
Explanation
The above hexdump is interpreted as a base-128 number, then converted to base 6, to get this list:
[1 1 1 1 0 0 1 1 1 0 0 2
1 1 1 3 1 1 3 0 3 1 1 3 2
0 0 0 3 1 1 1 1 1 1 1 3 2
4 1 1 1 2
1 4 2
4 1 2
5]
To this, we apply the mapping 0 → _
, 1 → space
, 2 → \n
, 3 → |
, 4 → -
, 5 → —
. This gets us the string:
__ __
| |_| |
___| |
-
-
-
—
It consists of the "period" of each line; i.e. we can cycle the fifth line " -"
to get " - - - - - - - "
.
Then, we execute this subprogram:
N/ Split into lines.
Ff* Repeat each line 15 times (to cycle it).
Ff< Take the first 15 chars of each line.
rif* Repeat these chars input() times.
N* Join lines.
(The new version does this in a slightly different way that I actually can't wrap my head around myself very well, because it uses ff=
.)
JavaScript (ES6), 116 115 bytes
n=>"__ __ n| |_| | n| |___n - n- n -n—".split`n`.map(l=>l.repeat(15).slice(-15).repeat(n)).join`
`
Saved a byte thanks to @Neil!
Explanation
Pretty much the same as @Mauris' CJam method, but without the character mapping.
The wall parts are in the format:
__ __
| |_| |
| |___
-
-
-
—
because if you repeat each line 15 times you get:
... __ __ __ __ __ __
... | |_| | | |_| | | |_| |
... | |___| |___| |___
- - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
———————————————
and after slicing to just the last 15 characters you get:
__ __
| |_| |
___| |___
- - - -
- - - - - - -
- - - - - - - -
———————————————
Ungolfed
n=>
// array of wall line parts
"__ __ n| |_| | n| |___n - n- n -n—".split`n`
.map(l=> // for each wall line
l.repeat(15) // repeat the line 15 times to create a complete wall line
.slice(-15) // each wall piece is only 15 characters long
.repeat(n) // repeat the wall n times
)
.join`
` // output the resulting wall
Test
var solution = n=>"__ __ n| |_| | n| |___n - n- n -n—".split`n`.map(l=>l.repeat(15).slice(-15).repeat(n)).join`
`
<input type="number" oninput="result.textContent=solution(+this.value)" />
<pre id="result"></pre>
05AB1E, 38 bytes
•4H’*»È%f·ù„áÅ'4•4B3ÝJ"_ -|"‡8ô€ûvy¹×»
Try it online!
•4H’*»È%f·ù„áÅ'4• # Push '1724427993555739020619095486300160'
4B # Convert to base 4 (turns it into an 8x8 bitmap).
3ÝJ"_ -|"‡ # Replace digits 0-3 with _, , -, or |.
8ô # Split into pieces of 8.
€û # Palindromize each piece.
vy¹×» # For each row, dupe it n times (hori) and print it.
1724427993555739020619095486300160 converted to base-4:
11110011111311300003111121112111121212122121212100000000
11110011111311300003111121112111121212122121212100000000 with characters replaced:
__ | |____| - - - - - -- - - - ________
Previous pattern split into 8 pieces:
__
| |_
___|
- -
- - - -
- - - -
________
Then you palindromize, and make it as long as needed through repetition.