Building a Bridge
JavaScript (ES6), 92 bytes
d=>[..."_ "].map(c=>(s=c+c[r='repeat'](n%6))+'|'+(c[r](12)+'|')[r](n/6)+s,n=d-1>>1).join`\n`
Where \n
represents the literal newline character. If d
can be odd, it takes me 128 bytes:
d=>[..."_ "].map(c=>[...Array(d+1)].map((_,i)=>(d&1?i&&d-i&&(i>m)+5+i-m:((d-1)%24>11)*6+i-m)%12?'':'|',m=d>>1).join(c)).join`\n`