_3”-ẋ“|+“2*×5H_2Bị⁾ ||”j|
:©2⁶ẋ,`jÇŒḄḊṙ®sṁµY_3”-ẋ”+;;Çsẋ2U3¦ṁµY
TryItOnline!TryItOnline!
Builds a nighternighter™ the other way around to the examples like:
_3”-ẋ“|+“2*×5H_2Bị⁾ ||”j| - Link 1, walls+turn/exitpipes & spaces: n e.g. 7
2* ”- - 2 -raised literalto ['-']
_3the nth power e.g. 128
×5 - n - 3 - multiply by 5 e.g. 4640
ẋH - halve - repeat e.g. "----"320
“|+“ ||” - list of strings ["|+","_2 ||"]
- subtract 2 j - join e.g. 318
B e.g. "|+---- ||"
:©2⁶ẋ,`jÇŒḄḊṙ®sṁµY -convert Mainto link:binary n e.g. 7[1,0,0,1,1,1,1,1,0]
⁶ ị - index into (1-based)
- literal [' ']
: 2 ⁾ | - char list " |" - integer divide n by 2 e.g. 3
" ©|| |"
_3”-ẋ”+;;Çsẋ2U3¦ṁµY - Main link: n - save ine.g. register7
_3 ẋ - repeatn - 3 e.g. " "4
”- ` - repeat argument forchar thelist dyad:"-"
,ẋ - - repeat pair e.g. [" ",----" "]
”+ Ç - call last link (1) aschar alist monad"+"
j ; - join - concatenate e.g. " |+"+---- || "
ŒḄ - bounce Ç e.g. " |+---- || call last ||link ----+|(1) as a "monad
Ḋ; - dequeue - concatenate e.g. " |+"+---- || || ----+| |"" "
s ® - readsplit registerinto chunks of n e.g. ["+---- |","| e.g. 3|"]
ẋ2 ṙ - rotate left repeat 2 times e.g. "+---- || || ["+----+| |",
s - split into chunks of length n
"| |",
e.g. ["+---- |",
+--> "+---- |",
"| |",
| "| |"]
3¦ "| ----+",
apply to index 3: |
U - upend +--- "| |"]----+"
ṁ - mould like n (i.e. repeat to fill)
µ - monadic chain separation
Y - join with line feeds
(each byte saved involved fairly non-trivial changes, see the edit history if you're interested)