[Question]
  [
Write a program or function that takes in an integer greater than 1 or less than -1. That is, the input won't be 0, 1, or -1.
If the input is `2`, the output should be:
```
|\_/|
|___|
```
If the input is `3`, the output should be:
```
|\_/\_/|
|______|
```
If the input is `4`, the output should be:
```
|\_/\_/\_/|
|_________|
```
The pattern continues in the same exact manner for larger inputs. For example, if the input is `10`, the output should be:
```
|\_/\_/\_/\_/\_/\_/\_/\_/\_/|
|___________________________|
```
If the input is `-2`, the output should be:
```
 ____
|    |
|_/\_|
```
If the input is `-3`, the output should be:
```
 _______
|       |
|_/\_/\_|
```
If the input is `-4`, the output should be:
```
 __________
|          |
|_/\_/\_/\_|
```
The pattern continues in the same exact manner for smaller inputs. For example, if the input is `-10`, the output should be:
```
 ____________________________
|                            |
|_/\_/\_/\_/\_/\_/\_/\_/\_/\_|
```
The output can be printed or returned as a string with an optional trailing newline. The top right "empty" corner of the output for negative inputs may be a space or it may remain empty.
**The shortest code in bytes wins.**
  
[Answer]
# CJam, ~~56~~ ~~50~~ 49 bytes
```
ri_(z"\_/"*'_@0>{\4>W<_,@*SooNoS}|1$,*]${'|\'|N}/
```
Try it online in the [CJam interpreter.](http://cjam.aditsu.net/#code=ri_(z%22%5C_%2F%22*'_%400%3E%7B%5C4%3EW%3C_%2C%40*SooNoS%7D%7C1%24%2C*%5D%24%7B'%7C%5C'%7CN%7D%2F&input=23)
### How it works
```
ri     e# Read an integer from STDIN and push it on the stack.
_(z    e# Push a copy, decrement it and apply absolute value.
       e# For positive n, (n -> n-1) and (-n -> n+1).
"\_/"* e# Repeat the string that many times.
'_     e# Push an underscore.
@0>    e# Check if the original integer is positive.
{      e# If it isn't:
  \    e#   Swap the generated string with the underscore.
  4>W< e#   Discard the string's first 4 and last character.
       e#   This makes the pattern of the bottom row start and end with an
       e#   underscore, truncating it to the correct length in the process.
  _,   e#   Push the length of a copy.
  @*   e#   Repeat the underscore that many times.
  So   e#   Print a space.
  oNo  e#   Print the underscores, then a linefeed.
  S    e#   Push a space.
}|     e#
1$,    e# Retrieve the strings length.
*      e# Repeat the underscore or space that many times.
]$     e# Wrap the two generated strings in an array and sort it.
{      e# For each string:
  '|\  e#   Push a vertical bar and swap the string on top of it.
  '|N  e#   Push a vertical bar and a linefeed.
}/     e#
```
[Answer]
# Pyth, ~~56~~ 54 bytes
I'm golfing Pyth on a phone with the online interpreter. That's a totally great idea.
**Update 2015-10-15:** I rewrote the thing (still on my phone, lol) and saved 2 bytes, of which one could've been done with the original too.
```
J<Q0Ljb"||"jPW!J_WJ[y<>*K+J*3t.aQ"\_/"JKy*K?Jd\_+d*K\_
```
[Try it online.](http://pyth.herokuapp.com/?code=J%3CQ0Ljb%22%7C%7C%22jPW!J_WJ%5By%3C%3E*K%2BJ*3t.aQ%22%5C_%2F%22JKy*K%3FJd%5C_%2Bd*K%5C_&input=4&debug=0)
[Answer]
## [Minkolang 0.8](http://esolangs.org/wiki/Minkolang), 100 bytes
```
"|"nd0`u!vbd3*["_"]"|"25*"|"1g["\_/"]"|"(O).
"[d~g1"_"<.)O(" "D*3R~1"_"*52"|"D*3R1dg2"| "*52"|"]"\/_
```
Just builds up the stack and then prints it all out at once. I'm sure this could be golfed but I've already spent a lot of time on this...
[Answer]
# Pyth, 45 bytes
```
jtW!J<Q0.b+.[YN+h*3t.aQJY.>[d.<"\_/"J\_)J" ||
```
Try it online: [Demonstration](http://pyth.herokuapp.com/?code=jtW!J%3CQ0.b%2B.%5BYN%2Bh*3t.aQJY.%3E%5Bd.%3C%22%5C_%2F%22J%5C_%29J%22%20%7C%7C&input=-4&test_suite_input=2%0A-2%0A3%0A-3&debug=0) or [Test Suite](http://pyth.herokuapp.com/?code=jtW!J%3CQ0.b%2B.%5BYN%2Bh*3t.aQJY.%3E%5Bd.%3C%22%5C_%2F%22J%5C_%29J%22%20%7C%7C&input=-4&test_suite=1&test_suite_input=2%0A-2%0A3%0A-3&debug=0)
### Explanation:
```
jtW!J<Q0.b+.[YN+h*3t.aQJY.>[d.<"\_/"J\_)J" ||  implicit: Q = input number
    J<Q0                                       assign Q < 0 to J
                           [           )       create a list with
                            d                    * the string " "
                             .<"\_/"J            * the string "\_/" rotated to 
                                                   the left by J
                                     \_          * the string "_"
                         .>             J      rotate to the right by J
                                         " ||  the string " ||"
        .b                                     binary mapping, N iterates
                                               over list, Y over string:
           .[YN+h*3t.aQJ                         pad Y with N to reach a string
                                                 of length 3*(abs(Q)-1)+1-J
          +             Y                        and append Y
 tW!J                                           remove the first line if Q > 0
j                                               print each on separate line
```
[Answer]
# JavaScript (ES6), ~~111~~ 98 bytes
Optimal technique discovered! Turns out removing all those interpolators from the template strings saves a *lot* of bytes. Perhaps it could still be made shorter, perhaps not. In any case, ES6 template strings (and arrow functions) are awesome. :)
```
x=>(x>0?`|\\_/A|
|___A|`:` ___A_
|   A |
|_/\\A_|`).replace(/(...)A/g,(_,y)=>y.repeat(x>0?x-1:~x))
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 67 bytes
```
ȧ=[‹`\_/`*\|:„+p,‹3*\_*\|:„+p,|N3*⇩:\_*ðp,ð*\|:„+p,ȧ`\_/`*ḢṪ\|:„+p,
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%C8%A7%3D%5B%E2%80%B9%60%5C_%2F%60*%5C%7C%3A%E2%80%9E%2Bp%2C%E2%80%B93*%5C_*%5C%7C%3A%E2%80%9E%2Bp%2C%7CN3*%E2%87%A9%3A%5C_*%C3%B0p%2C%C3%B0*%5C%7C%3A%E2%80%9E%2Bp%2C%C8%A7%60%5C_%2F%60*%E1%B8%A2%E1%B9%AA%5C%7C%3A%E2%80%9E%2Bp%2C&inputs=-4&header=&footer=)
Oof.
[Answer]
## Python 2.7, 144 bytes
This took more bytes than expected. Here's the code.
```
c=int(input())
p,w,n,u=list('| \n_')
a=abs(c)-1
d=3*a
if c>0:
 s=p+"\\_/"*a+p+n+p+u*d+p
else:
 d=d+1
 s=w+u*d+n+p+w*d+p+n+p+"_/\\"*a+u+p
print s
```
[Answer]
**Java, 272 Bytes**
```
String f(int i) {
String p = i>0?"\\_/":"_/\\_",x = "|"+new String(new char[(i<0?-i:i)-1]).replace("\0",p)+"|",
l=new String(new char[x.length()-2]).replace("\0","_");
return i>0?x+"\n|"+l+"|":" "+l+" \n|"+new String(new char[x.length()-2]).replace("\0"," ")+"|\n"+x;
}
```
[Answer]
# SpecBAS - 167 bytes
```
1 INPUT n: DIM s$="\_/","_/\": LET t$=s$(2-(n>0))*(ABS n-1)+("_"*(n<0)),u$="_"*LEN t$
2 TEXT IIF$(n>0,"|"+t$+"|"#13"|"+u$+"|"," "+u$+#13"|"+" "*LEN t$+"|"#13"|"+t$+"|")
```
`IIF$` is an inline `IF` statement, `#13` is a way of embedding newlines into a string (and doesn't always need a "+" if it's between hardcoded strings).
Since a few releases ago, SpecBAS lets you have multiple assignments to one `LET` statement, which helps save some characters.
[Answer]
# Python 2.7, 118 bytes
```
n=input()*3-3
a=-n-6
s=' %s_\n| %s|\n|%s_|'%(a*'_',a*' ',a/3*'_/\\')
if n>0:s='|%s|\n|%s|'%(n/3*'\\_/',n*'_')
print s
```
Getting down from 120 to 118 was fun!
[Answer]
# Ruby - 113 bytes
Seems too long. I'll try to golf this down a bit more.
```
n=gets.to_i;p,h=n.abs-1,?|;n>0 ? (puts h+'\\_/'*p+h,h+'___'*p+h):(k=p*3+1;puts' '+?_*k,h+' '*k+h,'|_'+'/\\_'*p+h)
```
[Answer]
# C#, 185 bytes
C# struggles with golfing repeating strings.
Completely golfed:
```
string S(int n){int m=n>0?n:-n;return string.Format(n>0?"|{0}\n|{1}|":" {1}\n|{2}|\n|_{0}","|".PadLeft(m).Replace(" ",n>0?@"\_/":@"/\_"),"".PadLeft(m=m*3-(n>0?3:2),'_'),"".PadLeft(m));}
```
Indentation and new lines added for clarity:
```
string S(int n){
    int m=n>0?n:-n;
    return string.Format(n>0?"|{0}\n|{1}|":" {1}\n|{2}|\n|_{0}",
        "|".PadLeft(m).Replace(" ",n>0?@"\_/":@"/\_"),
        "".PadLeft(m=m*3-(n>0?3:2),'_'),
        "".PadLeft(m)
    );
}
```
[Answer]
# Powershell - 200 190 186 168 154
Golfed out the equation (4-(($n-2)*3)) to (3*$n-6) along with some extraneous parens and semicolons.
Found that `n is the equivalent of `[Environment]::NewLine` and that `$s -f [args]` is the equivalent of `[String]::Format`:
```
$n=$args;if($n-gt0){$s="|{1}|{0}|{2}|";$a=$n;$b=$n*3}else{$n*=-1;$s=" {2}{0}|{3}|{0}|_/{1}\_|";$a=$n-2;$b=$c=3*$n-2};$s-f"`n",("\_/"*$a),("_"*$b),(" "*$c)
```
Explanation retains clarifying parentheses:
```
$n=$args;
// Basically a way of coming up with a string to format and the 
// necessary counts of repeated characters
if($n-gt0){
  // Placeholder format
  $s="|{1}|{0}|{2}|{3}";
  // Number of repeated "\_/" instances
  $a=$n;
  // Number of repeated "_" instances
  $b=$n*3
} else { 
  $n*=-1;
  $s=" {2}{0}|{3}|{0}|_/{1}\_|";
  $a=($n-2);
  $b=(4+(($n-2)*3));
  // Number of repeated " " instances .. not needed for "positive" saw
  $c=$b;
};
[String]::Format($s,[Environment]::NewLine,"\_/"*$a,"_"*$b," "*$c)
```
]