#JavaScript (ES8), 90 bytes Takes input as `(direction)(length)`. <!-- language-all: lang-javascript --> d=>g=(n,w=n)=>n?`${c='\\|/'[d+1]} ${n&1?c:' '} ${c} `.padStart(~d?5+d*n:w+6-n)+g(n-1,w):'' [Try it online!][TIO-jsymatq1] [JavaScript (Node.js)]: https://nodejs.org [TIO-jsymatq1]: https://tio.run/##ZchNC4IwGADgu79iB2l7mzMHfYAw/REdM3BsOgp5Jyp5MPvrC4/R8Xme@qVHMzz6SaC3TWhVsKpwimEyKwRVYFnHi1G0qt4HerNc3lcSL7iTpckpoRvMGtVpr@110sPEPrY8cbvHfOZngcAdQyGTGXJKg/E4@q5JO@9Yy4gERi4A0W@LrY9/TTJgMgMIXw "JavaScript (Node.js) – Try It Online"