[Question]
  [
The esoteric programming language [evil](http://esolangs.org/wiki/Evil) has an interesting operation on byte values which it calls "weaving". It is essentially a permutation of the eight bits of the byte (it doesn't matter which end we start counting from, as the pattern is symmetric):
* Bit 0 is moved to bit 2
* Bit 1 is moved to bit 0
* Bit 2 is moved to bit 4
* Bit 3 is moved to bit 1
* Bit 4 is moved to bit 6
* Bit 5 is moved to bit 3
* Bit 6 is moved to bit 7
* Bit 7 is moved to bit 5
For convenience, here are two other representations of the permutation. As a cycle:
```
(02467531)
```
And as a list of pairs of the mapping:
```
[[0,2], [1,0], [2,4], [3,1], [4,6], [5,3], [6,7], [7,5]]
```
Your task is to visualise this permutation, using the box-drawing characters `─`, `│`, `┌`, `┐`, `└`, `┘`, `┼` (Unicode code points: U+2500, U+2502, U+250C, U+2510, U+2514, U+2518, U+253C). This visualisation should satisfy the following constraints:
The first and last line are exactly:
```
0 1 2 3 4 5 6 7
```
Between those, you can use as many lines as you want of up to 15 characters each to fit your box drawing characters (you will need at least 4 lines). The lines should start vertically beneath one of the digits on the first row and end vertically above the corresponding digit on the last row. The eight lines must be connected, and may only cross via `┼` (which is always a crossing, never two turning lines which are touching). The exact paths of the lines are up to you (and finding a particularly golfable layout is the core of this challenge). One valid output would be:
```
0 1 2 3 4 5 6 7
│ │ └─┼┐│ │ └┐│
└─┼─┐ ││└─┼─┐││
┌─┘ │ ││  │ │││
│ ┌─┼─┘│  │ │││
│ │ │ ┌┼──┘ │││
│ │ │ │└┐ ┌─┼┼┘
│ │ │ │ │ │ │└┐
0 1 2 3 4 5 6 7
```
However, any other layout that correctly connects the right digits is fine too. Please show your chosen output in your answer.
You may write a program or function and will not take any input. Output the diagram either to STDOUT (or closest alternative) or as a function return value in the form of a string or a list of strings (each representing one line).
Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply, so the shortest code (in bytes) wins.
  
[Answer]
## PowerShell v2+, ~~172~~ ~~153~~ ~~148~~ ~~145~~ ~~142~~ ~~131~~ 123 bytes (81 chars)
```
($a=""+0..7)
$b='┌┘'
"│$b$('┌┼─┘'*3)
└┼┐$('│└─┐'*3)
$b$('└┼─┐'*3)│
│ $($b*6)│"
$a
```
I golfed the weaving further, eliminating the need for several variables by using inline code blocks. This is probably within a few bytes of optimal.
We start by setting `$a` equal to the range `0..7` that's been joined together with spaces. This is because the default `$ofs` (Output Field Separator) for an array is a space, so when the array is stringified with `""+` (with an operator like this, PowerShell will try to implicitly cast the right-hand object as the left-hand object), the result is the range space-separated.
That's encapsulated in parens, which adds the result onto the pipeline. We then setup a one helper variable `$b`, followed by four lines of output with the appropriate variable in place (split with literal newlines), and using inline code-blocks for repeat sections, followed by `$a` again. The four lines and `$a` are also placed on the pipeline, and output is implicit at the end.
```
PS C:\Tools\Scripts\golfing> .\visualize-bit-weaving.ps1
0 1 2 3 4 5 6 7
│┌┘┌┼─┘┌┼─┘┌┼─┘
└┼┐│└─┐│└─┐│└─┐
┌┘└┼─┐└┼─┐└┼─┐│
│ ┌┘┌┘┌┘┌┘┌┘┌┘│
0 1 2 3 4 5 6 7
```
[Answer]
## Actually, 69 bytes
```
"│ ┌┘│ │└┐ │└┐└┐""┌┘└┼┐└┼┐ └┼┐└┐""└┼┐│└┐┌┘└┐┌┘│""┌┼─┘"3*"│┌┘"+8r' j;)
```
[Try it online!](http://actually.tryitonline.net/#code=IuKUgiDilIzilJjilIIg4pSC4pSU4pSQIOKUguKUlOKUkOKUlOKUkCIi4pSM4pSY4pSU4pS84pSQ4pSU4pS84pSQIOKUlOKUvOKUkOKUlOKUkCIi4pSU4pS84pSQ4pSC4pSU4pSQ4pSM4pSY4pSU4pSQ4pSM4pSY4pSCIiLilIzilLzilIDilJgiMyoi4pSC4pSM4pSYIis4cicgajsp&input=) (the alignment is a little messed up in the online interpreter)
Actually has a **HUGE** advantage here - all of the box drawing characters are in CP437, so they're only a byte each. Though each character needed could theoretically be encoded in 4 bits (since there are only 9 unique characters), the 31 bytes saved by compressing the string would be lost due to Actually's very poor string processing capabilities. This also means that any 8x4 configuration would result in the same score. Since 8x4 appears to be the (vertically) shortest possible configuration, this is optimal.
Thanks to Martin for 3 bytes!
Thanks to TimmyD for 4 more bytes!
Explanation:
```
"│ ┌┘│ │└┐ │└┐└┐""┌┘└┼┐└┼┐ └┼┐└┐""└┼┐│└┐┌┘└┐┌┘│""┌┼─┘"3*"│┌┘"+8r' j;)
"│ ┌┘│ │└┐ │└┐└┐""┌┘└┼┐└┼┐ └┼┐└┐""└┼┐│└┐┌┘└┐┌┘│""┌┼─┘"3*"│┌┘"+         push the individual lines, using string multiplication to shorten repeated sections
                                                              8r' j   push the string "0 1 2 3 4 5 6 7" (range(8), join on spaces)
                                                                   ;)  make a copy and move it to the bottom of the stack
```
[Answer]
# Javascript ES6, ~~168~~ 167 bytes
Edit: Whoops, turned out I was using the pipe `|` char instead of U+2502 `│` in part of the function, updated byte count.
```
_=>((n=`0 1 2 3 4 5 6 7 `)+[...`6452301`].map(i=>`${(d=n=>`│ `.repeat(n))(i)}└┐│ ${r=d(6)}┌┼┘ ${r}│└┐ ${d(6-i)}`).join``+n).match(/.{16}/g).join`
`
```
Returns a string.
Output:
```
0 1 2 3 4 5 6 7 
│ │ │ │ │ │ └┐│ 
│ │ │ │ │ │ ┌┼┘ 
│ │ │ │ │ │ │└┐ 
│ │ │ │ └┐│ │ │ 
│ │ │ │ ┌┼┘ │ │ 
│ │ │ │ │└┐ │ │ 
│ │ │ │ │ └┐│ │ 
│ │ │ │ │ ┌┼┘ │ 
│ │ │ │ │ │└┐ │ 
│ │ └┐│ │ │ │ │ 
│ │ ┌┼┘ │ │ │ │ 
│ │ │└┐ │ │ │ │ 
│ │ │ └┐│ │ │ │ 
│ │ │ ┌┼┘ │ │ │ 
│ │ │ │└┐ │ │ │ 
└┐│ │ │ │ │ │ │ 
┌┼┘ │ │ │ │ │ │ 
│└┐ │ │ │ │ │ │ 
│ └┐│ │ │ │ │ │ 
│ ┌┼┘ │ │ │ │ │ 
│ │└┐ │ │ │ │ │ 
0 1 2 3 4 5 6 7 
```
---
Extra: Using @TimmyD's method, I have another 167 byte solution:
```
(n=`0 1 2 3 4 5 6 7
`,a=`│┌┘ `,b=`└┼─┐`,d=`┌┼─┘`,f=` │└┐`)=>[n,a,a,a,a,`
`,b,b,b,`└┼┐
┌┘`,d,d,d,`│
│`,f,f,f,` │
`,n].join``
```
[Answer]
## JavaScript (ES6), ~~137~~ 134 bytes
```
f=
_=>`0
│2525252
1 1 1 1
24242423525252 3 1 1 1 3 242424│
0`.replace(/\d/g,d=>`0 1 2 3 4 5 6 7,└┼┐,┌┘,│
│,│ , │`.split`,`[d])  
;
o.textContent=f();
```
```
<pre id=o></pre>
```
As a bell-ringer I immediately recognised this as the first two rows of [Plain Hunt Major](http://www.ringbell.co.uk/methods/img/ph8.gif) (note that the linked image uses 1-8 instead of 0-7).
[Answer]
# Pyth - ~~119~~ ~~104~~ ~~100~~ 81 bytes
Extremely simple. (Its actually bytes this time).
```
js[KjdU8cX."sz¨ú¨ãÆhÆ?\ÕüÓ¼xFNøa"_G"│┌┘└┼─┐ "15K
```
[Try it online here](http://pyth.herokuapp.com/?code=js%5BKjdU8cX.%22sz%0F%C2%A8%C3%BA%C2%8F%C2%A8%C3%A3%C3%86%C2%8Ch%C3%86%C2%8C%3F%5C%C3%95%10%C3%BC%C3%93%C2%BCxFN%C3%B8a%22_G%22%E2%94%82%E2%94%8C%E2%94%98%E2%94%94%E2%94%BC%E2%94%80%E2%94%90+%2215K&debug=0).
I also stole @TimmyD's output:
```
0 1 2 3 4 5 6 7
│┌┘ │┌┘ │┌┘ │ │
└┼─┐└┼─┐└┼─┐└┐│
┌┘┌┼─┘ └┐│┌┼─┼┘
│ │└┐ ┌─┼┘│└┐└┐
0 1 2 3 4 5 6 7
```
[Answer]
## MS-DOS Batch, 136 bytes
```
@echo 0 1 2 3 4 5 6 7
@echo ³ÚÙ ³ÚÙ ³ÚÙ ³ÚÙ
@echo ÀÅÄ¿ÀÅÄ¿ÀÅÄ¿ÀÅ¿
@echo ÚÙÚÅÄÙÚÅÄÙÚÅÄÙ³
@echo ³ ³À¿ ³À¿ ³À¿ ³
@echo 0 1 2 3 4 5 6 7
```
Using @TimmyD's output. This might work in Windows Batch too, but my code page there is CP850, not CP437.
[Answer]
## MATLAB / Octave, ~~112~~ 109 bytes
```
a='0 1 2 3 4 5 6 7';d=['└┐│ ';'┌┼┘ ';'│└┐ '];e=repmat('│ ',3,1);[a;d d d d;e d d d e;a]
```
Output:
```
0 1 2 3 4 5 6 7
└┐│ └┐│ └┐│ └┐│
┌┼┘ ┌┼┘ ┌┼┘ ┌┼┘
│└┐ │└┐ │└┐ │└┐
│ └┐│ └┐│ └┐│ │
│ ┌┼┘ ┌┼┘ ┌┼┘ │
│ │└┐ │└┐ │└┐ │
0 1 2 3 4 5 6 7
```
My code is based on the ouputs of [@Dendrobium](https://codegolf.stackexchange.com/questions/83899/visualise-bit-weaving/83910#83910) and [@Neil](https://codegolf.stackexchange.com/questions/83899/visualise-bit-weaving/83922#83922).
[Answer]
# [///](https://esolangs.org/wiki////), 112 bytes (100 chars)
```
/8/0 1 2 3 4 5 6 7//9/│//A/└┐//B/┌┼┘/8/C/9 A9 A9 A9//D/9A 9A 9A 9/
AC
B B B B
DA
C 9
9 B B B 9
9 D
8
```
*Thanks @MartinEnder for -3 bytes!*  
*Thanks @MartinEnder for -9 bytes!*  
*Thanks @MartinEnder (OP) for pointing 15-char rule out*
Uses ~~@TimmyD's~~ @Marco's output
```
0 1 2 3 4 5 6 7
└┐│ └┐│ └┐│ └┐│
┌┼┘ ┌┼┘ ┌┼┘ ┌┼┘
│└┐ │└┐ │└┐ │└┐
│ └┐│ └┐│ └┐│ │
│ ┌┼┘ ┌┼┘ ┌┼┘ │
│ │└┐ │└┐ │└┐ │
0 1 2 3 4 5 6 7
```
[Answer]
**Python3, 209 bytes**
```
lambda s="0 1 2 3 4 5 6 7\n":s+"│┌┘ │┌┘ │┌┘ │ │\n└┼─┐└┼─┐└┼─┐└┐│\n┌┘┌┼─┘ └┐│┌┼─┼┘\n│ │└┐ ┌─┼┘│└┐└┐\n"+s
```
Returns a string.
Thanks to @Mego for saving 2 bytes!
Credits of the character body go to @TimmyD !
[Answer]
# [Sprects](https://dinod123.neocities.org/interpreter.html), 99 bytes (87 chars)
```
$8
AC
BE
DA
C 9
9E 9
9 D
8$E B B B$D9A 9A 9A 9$C9 A9 A9 A9$B┌┼┘$A└┐$9│$80 1 2 3 4 5 6 7
```
Uses @Marco's output (replace every 16th character with a newline (regex: `(.{15}).` -> `\1\n`)).
```
0 1 2 3 4 5 6 7
└┐│ └┐│ └┐│ └┐│
┌┼┘ ┌┼┘ ┌┼┘ ┌┼┘
│└┐ │└┐ │└┐ │└┐
│ └┐│ └┐│ └┐│ │
│ ┌┼┘ ┌┼┘ ┌┼┘ │
│ │└┐ │└┐ │└┐ │
0 1 2 3 4 5 6 7
```
[Answer]
## Bash + GNU sed, 140 bytes
```
sed 'h
s/$/nxxxacnb b b bnyyycanc xxxcnc b b b cnc yyyc/
:
s/x/ac /
s/y/ca /
s/a/└┐/
s/b/┌┼┘/
t
y/cn/│\n/
G'<<<'0 1 2 3 4 5 6 7'
```
Output:
```
0 1 2 3 4 5 6 7
└┐│ └┐│ └┐│ └┐│
┌┼┘ ┌┼┘ ┌┼┘ ┌┼┘
│└┐ │└┐ │└┐ │└┐
│ └┐│ └┐│ └┐│ │
│ ┌┼┘ ┌┼┘ ┌┼┘ │
│ │└┐ │└┐ │└┐ │
0 1 2 3 4 5 6 7
```
Using [@TimmyD's](https://codegolf.stackexchange.com/questions/83899/visualise-bit-weaving/83906#83906) output: 142 bytes
```
sed 'h
s/$/npbcccnsurdddnbeeepnp bbbbbbp/
:
s/b/qt/
s/c/quot/
s/d/psor/
s/e/suor/
t
y/nopqrstu/\n─│┌┐└┘┼/
G'<<<'0 1 2 3 4 5 6 7'
```
Output:
```
0 1 2 3 4 5 6 7
│┌┘┌┼─┘┌┼─┘┌┼─┘
└┼┐│└─┐│└─┐│└─┐
┌┘└┼─┐└┼─┐└┼─┐│
│ ┌┘┌┘┌┘┌┘┌┘┌┘│
0 1 2 3 4 5 6 7
```
[Answer]
# [Tcl](http://tcl.tk/), 205 bytes
```
puts "[set B "0 1 2 3 4 5 6 7"]
│┌┘ │┌┘ │┌┘ └┐│
└┼┐ └┼─┐└┼──┐││
┌┘└─┐│ └┐│┌─┼┼┘
│ ┌─┼┘┌─┼┘│ │└┐
$B"
```
[Try it online!](https://tio.run/##K0nO@f@/oLSkWEEpuji1RMFJQclAwVDBSMFYwUTBVMFMwVwpluvRlKZHU3oeTZmhgJ015dGUCUA@F5i1B8hRgLEawDJwNoTbBFEL0gyWg4oiDALLNYA1AdEMLogkXGwGKrsJ4haQXi4VJ6X//wE "Tcl – Try It Online")
outputs
```
0 1 2 3 4 5 6 7
│┌┘ │┌┘ │┌┘ └┐│
└┼┐ └┼─┐└┼──┐││
┌┘└─┐│ └┐│┌─┼┼┘
│ ┌─┼┘┌─┼┘│ │└┐
0 1 2 3 4 5 6 7
```
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), 64 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
└┼─┐³
┘┌┼─┘²
┐│└─┐¹
┌┘┌┘┌┘⁰
│┌²┌┼─²¶└┼¹│└─¹¶┌┘³³³│¶│ ⁰⁰│”8δ@∑Q;O
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JXUyNTE0JXUyNTNDJXUyNTAwJXUyNTEwJUIzJTBBJXUyNTE4JXUyNTBDJXUyNTNDJXUyNTAwJXUyNTE4JUIyJTBBJXUyNTEwJXUyNTAyJXUyNTE0JXUyNTAwJXUyNTEwJUI5JTBBJXUyNTBDJXUyNTE4JXUyNTBDJXUyNTE4JXUyNTBDJXUyNTE4JXUyMDcwJTBBJXUyNTAyJXUyNTBDJUIyJXUyNTBDJXUyNTNDJXUyNTAwJUIyJUI2JXUyNTE0JXUyNTNDJUI5JXUyNTAyJXUyNTE0JXUyNTAwJUI5JUI2JXUyNTBDJXUyNTE4JUIzJUIzJUIzJXUyNTAyJUI2JXUyNTAyJTIwJXUyMDcwJXUyMDcwJXUyNTAyJXUyMDFEOCV1MDNCNEAldTIyMTFRJTNCTw__)
Pattern stolen from [the powershell](https://codegolf.stackexchange.com/a/83906/59183)
]