[Question]
  [
You have to write a program or a function in any language that outputs this pattern:
```
~|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||~
|~|||||||||||||||||||||||||||||||||||||||||||||||||||||||||~|
||~|||||||||||||||||||||||||||||||||||||||||||||||||||||||~||
|||~|||||||||||||||||||||||||||||||||||||||||||||||||||||~|||
||||~|||||||||||||||||||||||||||||||||||||||||||||||||||~||||
|||||~|||||||||||||||||||||||||||||||||||||||||||||||||~|||||
||||||~|||||||||||||||||||||||||||||||||||||||||||||||~||||||
|||||||~|||||||||||||||||||||||||||||||||||||||||||||~|||||||
||||||||~|||||||||||||||||||||||||||||||||||||||||||~||||||||
|||||||||~|||||||||||||||||||||||||||||||||||||||||~|||||||||
||||||||||~|||||||||||||||||||~|||||||||||||||||||~||||||||||
|||||||||||~|||||||||||||||||~|~|||||||||||||||||~|||||||||||
||||||||||||~|||||||||||||||~|||~|||||||||||||||~||||||||||||
|||||||||||||~|||||||||||||~|||||~|||||||||||||~|||||||||||||
||||||||||||||~|||||||||||~|||||||~|||||||||||~||||||||||||||
|||||||||||||||~|||||||||~|||||||||~|||||||||~|||||||||||||||
||||||||||||||||~|||||||~|||||||||||~|||||||~||||||||||||||||
|||||||||||||||||~|||||~|||||||||||||~|||||~|||||||||||||||||
||||||||||||||||||~|||~|||||||||||||||~|||~||||||||||||||||||
|||||||||||||||||||~|~|||||||||||||||||~|~|||||||||||||||||||
```
The output is composed of 20 lines of 61 characters each.
# Rules
* Standard loopholes are forbidden
* There may be a single trailing newline at the end of the output
* There may not be any trailing whitespace on any line of the output
Without a trailing newline, the md5 checksum of the output is `fde4e3b4606bf9f8c314131c93988e96`.
With a trailing newline, the md5 checksum of the output is `1f0b43db4fec6594be202c8339024cb7`.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins.
  
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~97~~ ~~82~~ ~~81~~ 80 bytes
Golfed 15 bytes after learning that `abs` is a builtin in C, an additional byte thanks to [Rogem](https://codegolf.stackexchange.com/users/77406/rogem) for pointing out that the declarations of my variables can be moved to the function, and another byte thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat) for suggesting `x=31;--x+31` instead of `x=-31;++x<31`.
```
f(x,y){for(y=21;--y;puts(""))for(x=31;--x+31;)printf(abs(10-abs(x))-y?"|":"~");}
```
[Try it online!](https://tio.run/##FYzLCoAgEAD/ZU@71ELWLZG@xQTDQyZWoPT4dcvTMHMYw4sxpVhMbabLbhGz6oVkzjKcx44ARLUmNdSamh8UovOHRT3vKDquSEScJ7hhhBdIPmXVzuM/xCof "C (gcc) – Try It Online")
This outputs with a trailing newline. The function `f` does the outputting.
### Explanation
The output can be stated as a graph.
```
~|||||||||||||||||||||||||||||+|||||||||||||||||||||||||||||~
|~||||||||||||||||||||||||||||+||||||||||||||||||||||||||||~|
||~|||||||||||||||||||||||||||+|||||||||||||||||||||||||||~||
|||~||||||||||||||||||||||||||+||||||||||||||||||||||||||~|||
||||~|||||||||||||||||||||||||+|||||||||||||||||||||||||~||||
|||||~||||||||||||||||||||||||+||||||||||||||||||||||||~|||||
||||||~|||||||||||||||||||||||+|||||||||||||||||||||||~||||||
|||||||~||||||||||||||||||||||+||||||||||||||||||||||~|||||||
||||||||~|||||||||||||||||||||+|||||||||||||||||||||~||||||||
|||||||||~||||||||||||||||||||+||||||||||||||||||||~|||||||||
||||||||||~|||||||||||||||||||+|||||||||||||||||||~||||||||||
|||||||||||~|||||||||||||||||~+~|||||||||||||||||~|||||||||||
||||||||||||~|||||||||||||||~|+|~|||||||||||||||~||||||||||||
|||||||||||||~|||||||||||||~||+||~|||||||||||||~|||||||||||||
||||||||||||||~|||||||||||~|||+|||~|||||||||||~||||||||||||||
|||||||||||||||~|||||||||~||||+||||~|||||||||~|||||||||||||||
||||||||||||||||~|||||||~|||||+|||||~|||||||~||||||||||||||||
|||||||||||||||||~|||||~||||||+||||||~|||||~|||||||||||||||||
||||||||||||||||||~|||~|||||||+|||||||~|||~||||||||||||||||||
|||||||||||||||||||~|~|||||||||||||||||~|~|||||||||||||||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
```
(The `+`s are only shown for explanation purposes and represent the axes.)
The equation of this graph is \$y=\text{abs}(10-\text{abs}(x))\$ as can be seen here in this link to a [Desmos graph](https://www.desmos.com/calculator/f3r2t5atix).
```
abs(10 - abs(x))
abs(           )            Reflect whatever is beneath the x-axis to above the x-axis
    10 - abs(x)             This forms the central triangle-like structure
```
In function `f`, we have two for-loops that iterate through every coordinate in this graph. `y` goes from `20` to `1` and x goes from `-30` to `30`.
For every `x`, we check if `abs(10-abs(x))` equals `y` by doing `abs(10-abs(x))-y` in a ternary. If they are equal, this yields `0`, a falsey value in C, otherwise it will evaluate to some positive value. Then in the ternary `abs(10-abs(x))-y?"|":"~"`, we `printf` accordingly.
And after each line, we output a newline using `puts("")`, and that is how the function outputs with a trailing newline.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~16~~ 15 bytes
-1 byte thanks to notjagan
```
↘×~²⁰↗↗×~χ‖ＯＵＢ|
```
[Try it online!](https://tio.run/##S85ILErOT8z5//9R24zD0@sObXrUuOFR23QgAvLOtz9qmPZ@z/r3e7a@37Oo5v9/AA "Charcoal – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~70~~ 67 bytes
3 bytes thanks to Giuseppe.
```
write(c("|","~")[outer(abs(10-abs(-30:30)),20:1,"==")+1],"",61,,"")
```
[Try it online!](https://tio.run/##K/r/v7wosyRVI1lDqUZJR6lOSTM6v7QktUgjMalYw9BAF0TpGhtYGRtoauoYGVgZ6ijZ2ippahvG6igp6ZgZ6gApzf//AQ "R – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~18~~ 16 bytes
```
⁵×3ŒRAạ=þḤṚị⁾~|Y
```
[Try it online!](https://tio.run/##ASgA1/9qZWxsef//4oG1w5czxZJSQeG6oT3DvuG4pOG5muG7i@KBvn58Wf// "Jelly – Try It Online")
```
⁵×3ŒRAạ=þḤṚị⁾~|Y  Main link. No arguments.
⁵                 Set the argument and the return value to 10.
 ×3               Multiply by 3 to yield 30.
   ŒR             Balanced range; yield [-30, -29, ..., 29, 30].
     A            Take absolute values.
      ạ           Take absolute differences with 10.
         Ḥ        Unhalve; yield 20.
       =þ         Table equals; compare each result with each k in [1, ..., 20].
          Ṛ       Reverse the resulting 2D array.
           ị⁾~|   Index into "~|", yielding '~' for 1 and '|' for 0.
               Y  Separate by linefeeds.
```
[Answer]
# Python 2.7, ~~163~~ ~~138~~ ~~135~~ ~~133~~ ~~113~~ 91 bytes
```
l,t=S='|~'
for s in range(20):a=[l]*61;a[s]=a[60-s]=t;a[40-s]=a[20+s]=S[s>9];print`a`[2::5]
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P0enxDbYVr2mTp0rLb9IoVghM0@hKDEvPVXDyEDTKtE2OidWy8zQOjG6ONY2MdrMQBdIlwC5JmBWYrSRgTaQDo4utrOMtS4oyswrSUhMiDaysjKN/f8fAA)
Edit 1: -25 bytes: changed the algorithm after I felt a bit ambitious. :P
Edit 2: -3 bytes: courtesy [Felipe Nardi Batista](https://codegolf.stackexchange.com/users/66418/felipe-nardi-batista)
Edit 3: -2 bytes: courtesy [shooqie](https://codegolf.stackexchange.com/users/51530/shooqie)
Edit 4: -20 bytes: courtesy [notjagan](https://codegolf.stackexchange.com/users/63641/notjagan)
Edit 5: -22 bytes: courtesy [Leaky Nun](https://codegolf.stackexchange.com/users/48934/leaky-nun)
[Answer]
# [///](https://esolangs.org/wiki////), 231 bytes
```
/3/|~//2/\/\///1/!!20/|
2-/&#2,/|#2'/"""2&/||2%/1|2#/&~2"/1!2!/&&|/~'%,
3'1#0#'1~&
,'!,&0-'!3&&
!~'-!
!3'#!0!#'~!&
!,""%#!&0!-""%~!&&
1~"-"-1
%~"#3"#%
1#"~,"~%0%#%#!~%#%&
%,%~!#%~%&0"~!-!-!-"
"3!#%~!#"0"#!~%#!~"&
",,"~,"&0"-3"#3"&&
```
[Try it online!](https://tio.run/##HYwxrgMxCER7bsEgcIOFja/zmxSRUqTb1uLqG@/XSGj09Jjr@7o@7@u@Y8WuiIy/k4gZzDliU/YwSY8t2QJAWuydGnOnhFUiJieH2Y5q6rTalCFtlpE3dhu98TIjrtaZeDXhwdKKD3JAhW1wP@UQo1no6JO0IAuiNAXlKB0qR61zjdSPLFpqA8X9CQjrQSwY@Pe4YAT35/14fT2DZvf9Aw "/// – Try It Online") Or, view it interactively [here](http://conorobrien-foxx.github.io/slashes.html?JTJGMyUyRiU3Q34lMkYlMkYyJTJGJTVDJTJGJTVDJTJGJTJGJTJGMSUyRiEhMjAlMkYlN0MlMEEyLSUyRiUyNiUyMzIlMkMlMkYlN0MlMjMyJyUyRiUyMiUyMiUyMjIlMjYlMkYlN0MlN0MyJTI1JTJGMSU3QzIlMjMlMkYlMjZ+MiUyMiUyRjEhMiElMkYlMjYlMjYlN0MlMkZ+JyUyNSUyQyUwQTMnMSUyMzAlMjMnMX4lMjYlMEElMkMnISUyQyUyNjAtJyEzJTI2JTI2JTBBIX4nLSElMEEhMyclMjMhMCElMjMnfiElMjYlMEEhJTJDJTIyJTIyJTI1JTIzISUyNjAhLSUyMiUyMiUyNX4hJTI2JTI2JTBBMX4lMjItJTIyLTElMEElMjV+JTIyJTIzMyUyMiUyMyUyNSUwQTElMjMlMjJ+JTJDJTIyfiUyNTAlMjUlMjMlMjUlMjMhfiUyNSUyMyUyNSUyNiUwQSUyNSUyQyUyNX4hJTIzJTI1fiUyNSUyNjAlMjJ+IS0hLSEtJTIyJTBBJTIyMyElMjMlMjV+ISUyMyUyMjAlMjIlMjMhfiUyNSUyMyF+JTIyJTI2JTBBJTIyJTJDJTJDJTIyfiUyQyUyMiUyNjAlMjItMyUyMiUyMzMlMjIlMjYlMjY=)!
[Answer]
# [WendyScript](http://felixguo.me/wendy/), 65 bytes (exclude newline)
```
<<a=>(x)?x<0/>-x:/>x
#y:20->0{#x:-30->31?a(10-a(x))==y@"~":@"|"""}
```
[Try it online!](http://felixguo.me/#wendyScript)
Follows the same principle as the C answer given above. 
The first line is the `abs` function, second line runs two for loops and outputs `~` or `|` based on the graph. The last `""` is used to output a newline after each loop on `y`.
[Answer]
# Vim, 59 Bytes
```
2i~^[59i|^[qqYpi|^[f~l2xA|^[q18@q11G31|qqr~jlq9@qF~2lqqr~klq8@q
```
Where `^[` is the `<ESC>` key 
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 32 bytes
```
20ç|
AÆhX'~
VméA
VpWUVmw)c ê z ·
```
[Try it online!](http://ethproductions.github.io/japt/?v=1.4.5&code=MjDnfApBxmhYJ34KVm3pQQpWcFdVVm13KWMg6iB6ILc=&input=) Be sure to expand the output box.
## Explanation
```
20ç|
```
Set `U` to `|` repeated 20 times.
```
AÆhX'~
```
Set `V` to the range `[0,9]` (`AÆ`) mapped by:  
`U` (implicit) with the character at index `X` (current value) set to (`h`) `~`.
```
VméA
```
Set `W` to `V` with each line rotated 10 (`A`) chars right. 
```
VpWUVmw
```
Create array: `V, W, U`, and `V` with each line reversed (`w`). This is now the left half of the shape, rotated 90° left.
```
c ê z ·
```
Flatten the array (`c`), palendromize it (`ê`), rotate 90° right (`z`), and join with newlines (`·`).
[Answer]
# [Paintbrush](https://github.com/alexander-liao/paintbrush), 36 bytes
### non-competing
```
b|20{s~>v}10{>^s~}9{>vs~}>v20{>^s~}▁
```
## Explanation
```
b|20{s~>v}10{>^s~}9{>vs~}>v20{>^s~}▁  Program
b|                                    Sets the background character to `|`
  20{    }                            Executes function 20 times
     s~                               Sets the current character to `~`
       >v                             Moves one space right and one space down
          10{    }                    Executes function 10 times
             >^                       Moves one space right and one space up
               s~                     Sets the current character to `~`
                  9{    }             Executes function 9 times
                    >v                Moves one space right and one space down
                      s~              Sets the current character to `~`
                         >v           Moves one space right and one space down
                           20{    }   Executes function 20 times
                              >^      Moves one space right and one space up
                                s~    Sets the current character to `~`
                                   ▁  Cuts off the last line (because it pads an extra line when the pointer moves near the edge)
```
This reminds me, I need to add a mirror operation.
[Answer]
# **[Octave](https://octave-online.net/%20%22Octave%20Online), ~~157~~ ~~57~~ 54 bytes**
Golfed it further down, thanks to the other answers and the comments.
```
a=zeros(20,61);for i=-30:30;a(21-abs(10-abs(i)),i+31)=2;end
a=char(a+124)
```
I just approached it like the other answer with the abs(10-abs(x)) function and then used the right ASCII characters to print out the image.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 22 bytes
```
j_t.tm+*\|aTa30d\~61\|
```
[Try it online!](http://pyth.herokuapp.com/?code=j_t.tm%2B%2a%5C%7CaTa30d%5C~61%5C%7C&debug=0)
[Answer]
# [V](https://github.com/DJMcMayhem/V), 30 bytes
```
i~³°|19ñÙé|$xñ22|òr~klòÎæ$0Px
```
[Try it online!](https://tio.run/##AS0A0v92//9pfsKzwrB8GzE5w7HDmcOpfCR4w7EyMnzDsnJ@a2zDssOOw6YkMFB4//8 "V – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 18 bytes
```
61Rạ31ạ⁵Ṭ€z0Ṛị⁾~|Y
```
[Try it online!](https://tio.run/##y0rNyan8/9/MMOjhroXGhkDiUePWhzvXPGpaU2XwcOesh7u7HzXuq6uJ/P8fAA "Jelly – Try It Online")
[Answer]
# [Bubblegum](https://esolangs.org/wiki/Bubblegum), 90 bytes
```
00000000: 9dcb a10d 0040 08c5 50cf cc4d 673f 85ab  [[email protected]](/cdn-cgi/l/email-protection)?..
00000010: b880 22fd 7972 3f07 ef98 e1cc 85e1 ca05  ..".yr?.........
00000020: 8623 97d5 78c2 abf1 8457 e305 b31a 0f78  .#..x....W.....x
00000030: f507 0fcc 54fc 6ed3 794b b6d2 c1ed 163a  ....T.n.yK.....:
00000040: b8dd 42c7 68b7 d031 f757 3ab8 dd42 07b7  ..B.h..1.W:..B..
00000050: 5be8 e076 0b1d dcaf 060f                 [..v......
```
[Try it online!](https://tio.run/##XdC9TgMxEATgnqcYQb9a//uuCaJFSBRIKahsrx0KoEAKSp7@2EsuDVNZsvZbj@ux1s9@OH4tC2@ZMUmrKIYFzJ7BuQUEbgOteUFMbiCHUgFa80j0SvRy2BHdXQWjRs2ZYe0QpClZuMEJfUwZ3bSm492gFQ6rcU/nnx3dshlWjRytw5QkIOVmUeowyD4o5HSyOlPAI2U1HohO6/D@Qpw2w6kxgi7moTuDHw2xi9MX@YoaxaKZLjDRlWuXN/qm8/PFmDfDX7qIwNuWEHNNEHYGI@k7XKkZIt6Ck16o8UQfRIb283q8dQlqhNq1O6cIrkYgrQxw5IH/eSf6vf7EsvwB "Bubblegum – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), 22 bytes
```
I{S╒xñ♂-±Iï--mÆ┬û|~§yp
```
[Try it online!](https://tio.run/##AS4A0f9tYXRoZ29sZv//SXtT4pWSeMOx4pmCLcKxScOvLS1tw4bilKzDu3x@wqd5cP// "MathGolf – Try It Online")
## Explanation
It's probably possible to golf away 2-3 bytes from this, I'll see what I can do.
```
I                        push 20
 {                       start block or arbitrary length
  S                      push 30
   ╒                     range(1,n+1)
    x                    reverse int/array/string
     ñ                   pop(a), push palindromize(a) string/list/number
      ♂                  push 10
       -                 pop a, b : push(a-b)
        ±                absolute value
         I               push 20
          ï              index of current loop, or length of last loop
           -             pop a, b : push(a-b)
            -            pop a, b : push(a-b)
             m           explicit map
              Æ          start block of length 5
               ┬         check if equal to 0
                û|~      string "|~"
                   §     get from array/string
                    y    join array without separator to string or number
                     p   print with newline
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 75 bytes
```
f(x){for(x=1240;--x;)putchar(x%62?x/62+1-abs(10-abs(x%62-31))?124:126:10);}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9No0KzOi2/SKPC1tDIxMBaV7fCWrOgtCQ5IxEopmpmZF@hb2akbaibmFSsYWgApkDCusaGmpr2QC1WhkZmVoYGmta1/3MTM/M0gKZpgDgA "C (gcc) – Try It Online")
Totally changed from Cows quack's answer
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~20~~ 19 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
20F„|~20Ýû31∍ûNQèJ,
```
[Try it online.](https://tio.run/##ASUA2v9vc2FiaWX//zIwRuKAnnx@MjDDncO7MzHiiI3Du05Rw6hKLP//)
**Explanation:**
```
20F               # Loop 20 times:
   „|~            #  Push the string "|~"
   20Ý            #  List of range [0,20]
      û           #  Palindromize [0..20..0]
       31∍        #  Shorten to length 31 [0..20..10]
          û       #  Palindromize again [0..20..10..20..0]
           NQ     #  Check if the loop index is equal to it
             è    #  And index it into the string
              J   #  Then join the list of characters together
               ,  #  And print with trailing newline
```
`20Ýû31∍û` generates the list:
```
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,19,18,17,16,15,14,13,12,11,10,11,12,13,14,15,16,17,18,19,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 64 bytes
```
0..19|%{$y=$_
-join(0..20+19..10+11..19+20..0|%{'|~'[$_-eq$y]})}
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/30BPz9CyRrVapdJWJZ5LNys/M08DKGZkoG1oCZQCUoYgFdpGQEEDoDr1mjr1aJV43dRClcrYWs3a//8B "PowerShell – Try It Online")
The four-part diagram with a linear function `y=x`
[Answer]
# [Positron](https://github.com/alexander-liao/positron), 165 bytes
```
i=0;while(i<20)do{k='|'*(59-2*i);if(i==10)then{j='|'*19;k=j+'~'+j;};if(i>10)then{q=39-2*i;j='|'*q;q=2*i-21;k=j+'~'+'|'*q+'~'+j;}print@('|'*i+'~'+k+'~'+'|'*i);i=i+1;}
```
[Try it online!](https://tio.run/##PY1BDsIgEEWPA5Q0AYyLZhzjYazpgIFSSbqo9epox7TLef@9zJheVKYUayU0MA/07CVdnFH3tAQUb9HIc9e6hhTQQxKiNaoMfVw8j7aDgF6Lj9AeVlauu5HxxCX81QwZf1fr7JEw3uNxolhucmPELBzO9hxJW1hr/QI "Positron – Try It Online")
I think Positron has too many bugs in it. I should get it updated to TIO because then `++` will actually work.
[Answer]
## Mathematica, ~~78~~ 75 bytes
```
Print[""<>Riffle[Array[If[#+Abs[10-Abs[31-#2]]==21,"~","|"]&,{20,61}],"\n"]]
```
except the `\n` is replaced by an actual newline. [Try it online!](https://tio.run/##y00sychMLv7/P6AoM68kWknJxi4oMy0tJzXasagosTLaMy1aWdsxqTjayFDXNzMvWtlIx8xIV9koNtbW1shQR6lOSUepRilWTafayEDHzLA2VkeJSyk29v9/AA "Mathics – Try It Online") (There are extra spaces at the starts of the lines in Mathics for some reason, but [it works fine in Mathematica](https://sandbox.open.wolframcloud.com/).)
I came up with a submission of my own, but then [Kritixi Lithos](https://codegolf.stackexchange.com/a/131918/66104) added an explanation of theirs and it was quite similar to mine but using a slightly cleverer formula, so now this is just a port of that answer. (Go and read that one and upvote it!)
[Answer]
# [Bubblegum](https://esolangs.org/wiki/Bubblegum), 93 bytes
```
00000000: 9dcb 390e 4301 10c2 d09e 335b 9c3d 5d56  ..9.C.....3[.=]V
00000010: e72f 4c35 327a 65bf 86ee 9830 f342 5879  ./L52ze....0.BXy
00000020: 8130 f202 848d 9797 a613 262c bc7c 6a3a  .0........&,.|j:
00000030: 60c2 552e 9858 bcdc a2f9 55ac 9916 5e6f  `.U..X....U...^o
00000040: a285 d79b 6819 eb4d b4cc fe99 165e 6fa2  ....h..M.....^o.
00000050: 85d7 9b68 e1d5 26da 782f 3578 00         ...h..&.x/5x.
```
[Try it online!](https://tio.run/##NdC7SkQxEAbg3qf4KyuZzW2SzIKNtloqC@JiroooWy2s4rsfE/f4N4Ew@TIz@ZjzR3s9fi6LWrOF1JJhRTU4qzS0KgZVSYO1nCHFVnBlDxAJ3dKMfaLr58eLs6CH0YLpcMUyrAkJnnNH9K1BolXo1hlwDDKMzR2b7zYRRTe7r9Uww4h6lhplEF2skCAByWsL401BLqHAJ5uGoWjN5RX9vG9Xww7Dz@aZzfyY43hUC5LpMu5SgYj24OY78EIPRLtpjJP2h9Vww0gmMmqQDB@1oGVXkV0p6E0E2nOD78nMfRC9Ed3/tbI/0GrwnIVrgGQf0XTlMUFNCHHsyHKIUAr/OROXdNrwiZblFw "Bubblegum – Try It Online")
[Answer]
# JavaScript (ES6), 87 bytes
```
for(a=Math.abs,y=20;y--;console.log(s))for(s='',x=-30;x<31;x++)s+=a(10-a(x))+~y?'|':'~'
```
[Answer]
## Lua, 193 bytes
```
m={}function g(x,y)if(x<62)then
m[x+y*61]="~"if(x==31or x==21or x==41)then
b=not b
end
g(x+1,y+((b and-1)or 1))end
end
g(1,0)for y=0,19 do
s=""for x=1,61 do
s=s..(m[x+y*61]or"|")end
print(s)end
```
Note that Lua cannot print something out without creating a new line. For this reason, I have to break one of the rules.
Minimally minified to a large extent: 
```
map={}
o=20
p=61
--b is true means go up
function bounce(x,y,c)
    if (x~=p)then
        map[x+y*p]=c 
        if(x==31 or x==21 or x==41)then 
            b=not b 
        end
        bounce(x+1,y+((b and -1) or 1),c)
    end
end
bounce(1,0,"~")
--map[2+60] = "h"
for y=0,o-1 do
    str = ""
    for x=1,p do
        str = str..(map[x+y*p] or "|")
    end
    print(str)
end
```
Some changes where made during minification, all of which makes the program less extendable but smaller.
Try it: <https://tio.run/##PY7LCoMwEEX3@YqQVVJTcWwRCp0vKV1oNa1QJ0UjGPr49TRq6eoO91wOcx/LEDp8vs1IF9da4lc5aa9aI6djkSt3a4h1pynxmwLOKD5iJog7sD2Pmf9yD@u0QrKOV6yhmkVTAtonUla8pHoLKm5BqZmtHHSmTCw9ZhoOvLZsQCHMogRdwNoMaSr/L9hevMSiePQtOTnMdwhf>
I'm not sure if anyone has done this before, but I tried minifying by loading the program as a string and using gsub(search/replace). Unfortainitly, it made the program bigger. However, if this program was big enough, it would yield in less bytes.
```
g=string.gsub
loadstring(g(g(g('m={}function g(x,y)if(x<62vm[x+y*61]="~"if(x==31zx==21zx==41vb=not beg(x+1,y+((b and-1)z1))eeg(1,0)fzy=0,19 do s=""fzx=1,61 do s=s..(m[x+y*61]z"|")eprint(s)e','e',' end '),'v',')then '),'z','or '))()
```
Due to its relative closeness with the real result(240 bytes, only 41 more), I figured I'd post it. If this program where 350+ bytes, there would have likely been a reduction.
[Answer]
# Java 8, 113 bytes
```
v->{String r="";for(int i=-1,j;++i<20;r+="\n")for(j=61;j-->0;)r+=j==i|j+i==60|i>9&(j-i==20|j+i==40)?"~":"|";return r;}
```
I have the feeling the checks (`j==i|j+i==60|i>9&(j-i==20|j+i==40)` can definitely be golfed by somehow combining multiple checks into one.
**Explanation:**
[Try it here.](https://tio.run/##LY9BS8QwEIXv/oohB0moKdlFFjSm/gL3InhRDzGblYndtKRpQbb1r9cpLcwc3nvD8L1gByub1sdw@pldbbsOXizG6w0AxuzT2ToPx0UCvOaE8Rscf2vwBIPQ5E60NF22GR0cIYKBeZDVdTtOhjF9bhKnb4BG7u6CLgp82iudCsM@IhNLGsxhp4OUldKC/GAMjqFAYw5qxOrhlgdJYq9W816JZ/bHHtnIdPK5TxGSnma9srT9V00sG9KwsF6oEl@J3j/Biq3Pb5f9pWz6XLYUZR5Lx2Nf12KrNs3/)
```
v->{                    // Method with empty unused parameters and String return-type
  String r="";          //  Result-String
  for(int i=-1,j;       //  Index integers
      ++i<20;           //  Loop (1) from 0 to 20 (exclusive)
      r+="\n")          //    After every iteration: append a new-line to the result-String
    for(j=61;           //   Reset `j` to 61
        j-->0;)         //   Inner loop (2) from 60 down to 0 (inclusive)
      r+=               //    Append the result-String with:
         j==i           //     If `j` and `i` are equal (top-right /),
         |j+i==60       //     or `j` + `i` is 60 (top-left \),
         |i>9           //     or we're at the bottom halve
          &(j-i==20     //      and `j` - `i` is 20 (bottom left \),
            |j+i==40)?  //      or `j` + `i` is 40 (bottom right /)
          "~"           //       Append a literal "~" to the result-String
         :              //     Else:
          "|";          //      Append a literal "|" to the result-String
                        //   End of inner loop (2) (implicit / single-line body)
                        //  End of loop (1) (implicit / single-line body)
  return r;             //  Return the result-String
}                       // End of method
```
[Answer]
# [Perl 5](https://www.perl.org/), 79 bytes
```
push@a,[('|')x61]for 1..21;map$a[20-abs 10-abs][$_+30]='~',-30..30;say@$_ for@a
```
[Try it online!](https://tio.run/##K0gtyjH9/7@gtDjDIVEnWkO9Rl2zwswwNi2/SMFQT8/I0Do3sUAlMdrIQDcxqVjBEEzFRqvEaxsbxNqq16nr6Bob6OkZG1gXJ1Y6qMQrADU6JP7//y@/oCQzP6/4v66vqZ6BoQEA "Perl 5 – Try It Online")
[Answer]
# [Tcl](http://tcl.tk/), 104 bytes
```
time {incr j
set i 0
time {puts -nonewline [expr 21-abs(abs([incr i]-31)-10)-$j?"|":"~"]} 61
puts ""} 20
```
[Try it online!](https://tio.run/##K0nO@f@/JDM3VaE6My@5SCGLqzi1RCFTwYALIlhQWlKsoJuXn5danpOZl6oQnVpRUKRgZKibmFSsAcLRYG2ZsbrGhpq6hgaauipZ9ko1SlZKdUqxtQpmhlxgE5SUahWMDP7/BwA "Tcl – Try It Online")
---
# [Tcl](http://tcl.tk/), 105 bytes
```
time {incr j
set i 0
time {puts -nonewline [expr $j==21-abs(abs([incr i]-31)-10)?"~":"|"]} 61
puts ""} 20
```
[Try it online!](https://tio.run/##K0nO@f@/JDM3VaE6My@5SCGLqzi1RCFTwYALIlhQWlKsoJuXn5danpOZl6oQnVpRUKSgkmVra2Som5hUrAHC0WCtmbG6xoaauoYGmvZKdUpWSjVKsbUKZoZcYCOUlGoVjAz@/wcA "Tcl – Try It Online")
---
# [Tcl](http://tcl.tk/), 109 bytes
```
time {incr j;set i 0;time {append s [expr $j==21-abs(abs([incr i]-31)-10)?"~":"|"]} 61;set s $s\n} 20
puts $s
```
[Try it online!](https://tio.run/##K0nO@f@/JDM3VaE6My@5SCHLuji1RCFTwcAaIphYUJCal6JQrBCdWlFQpKCSZWtrZKibmFSsAcLRYD2ZsbrGhpq6hgaa9kp1SlZKNUqxtQpmhmCTihVUimPyahWMDLgKSktAvP//AQ "Tcl – Try It Online")
# Tcl, ~~143 133 123~~ 110
Still much ungolfed, but I will evolve it after:
```
time {incr j;set i 0;time {incr i;append s [expr $j==21-abs(abs($i-31)-10)?"~":"|"]} 61;set s $s\n} 20
puts $s
```
# [demo](http://rextester.com/VJZTA69769)
[Answer]
# [Python 3](https://docs.python.org/3/), 90 bytes
1 byte smaller than the other Python answer :)
Outputs with a trailing newline.
```
for y in range(20):print(''.join('~'if 20-y==abs(10-abs(x))else'|'for x in range(-30,31)))
```
[Try it online!](https://tio.run/##RcyxCoAgEADQX3G7O8iw3II@xsDqIk7RBoXo142mpre9WK89iG1tDUlVxaKSk83jaGiKieVCgP4ILAgP8KpGo@s8uyXjYPRHIfJn9nDDN5R/0NZ0diCi1l4 "Python 3 – Try It Online")
]