[Question]
  [
The [Borromean rings](https://en.wikipedia.org/wiki/Borromean_rings) are a curious set of three circles, linked such that the removal of any one of them will unlink the other two:
[![enter image description here](https://i.stack.imgur.com/J7tFl.png)](https://en.wikipedia.org/wiki/File:Borromean_Rings_Illusion.png)
You can make a set for yourself with a couple rubber bands and a [binder ring](https://i.stack.imgur.com/dAvYU.jpg). With more rubber bands, it's easy to make any [Brunnian link](https://en.wikipedia.org/wiki/Brunnian_link).
Write a program or function that outputs (prints or returns) this ascii-art representation of Borromean rings:
```
    +-----+
    |     |
+-----+   |
|   | |   |
| +-|---+ |
| | | | | |
| | +-|---+
| |   | |
+-|---+ |
  |     |
  +-----+
```
The lines may have trailing spaces and there may be a trailing newline.
The shortest code in bytes wins.
  
[Answer]
# CJam, ~~53 51 50~~ 49 bytes
Plain old base conversion...
```
"FÓîÞ¤ÛY­ËB[¢O²êÍÓ
}²|äG"299b4b"+ -|"f=B/N*
```
All characters are well in extended ASCII range (ASCII code 1 to 255), so number of characters == number of bytes.
[Try it online here](http://cjam.aditsu.net/#code=%22F%C2%9E%C2%97%C3%93%C3%AE%C3%9E%C2%A4%C3%9BY%C2%AD%C3%8BB%5B%C2%A2O%C2%82%C2%82%C2%B2%C3%AA%C3%8D%C3%93%10%0A%7D%C2%B2%7C%C2%96%C3%A4G%22299b4b%22%2B%20-%7C%22f%3DB%2FN*) and get the original code [here](http://pastebin.com/Xsvr71TZ)
[Answer]
# Pyth - 51 bytes
I'm sure someone's gonna beat this quick, but just a base compression answer cuz I'm feeling lazy. I'll try to write a serious answer soon.
```
s@L"
 +-|"jC" zB²;¶Ê ¿ïÁ»#-ÌClHõy%|ap"5
```
[Try it here online](http://pyth.herokuapp.com/?code=s%40L%22%0A%20%2B-%7C%22jC%22%0C%20%05z%C2%94B%C2%B2%C2%92%3B%C2%B6%C3%8A%05%09%C2%95%C2%BF%C2%9F%C3%AF%C2%9D%C3%81%C2%BB%23%1D-%C3%8CClH%11%C2%98%C3%B5%0By%25%7Cap%225&debug=0).
```
s              Reduce on string concatenation
 @L            Map second arg to index first arg
  "..."        String of all chars (Pyth allows literal newlines)
  j            Base conversion to list
   C           Base conversion 256 -> 10
    "..."      Base 256 string
   5           To Base 5
```
[Answer]
# Pyth, 49 bytes
```
jbc11s@L"+ -|"jC"Tª]UÊ¨WÕÝ_K¨}ÝÝ÷K¨Ý]Òê]UÕ*¡"4
```
[Demonstration.](http://pyth.herokuapp.com/?code=jbc11s%40L%22%2B%20-%7C%22jC%22%01T%C2%AA%C2%85%5DU%C3%8A%C2%A8W%C3%95%C3%9D_K%C2%A8%7D%C3%9D%C3%9D%C3%B7K%C2%A8%C3%9D%5D%C3%92%C3%AA%1D%5DU%C3%95*%C2%A1%224&debug=0)
This uses base 4 encoding, and chops the string into elevenths, then rejoins them on newlines.
[Answer]
# Ruby, 110
```
-2.upto(8){|i|s=" "*(i%6)+"+-----+"*(1-i%2)+" "*9
6.times{|j|"@d me?K[RR@"[i+2].ord>>j&1>0&&s[j*2]=?|}
puts s}
```
Something different from straight base conversion.
Ungolfed:
```
-2.upto(8){|i|                                           #for each line
  s=" "*(i%6)+"+-----+"*(1-i%2)+" "*9                    #load s with "+-----+" (if required!) padded appropriately with leading spaces and with nine trailing spaces.   
  6.times{|j|"@d me?K[RR@"[i+2].ord>>j&1>0&&s[j*2]=?|}   #replace characters with | as necessary, according to the 6-bit number encoded by each character in the magic string.
  puts s}                                                #print the line.
```
[Answer]
# Ruby, 117 bytes
Not winning, but I thought it was a cute approach:
```
puts'    --
    |     |
--  |
|   | |   |
| -||
| | | | | |
| | -|
| |   | |
-||
  |     |
  --'.gsub /-./,'+\0---+ '
```
[Answer]
# BrainFuck, 361 bytes
Here is a little BrainFuck program, only printing char by char.
```
+++++++++[->>>>++++++++++++++<+++++<+++++<++++<]>----....>--.>.....>-->++++++++++<<<.>>>.<<<<....>>>.<<<.....>>>.>.<<<.>.....<.<...>>>.>.<.<<<...>>>.<<<.>>>.<<<...>>>.>.<.<<<.>.>.>.<...<.<.>>>.>.<.<<<.>>>.<<<.>>>.<<<.>>>.<<<.>>>.<<<.>>>.>.<.<<<.>>>.<<<.>.>.>.<...<.>>>.<.<<<.>>>.<<<...>>>.<<<.>>>.>.<<<.>.>.<...<.<.>>>.>.<<<<..>>>.<<<.....>>>.>.<<<<..>.>.....<.
```
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), ~~282~~ ~~280~~ 271 bytes
```
+++++++++++[>++++>+++>+++++++++++>+<<<<-]>->-....<.++.....--.>>>-.<<....>+++.<.....>.>.<<<.++.....--.>...>.>.<.<...>.<.>.<...>.>[.<]>++.>>.<<...--[.>]+++++[<<.<.>>>-]<<.>.<.<.>.<.<.++.>>.<<...--.>>>.<.<.>.<...>.<.>.>.<<<.++.>>.<<...--[.>]<<<..>.<.....>.>.<<..<.++.....--.
```
[Try it online!](https://tio.run/##VU9bCsAgDDuQtCcouYj4sQ0GY7CPwc7vGl@bEdtak1jXezmu/dnOnMOHCEa03YFgDkkQiDpMQ2BWEQW8Z8YTJVoqhS@X/Hm9WxjMaBWiWnKtW1UjkahIdR4jn28ks6auceKTMe66@5hg9mWz8fqc849yfgE "brainfuck – Try It Online")
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `j`, 43 bytes
```
»⟑|Ḃṗ=›ḟL«w_¬⌊†⁰÷↳ḋ≈∑Ġ«Ṅ⁽ǔ7₇ÞyΠj»`-+| `τ11/
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=j&code=%C2%BB%E2%9F%91%7C%E1%B8%82%E1%B9%97%3D%E2%80%BA%E1%B8%9FL%C2%ABw_%C2%AC%E2%8C%8A%E2%80%A0%E2%81%B0%C3%B7%E2%86%B3%E1%B8%8B%E2%89%88%E2%88%91%C4%A0%C2%AB%E1%B9%84%E2%81%BD%C7%947%E2%82%87%C3%9Ey%CE%A0j%C2%BB%60-%2B%7C%20%60%CF%8411%2F&inputs=&header=&footer=)
```
»...»           # Base-255 compressed number
     `-+| `τ    # Decompress using key `-+| `
            11/ # Divide into 11 pieces
                # join by newlines
```
[Answer]
# [Staq](https://esolangs.org/wiki/Staq), 109 chars
```
&iiiqi{1" "}{211}{c"| "}{fcc}{o"+-|"}{p"+--"}{r"---+"}{ec;}22pr;22c22epr21ec2f2ecor1effcefor;f2ceor1e2c22e2pr
```
output:
```
Executing D:\codegolf\Staq borromean rings.txt
    +-----+
    |     |
+-----+   |
|   | |   |
| +-|---+ |
| | | | | |
| | +-|---+
| |   | |
+-|---+ |
  |     |
  +-----+
Execution complete.
>
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 31 bytes
```
Ｂ⁷¦⁷Ｍ±⁴¦²Ｂ⁷¦⁷Ｍ²¦²Ｂ⁷¦⁷Ｍ²→|Ｍ³¦²¦¹
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98pv0LDXMdck8s3vyxVQ9dEx0iTC1XMCJuQVVBmekaJJldAUWZeiYZSjRJUxhikGCJoqPn//3/dnDIA "Charcoal – Try It Online")
Link is to verbose version of code.
It's pretty fun to have a box function.
Basically draws three boxes at the required location, and patches the required places.
[Answer]
# [Haskell](https://www.haskell.org/), 79 bytes
```
"]O|f]S]S6|g[:[S[VO1g$S)S*)O1f)])61g&S]RZ|x">>=(mapM(:"|\n -")"+++"!!).fromEnum
```
[Try it online!](https://tio.run/##y0gszk7Nyfmfm5iZp2CrUFBaElxS5JOnoKIQ818p1r8mLTY4NtisJj3aKjo4OszfMF0lWDNYS9PfME0zVtPMMF0tODYoqqZCyc7OViM3scBXw0qpJiZPQVdJU0lbW1tJUVFTL60oP9c1rzT3P9f/f8lpOYnpxf91kwsKAA "Haskell – Try It Online")
A base-5 decompression technique. Each ASCII value in the string is used as an index into the list of parts `["+++", "++|", "++\n", ..., "---"]` created by `mapM`.
## Approach
See [this tip](https://codegolf.stackexchange.com/a/52945/3852) for Cartesian product with `mapM`.
At first, I used `mapM(\_->"......")"123"` to create the decoding list, with some permutation of `" +-|\n"` in place of the dots. The best permutations (yielding the shortest encoded string literals) gave 83-byte solutions:
```
">:]P>H>F+]%FpHpFob[FrHrFr:vPr>r\bvRfH>F=][">>=(mapM(\_->"\n+ -|")"123"!!).fromEnum
">;|i>C>A1|%AWCWAVwyAXCXAX;ciX>X\tckMC>A=|y">>=(mapM(\_->"\n+ |-")"123"!!).fromEnum
"]R>7]b]_%>+_vbv_tH=_wbw_wRp7w]w\ap:gb]_[>=">>=(mapM(\_->"\n+- |")"123"!!).fromEnum
"|k>7|w|s%>1scwcs`C=sbwbsbkW7b|b\aW;Ow|sy>=">>=(mapM(\_->"\n+-| ")"123"!!).fromEnum
"]T|i]X]U1|+UDXDUBryUCXCUCTJiC]C\tJl5X]U[|y">>=(mapM(\_->"\n+| -")"123"!!).fromEnum
"|l]P|r|n+]1nJrJnGX[nHrHnHlDPH|H\bDT6r|ny][">>=(mapM(\_->"\n+|- ")"123"!!).fromEnum
```
Each contains one low-ASCII byte, `\b` or `\t` or `\a`.
Then I realized I could write `mapM(\_->"\n+ -|")"123"` as `mapM(:"+ -|")"\n\n\n"` to save two bytes. But maybe I could save even *more* bytes if I used a permutation *not* starting with `\n`, because `"\n\n\n"` is pretty long.
Sadly, the permutations not starting with `\n` yielded bad values making the string literal longer. The best programs are all still 81 bytes:
```
">6|g>9>:\24|\f:%9%:#mx:$9$:$61g$>$O1f*9>:<|x">>=(mapM(:"| \n-")"+++"!!).fromEnum
">5]O>9>;\18]\f;%9%;#SZ;$9$;$5+O$>$g+M/9>;<]Z">>=(mapM(:"| -\n")"+++"!!).fromEnum
"|f>5|m|l\f>\24l1m1l-9<l.m.l.f%5.|.M%6,m|lx><">>=(mapM(:"|-\n ")"+++"!!).fromEnum
"]M>6]S]T\f>\18T+S+T(9<T)S)T)M%6)])f%50S]TZ><">>=(mapM(:"|- \n")"+++"!!).fromEnum
```
However, I had another trick up my sleeve: the problem statement allows for trailing spaces on each line, and maybe I could insert 3 trailing spaces in such a way that the string literal becomes one "actual character" longer, but ends up not having stuff like `\24` and `\f` in it.
So I ran a brute force search for all positions to add such trailing spaces. And indeed, adding a trailing space on lines 2, 4, and 6 lets us write the above 79-byte program, where the encoded string is fully printable ASCII.
There are many other permutation-space-placement pairs that tie this one. Here are just a few:
```
"]O|f]S]SU|x]$])]$O1g$S)S*)O1f)])61g&S]RZ|x" (44,"+|\n -",[1,1,5])
"|g]M|m|m5]Oyz1m1k-SZk.m.k.g+M.|.5+O'm|kx]Z" (44,"+|\n- ",[1,2,2])
">6|fW=>=A|x>)>$>)61f&$9$:$61g$>$O1f*9>:<|x" (44,"+| \n-",[0,1,4])
">5]Mp=>=g]M=G>$>.5+M.9$9'$5+O$>$g+M/9>;<]Z" (44,"+| -\n",[0,2,5])
"|f>5|m|ms><|)|.|)f%60.m.l.f%5.|.M%6,m|lx><" (44,"+|-\n ",[1,1,4])
"]M>5b]+]-><],+S+T(9<T)S)T)M%6)])f%50S]TZ><" (44,"+|- \n",[0,0,2])
```
## I tried a few other things
I tried a few other things. If you pad each line in the target string to "11 characters followed by a newline", then the newlines will only occur at indices ≡ 3 mod 4. In fact, if you look at each *k* mod 4 and count the unique characters there, they group themselves quite nicely:
```
target!!k `elem` " +-|"   when k ≡ 0 mod 4.
target!!k `elem` " -"     when k ≡ 1 mod 4.
target!!k `elem` " +-|"   when k ≡ 2 mod 4.
target!!k `elem` " -\n"   when k ≡ 3 mod 4.
```
So a mixed-base approach is tempting.
Of course, something like `mapM id[" +-|"," -"," +-|"," -\n"]` is too long, but I played with `mapM(`drop`"+|\n- ")[0,3,0,2]`. Sadly, the strings just aren't great. The best I could get out of this was 93 bytes.
```
"³F{³;¥F}¥;/¥1(K//-/={/§9=}9§³9©\130W">>=(mapM(`drop`"||+\n- ")[0,4,1,3]!!).fromEnum
```
Alternatively, you could try a base-4 approach with different alphabets for each k mod 4. This is easy to express with `mapM`. I got this 84 byte solution, which would be 70 bytes if Haskell programs used some ANSI encoding rather than UTF-8.
```
"ÿJ¤ÿ?ðJ§ð?3ð6*p3303B¤3ó<B§<óÿ<öª|">>=(mapM(:"+- ")"|-|\n"!!).fromEnum
```
[Answer]
# Python 3, 139 bytes
This is the closest I can get to printing it directly (which would be 134 bytes) without actually doing so.... I'm not sure how to shorten it any more.
```
a='+-----+'
b='+-|---+'
c=' '*4
d='| '
e=c+d
print(c+a,e*2,a+e[1:],"|   | "*2,d+b+" |",d*6,d+d+b,"| |   "*2,b+" |",e[2:]+e,"  "+a,sep='\n')
```
]