[Question]
  [
The [Triforce](https://en.wikipedia.org/wiki/Triforce) is a fictional artifact in [The Legend of Zelda](https://en.wikipedia.org/wiki/The_Legend_of_Zelda), made of three identical-looking equilateral triangles representing power, wisdom and courage. Several games in the saga include an animation when the three parts finally join together.
The purpose of this challenge is to draw a single 2D frame of such a simplified animation, with a given width for the triangles and a given spacing between the parts.
## Input
The input consists of two integers: a width \$w\ge1\$ and a spacing value \$s\ge0\$.
## Output
The frame has to be drawn according to the following specifications:
```
         /\
        /  \____________ this part is horizontally centered
       /    \
      /______\
                    \___ s empty lines
                    /
   /\          /\
  /  \        /  \______ w+1 backslashes
 /    \      /    \
/______\    /______\
                \_______ 2w underscores
        |__|
          \_____________ 2s spaces
```
In the above example, we have \$w=3\$ and \$s=2\$.
## More examples
\$w=1\$, \$s=0\$:
```
   /\   
  /__\  
 /\  /\ 
/__\/__\
```
\$w=2\$, \$s=0\$:
```
     /\     
    /  \    
   /____\   
  /\    /\  
 /  \  /  \ 
/____\/____\
```
\$w=3\$, \$s=3\$:
```
          /\          
         /  \         
        /    \        
       /______\       
   /\            /\   
  /  \          /  \  
 /    \        /    \ 
/______\      /______\
```
\$w=4\$, \$s=1\$:
```
          /\          
         /  \         
        /    \        
       /      \       
      /________\      
    /\          /\    
   /  \        /  \   
  /    \      /    \  
 /      \    /      \ 
/________\  /________\
```
## Rules
* Trailing spaces on each line are optional.
* Extra leading spaces on each line are not allowed.
* You may output a single extra leading newline and/or a single extra trailing newline.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'").
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~197~~ ~~194~~ ~~169~~ ~~167~~ ~~155~~ 144 bytes
```
w,s=input()
l=['']*(2*-~w+s)
for i in range(-~w):W=w-i;b='/'+'_ '[i<w]*2*i+'\\';l[i::w-~s]=' '*(w+s-~W)+b,' '*W+b+'  '*(W+s)+b
print'\n'.join(l)
```
[Try it online!](https://tio.run/##FcxNDoMgEEDhvadgN8BAm9CdlnOwUNOUpD/TmNGIDemGq1Ndvm/xlt/2ntnVmk3yxMt3k6qZfA8waum0LRmTap7zKkgQi/XOr4fcVbXBZ0td9HAGhJuAnq551E4TwjBAN/XUttmWNHoQoOX@sSUojObIgBFBHB72P8ZmWYk3GBhOn5lYTqrWi3F/ "Python 2 – Try It Online")
---
Saved:
* -3 bytes, thanks to Mr. Xcoder
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 25 bytes
```
←×_Ｎ↗⊕θ‖Ｍ≔⁺⊕θＮηＣη±η‖ＢＯ⊗⊕θ
```
[Try it online!](https://tio.run/##Xc49D4IwFIXhnV/RON0muOgmkx@LiSIhOhvAC21SSr3ckvDrKyQOyv6cN6dSBVVdYULISFuG3QVrjsVdt9jD6rmKxdk6z6lvSySQUibRFz5crhvFM6gIW7SML3jPIMfaYMVXTdRNmyTa971uLGTG9/Cvl/lYqMkfOzeCikWKTcEI6id68MxItRlvA5IpHJw6X5qptXghkxC20SasB/MB "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
←×_Ｎ
```
Input `w` and draw `w` `_`s.
```
↗⊕θ
```
Draw `w+1` `/`s.
```
‖Ｍ
```
Reflect to complete the first triangle.
```
≔⁺⊕θＮη
```
Input `s` and calculate the offset between the left and middle triangles.
```
Ｃη±η
```
Copy the left triangle to the middle.
```
‖ＢＯ⊗⊕θ
```
Reflect around the middle triangle to complete the triforce.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~127~~ 124 bytes
```
w,s=input()
n=2*-~w+s
while n:n-=1;I=w-n+(n>w)*(w-~s);print' '*n+('  '*(n+s)).join(['/'+I*2*' _'[I>=w]+'\\'][I>w:]*-~(n<=w))
```
[Try it online!](https://tio.run/##DY0xDsMgDAD3vILNNoRWZUxKdt6QoE6VQlU5qFBZXfJ1ynSnWy7/6n6wa03G4hPnb0Ua2DttTzFlkD29n4ontv42By@WDfIipFHsWWjOn8QVFOjeQXUim0J0eR2JcYUrmKCdBvWANSxeooFtg9hdptgXyHcvRK250f0B "Python 2 – Try It Online")
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), ~~20~~ ~~19~~ 16 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
＋├：⁸╵＼Ｌ_×；∔║ω╋║↕
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXVGRjBCJXUyNTFDJXVGRjFBJXUyMDc4JXUyNTc1JXVGRjNDJXVGRjJDXyVENyV1RkYxQiV1MjIxNCV1MjU1MSV1MDNDOSV1MjU0QiV1MjU1MSV1MjE5NQ__,i=NyUwQTA_,v=6)
Explanation:
```
+├                s + w + 2
  :               duplicated (for both X & Y)
   ⁸╵\            w+1 sized diagonal
      L_×         "_"*width of the diagonal
         ;∔       prepended before the diagonal
           ║      palindromize that
            ω     and push the argument of ║ (aka the unpalindromized version)
             ╋    overlap the upside down half-triangle over the upside down triangle at (s+w+2; s+w+2)
              ║   and palindromize the whole thing
               ↕  reverse everything vertically
```
note: in the making of this I fixed a mistake in the code, Without that fix, this would be [18 bytes](https://dzaima.github.io/Canvas/?u=JXVGRjBCJXUyNTFDJXVGRjFBJXUyMDc4JXUyNTc1JXVGRjNDJXVGRjJDXyVENyV1RkYxQiV1MjIxNCV1MjE5NSV1MjE5NSV1MjU1MSV1MDNDOSV1MjU0QiV1MjU1MSV1MjE5NQ__,i=NyUwQTA_,v=6).
[Answer]
# [R](https://www.r-project.org/), ~~225~~, ~~224~~, ~~214~~, ~~211~~, 208 bytes
```
function(w,s){M=matrix
C=cbind
h=w+1
k=C(apply(m<-diag(h)*60,1,rev)/4,m)
k[row(k)==h&!k]=63
z=rbind(C(a<-M(0,h,h+s),k,a),M(0,s,h*4+2*s),C(k,M(0,h,2*s),k))
z[]=intToUtf8(z+32,T)
apply(z,1,cat,sep='','
')
rm()}
```
[Try it online!](https://tio.run/##JU67TsNAEOz3L2jwrr1R/FJEka1cpwtVlOJwctzp8EPnIwYjvt3YuBrNaF5@1jLrz7YOtmtx5IF@TtKo4O0XVFK/2fYGRsYkAycVqr7/@MbmuLtZ9Y6G4kPKGfv7g/YlNwTu4rsRHYmY5yd3lUMBk/i1BJfwcXfClA2bZCB2rIhXPrCJyySPF61Cx5vlnzoimC5XsW04d69Bv@CUFDmfCbYf07Jdq8DDvZco4ggiAt8g/c4aM04JNOYbFFysUHJG8x8 "R – Try It Online")
* -1 byte thanks to Giuseppe
* -10 bytes after change of approach
* -3 bytes exploting ASCII code
* -3 bytes thanks to JayCe
[Answer]
# [Pascal (FPC)](https://www.freepascal.org/), ~~296~~ 264 bytes
```
const A='/';B='\';var w,s,i:word;u:string;begin read(w,s);u:=StringOfChar('_',2*w);for i:=1to w do writeln(A:w+3+s+w-i,B:i*2-1);writeln(A:w+2+s,u,B);for i:=1to s do writeln;for i:=1to w do writeln(A:w+2-i,B:i*2-1,A:2*(s+w-i)+3,B:i*2-1);write(A,u,B,A:2*s+1,u,B)end.
```
[Try it online!](https://tio.run/##fY2xDoMgFEV/hQ0QbCNuEAftB3To2qShopbEoOFp@XxqWWo7dLnLuTln1tDqMe/nNsZ2crCgusJHrJoKX7F6ao8CB25lmLxRq4TFWzeoezdYh3ynDdkw3UB1SeTcnx7aE3zDXGSBqn7yyMqqWCYUkNnG26UbHallYCUDFnLLG2kzkRdU7aFgwFfefBlgZ/hrFh8rr6XISApRVv60SP1upAuwIvU6Zw4xlki8AA "Pascal (FPC) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~256~~ ~~248~~ ~~240~~ ~~228~~ ~~199~~ 195 bytes
A longer program, but slightly different approach:
```
f,b,o='/\ '
O=o*2
w,s=input()
l=f+'__'*w+b
a=l+O*s+l
m=n=[]
p=lambda g:(len(a)-len(g))/2*o+g
for i in range(w):m=m+[p(f+O*i+b)];t=f+O*i+b;n+=p(t+O*(w-i+s)+t),
print'\n'.join(m+[p(l)]+[o]*s+n+[a])
```
[Try it online!](https://tio.run/##LY5BDoIwEEX3PUV37TBVE9xh5gwcABtTImBNO22ghnh6ROPq/7f4Lz@/yyNxvW2j6U0idbpKJVpKVS1Ws5Dn/CoaRKAR1e2mqhV74ShgWy0YRCSmzopMwcX@7uTU6DCwdnD4xgRwqquEkxjTLL30LGfH06BXaCJF7LIed5HHHuyl0L9fGCnrsoNeDx4XwAJG5NlzUVdWx2fyrH/jABa7ZPcnjJ2zsG1nU38A "Python 2 – Try It Online")
---
saved a lot of bytes thanks to ignoring the trailing whitespace, and incorporating some tricks from @ovs  
saved even more by defining a variable earlier
[Answer]
# [Ruby](https://www.ruby-lang.org/), 126 bytes
```
->w,s{(-v=w+1).upto(v){|i|j= ~-i%-~v;$><<[$/*s,$/+' '*(v+s)+t="/#{(j<w ?' ':?_)*j*2}\\".center(w*2+2)+' '*s*2,$/+t*2][0<=>i]}}
```
[Try it online!](https://tio.run/##HcvdCoMgGADQV4nmSD@zHy83rQcxGWwU1EUbacooe3X3c3vgLOv9HQcZWeNzs2HmpKc1KdaXfWJHtn3cJ5kcbDyzw11RI4RCJZgclTRLMsCOGkKtTMvThifhk/arl/ZGYAIeui4tHv1s@wV74JST/zHAf90C16oSshl1CHFQVV7r@AE "Ruby – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 141 bytes
```
\d+
$* 
(?=( *),( *))
¶$1/$`$`\$1$2$2$1/$`$`\
T` `\_`/ *\\(?=.*,)
s`¶(.*),( *)
$1¶$.2$*¶$1
\G(( *)/(  |__)*\\)\2(  )*\1 *¶
$2 $#3$* $#4$* $1¶
```
[Try it online!](https://tio.run/##LY4xCsMwDEV3nUKQP9iusbHTtXTsBTIKrEA7dOnQduy5coBczJUhCD764r@P3o/v87X2LvcTITC568Vx8HGIp31DyVCooKDaHI4WZZWmmYOIISlETx/dN5cOllAMThVhdJDc3Lhmx/xrzRvlpZqxrbBFCJUxzfYBpvNQo3ufY/0D "Retina 0.8.2 – Try It Online") Note: Some trailing whitespace in output. Explanation:
```
\d+
$* 
```
Convert the inputs into spaces. (The second line ends with a space.)
```
(?=( *),( *))
¶$1/$`$`\$1$2$2$1/$`$`\
```
Create the sides of the bottom two triangles with the appropriate spacing.
```
T` `\_`/ *\\(?=.*,)
```
Fill in the base of the triangles.
```
s`¶(.*),( *)
$1¶$.2$*¶$1
```
Duplicate the triangles with the appropriate vertical spacing.
```
\G(( *)/(  |__)*\\)\2(  )*\1 *¶
$2 $#3$* $#4$* $1¶
```
Convert the upper triangles into a single centred triangle.
[Answer]
# C (gcc), ~~404~~ 389 bytes
```
#define p(x)putchar(x);
#define F for
W;S;i;a=32;b=47;c=92;f(w,s){W=w,S=s;F(;w;--w){F(i=W+w+s+1;i--;)p(a)p(b)F(i=w*2;i++-2*W;)p(a)p(c)p(10)}F(i=W+s+1;i--;)p(a)p(b)F(i=0;i++-2*W;)p(95)p(c)F(;s--+1;)p(10)F(w=W;w;--w){F(i=w;i--;)p(a)p(b)F(i=w*2;i++-2*W;)p(a)p(c)F(i=w*2+S*2;i--;)p(a)p(b)F(i=w*2;i++-2*W;)p(a)p(c)p(10)}p(b)F(i=0;i++-2*W;)p(95)p(c)F(i=S*2;i--;)p(a)p(b)F(i=0;i++-2*W;)p(95)p(c)}
```
[Try it online!](https://tio.run/##lZGxCoMwEIbn@hSBLokxoLGlyJHVF3DIrFHbDFXRtimIz25jreAgpR0Ojvvvu/@HU@ys1Dju86LUVYEa/CTN/aYuaWs7cJZ5jMq6dSQkoCEVIYdMHE6gRMShxMbrSC@F8RLRQYzBAGOG9DHWQlJDOxqAZgxIg1NbGZkE43LQlDLuykVQtgKfDDO3SflrJjq@IWvYMWa3ZzzGRsh1BPOj@UegyST@Efd7Ni02720tD@Oj1jm6prrCU0dQ7@xKHHqI208M4ws "C (gcc) – Try It Online")
-14 bytes from [Rodolvertice](https://codegolf.stackexchange.com/questions/171516/ppcg-can-triforce/171547?noredirect=1#comment414156_171547)
-1 byte by fixing a loop variable decrementation
crossed out ~~404~~ is almost still 404
Ungolfed:
```
#define p(x)putchar(x); // save 7 bytes per putchar call (+24, -182)
#define F for // save 2 bytes per for loop (+14, -28)
int W, S, i; // W is w backup, S is s backup, i is an counter variable;
int a = ' '; // save 1 byte per space printed (+5, -8) (use a instead of 32)
int b = '/'; // save 1 byte per slash printed (+5, -6) (use b instead of 47)
int c = '\\'; // save 1 byte per backslash printed (+5, -6) (use c instead of 92)
// This isn't worth it for '\n' (-5, +3) (10), or '_' (-5, +3) (95)
int f(int w, int s) {
    W = w; // Backup w and s, as we will modify them later, 
    S = s; // but will need their original values
    for(; w != 0; --w) { // Top triangle (not the bottom line)
        for(i = W+w+s+1; i != 0; --i) // leading spaces
            putchar(' ');
        putchar('/'); // left side of triangle
        for(i = 2*w; i != 2*W; ++i) // inner spaces
            putchar(' ');
        putchar('\\'); // right side of triangle
        putchar('\n'); // newline
    }
    for(i = W+s+1; i != 0; --i)
        putchar(' '); // leading spaces for the bottom line
    putchar('/'); // left side
    for(i = 0; i != 2*W; ++i)
        putchar('_'); // the bottom line
    putchar('\\'); // right side
    for(; s-- + 1 != 0;)
        putchar('\n'); // newline after the bottom line and S empty lines
    for(w = W; w != 0; --w) { // Bottom triangles
        for(i = w; i != 0; --i)
            putchar(' '); // leading spaces
        putchar('/'); // left of left triangle
        for(i = w*2; i != 2*W; ++i)
            putchar(' '); // inside of left triangle
        putchar('\\'); // right of left triangle
        for(i = w*2+S*2; i != 0; --i)
            putchar(' '); // spaces between left and right triangles
        putchar('/');
        for(i = w*2; i != 2*W; ++i)
            putchar(' '); // inside of right triangle
        putchar('\\'); // right of right triangle
        putchar('\n'); // newline
    }
    putchar('//'); // left of left
    for(i = 0; i != 2*W; ++i)
        putchar('_'); // bottom of left triangle
    putchar('\\'); // right of left
    for(i = S*2; i != 0; --i)
        putchar(' '); // space between triangles
    putchar('/'); // left of right
    for(i = 0; i != 2*W; ++i)
        putchar('_'); // bottom of left triangle
    putchar('\\'); // right of right
}
        
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 51 bytes
```
+‘⁶ẋ;Ɱ®Y
‘⁼þ`a”/o"”_o⁶Ṛ;ṚØ^yƊ$€©ż`j€Ḥ⁶ẋƊ}Y,@çj‘⁷ẋƊ}
```
[Try it online!](https://tio.run/##y0rNyan8/1/7UcOMR43bHu7qtn60cd2hdZFcYIE9h/clJD5qmKufrwQk4/NBSnbOsgbiwzPiKo91qTxqWnNo5dE9CVlAxsMdSyBGHOuqjdRxOLw8C2zGdojI////jf8bAwA "Jelly – Try It Online")
]