[Question]
  [
Given any string, print it in the form of a triangle where the text runs up and down along each diagonal. For example, an input of `"Hello World"` should output:
```
                    d
                  l  
                r   d
              o   l  
            W   r   d
              o   l  
        o   W   r   d
      l       o   l  
    l   o   W   r   d
  e   l       o   l  
H   l   o   W   r   d
  e   l       o   l  
    l   o   W   r   d
      l       o   l  
        o   W   r   d
              o   l  
            W   r   d
              o   l  
                r   d
                  l  
                    d
```
The space between each character in a row must be at least 1, in order to maintain the proper format.
  
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~10~~ 7 bytes
```
↗ＥＬθ✂θι~~ＵＥ¹~~
```
~~[Try it online!](https://tio.run/##BcGxCoAgEADQ3a9wvAMbWmsOGgqiiGYxyYNDzST6@@s9F2xxybLIUihW6Pa80hWq0bPNMPl41QA3Gr0xOQ@30YSIvRq@6uMJLfYio2dO@kiFTyXNK83DPw "Charcoal – Try It Online")~~ [Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMMqtCAoMz2jREfBN7FAwyc1L70kQ6NQU0chOCczOVWjUEchU1NT0/r/f4/UnJx8hfD8opwUrv@6Zf91i3MA "Charcoal – Try It Online") Links are to verbose version of code. Explanation:
```
    ↗       Print up and to the right
     ＥＬθ✂θι All suffixes of the input, as a list down and to the right
    ~~ＵＥ¹~~     ~~Insert blank columns~~
```
~~First time I got to use the `ＵＥ` command.~~
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~10~~ ~~8~~ 7 bytes
Thanks to *Emigna* for saving 2 bytes!
```
ðâƶ.cðζ
```
Uses the **05AB1E** encoding. [Try it online!](https://tio.run/##MzBNTDJM/f//8IbDi45t00s@vOHctv//PVJzcvIVwvOLclIA "05AB1E – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 75 bytes
```
s=input()
k=l=len(s)
while k>1-l:k-=1;m=abs(k);print' '*m+' '.join(s[m::2])
```
[Try it online!](https://tio.run/##Dcu7CoAgFADQva@wSe0FNRq3uX@IhiIh8/pAjejrreVsx7/pdHbIOYKy/k6MFxoQUFoWefGcCiXRU9@i0C30o4Ftj0zz0QdlEyW0MvVvdzn1h8UIMaw8ZzpLRNeQxwU8SvoB "Python 2 – Try It Online")
Ruud saved 3 bytes.
[Answer]
# C, ~~86~~ ~~78~~ ~~73~~ 70 chars
```
for(int i=1,j=1-n;i=putchar(j*j<i*i&i-j?s[i-1]?:13:32)^13?i+1:++j<n;);
```
[Try it online!](https://tio.run/##PczLDoIwEIXhPU8xiYkBsYaCKy6y9Q1cEExIuU1Tp4ZCXBBeXWw37ibfnPyCCdXQsB@QhFraDiA3c4v6Mt68v1makAZnSDO8GiQ/WD0AMTYTmIpH8bWGAtZoy6wO3Wx8E7jTzcl@bEB15HDv9eQ7xoKfZcEZZVi8l9mlfHmSOZ7wiEyWpkLG6zLlSZrEwZMnJYY8DUOZU2Yz237vlNLw0JNqv6JXzWB29vkB "C (clang) – Try It Online")
### Explanation
Naive implementation: two cycles, fill from top to bottom, left to right (99 bytes):
```
for(int j=1;j<n*2;j++){for(int i=0;i<n;i++)printf("%c ",(i+j)%2&&i+1>=abs(j-n)?s[i]:' ');puts("");}
```
Here, puts() just prints \n to the output. Let’s combine variable declarations and combine j++ with something (94 bytes):
```
for(int i,j=0;++j<n*2;){for(i=0;i<n;i++)printf("%c ",(i+j)%2&&i>=abs(j-n)?s[i]:' ');puts("");}
```
Good. Variable j has a range 0...2n; let it be within -n...n, this makes the math simpler. Notice that boolean expression at the right of && always has the value 0 or 1. This means we can replace && with &. 91 byte:
```
for(int i,j=-n;++j<n;){for(i=0;i<n;i++)printf("%c ",~(i+j)%2&i>=abs(j)?s[i]:' ');puts("");}
```
And now we realized we printing an extra space. And yeah, we don’t need printf() to print just a single symbol. 86 bytes:
```
for(int i,j=-n;++j<n;){for(i=0;i<n;i++)putchar(~(i+j)%2&i>=abs(j)?s[i]:' ');puts("");}
```
Even better. Notice that condition i \* i>=j \* j is same as i>=abs(j), but shorter. Let’s move puts() into for loop increment expression. And guess what? Actually, we don’t need the braces around i+j. 78 bytes:
```
for(int i,j=-n;++j<n;puts(""))for(i=0;i<n;i++)putchar(i*i>=j*j&~i+j?s[i]:' '); 
```
Did you know that putchar() returns the character it has printed? Let’s use XOR to test numbers for equivalence. Let’s replace space with its ASCII code, 32. Remember that end-of-line character code is 13. And finally: did you know that GCC/Clang do support <https://en.wikipedia.org/wiki/Elvis_operator> ? 73 bytes:
```
for(int i,j=-n;++j<n;)for(i=0;putchar(i*i>=j*j&~i+j?s[i]?:13:32)^13;i++);
```
Finally, guess what? We don’t need two for loops. We can replace ugly ~i+j with just i-j. 70 bytes:
```
for(int i=1,j=1-n;i=putchar(j*j<i*i&i-j?s[i-1]?:13:32)^13?i+1:++j<n;);
```
Future work: change loop direction? This might save some bytes, if done properly.
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), ~~13~~ ~~10~~ 9 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
ēI*@∑}¹╚H
```
This uses a feature that I [just added](https://github.com/dzaima/SOGLOnline/commit/73fcff638b63b47cb3c7d727daa710a0e7c5abef), but was [documented](https://github.com/dzaima/SOGL/blob/ad1a893f24b6198074b4767e11ddc2a99ee3b807/P5ParserV0_12/data/charDefs.txt#L424) a while ago.
[Try it here!](https://dzaima.github.io/SOGLOnline/?code=JTJDJTdCJXUwMTEzSSpAJXUyMjExJTdEJUI5JXUyNTVBSA__,inputs=SGVsbG8lMjBXb3JsZA__)  
In that link `,` is added because this expects the input on the stack and `{` added because otherwise `,` would get executed every time in the loop
```
implicitly start loop over POP
ē            increase the variable E, on first push which will be 0
 I           increase by 1
  *          multiply the current character that many times
   @∑        join with spaces
     }     end loop
      ¹    wrap everything on stack in an array
       ╚   center vertically
        H  rotate counter-clockwise
```
[Answer]
# [Haskell](https://www.haskell.org/), 73 bytes
```
f s|l<-length s-1=[zipWith min s$(' '<$[1..abs x])++cycle"~ "|x<-[-l..l]]
```
[Try it online!](https://tio.run/##Dc2xCoMwGEXhvU9xCQFbJAH3uHfv4BAypBpr6G8iJoIt0ldPHQ98cCab3o6olBHpICXIhVeekETT6q9fOn/G7AMSv1aoFNeNlPaZsJtbXfefnhz7gR27ElqQlGRMme3pWwzxAixbfuQVElsgH1wCxwh2P48RXVxpYOUP "Haskell – Try It Online")
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 16 bytes
```
$:ċ⟪×$§×⟫†€|$¦tụ
```
[Try it online!](https://tio.run/##ATIAzf9nYWlh//8kOsSL4p@qw5ckwqfDl@Kfq@KAoOKCrHwkwqZ04bul//9IZWxsbyBXb3JsZA "Gaia – Try It Online")
### Explanation
```
$                 Split into list of chars
 :ċ               Push [1 .. len(input)]
   ⟪×$§×⟫†        Apply this block to corresponding elements of the two lists:
    ×              Repetition
     $             Split into chars
      §×           Join with spaces
          €|      Centre align the rows
            $¦    Split each line into chars
              t   Transpose
               ụ  Join each row with spaces, then join the rows together with newlines
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~86~~ 83 bytes
-3 thanks to officialaimm
```
lambda s,j=' '.join:map(j,zip(*(j(c*-~i).center(len(s)*2)for i,c in enumerate(s))))
```
[Try it online!](https://tio.run/##JYwxDgIhEAC/sh0LwSuuNLneH9hcg9wSl8BCOCy08OtI4rQzmfruzyLrCNs@ksuPw8Fp46ZALbGwXLOrGO2HKxqM6M3ly3rxJJ0aJhI8tVl1KA3YemABklem5jpNMxm1sXRQu/x/GFDdKKUC99LSoWbxAw "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 15 bytes
```
;€⁶ṁ"JUz⁶ZUŒBZG
```
[Try it online!](https://tio.run/##y0rNyan8/9/6UdOaR43bHu5sVPIKrQKyokKPTnKKcv///78HUEW@Qnh@UU4KAA "Jelly – Try It Online")
[Answer]
# Octave, ~~59~~ ~~63~~ ~~58~~ 57 bytes
```
@(s,a=@strjust)a([kron(+a(hankel(s)),[1 0;0 0]) '']',99)'
```
[Try it online!](https://tio.run/##BcGxCoAgEADQXxEX78jBRomgsT9oEIejhEhR8Kzfv95r56AviWzAltaNR39eHkgQcm8VJoKbak4FGNGGWbnFKRdRGRON9R6NUGXQeyqlqaP1cmmUHw "Octave – Try It Online")
[Answer]
## Java, 292 bytes (sorry)
```
public class D{
public static void main(String[]r){
String s=r[0];int L=s.length(),n=L*2-1,x=L-1,d=-1,i,j;boolean a=false,o=L%2==1;
for(i=0;i<n;i++){
for(j=0;j<L;j++)System.out.print(j<x||a&&j%2==(o?0:1)||!a&&j%2==(o?1:0)?' ':s.charAt(j));
System.out.println();
x+=d;if(x<0){x=0;d=1;}a=!a;}}}
```
[Answer]
# [Haskell](https://www.haskell.org/), 81 bytes
```
f s|l<-length s=[[last$' ':[s!!i|i>=n,mod(n+i)2<1]|i<-[0..l-1]]|n<-abs<$>[-l..l]]
```
[Try it online!](https://tio.run/##Dc2xDsIgEADQX7k2JNUoxDoa6Ozu4EAYMKWW9HqYHt34d@z6ljd7XgJirRNwQS0x0DfPwMZa9JxFB93DctPEEgdD1zWNJ7rE8133rkQt7U0plL1zhbT0H9ZisBIPc66uPhIY@O35lTdQsBNGCgwCJmifR5rgnTYc2/oH "Haskell – Try It Online")
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 116 bytes
```
s->{for(int l=s.length(),i=-l;++i<l;)System.out.printf("%"+l+"s%n",s.substring(i<0?-i:i).replaceAll("(.).","$1 "));}
```
[Try it online!](https://tio.run/##dY69asMwFIX3PMVFNCBhW7RrbaeULl06ZehQOii27Fz3WjLSVaAEP7trnNKt04Hz83EGczGFn6wb2q9lSifCBhoyMcKbQQfXHcCvG9nwKhePLYxrJo8c0PUfn2BCH9VWBRhWnk6MpLvkGkbv9It3MY02VLfBAVrL3hn2AeolFodr54NEx0B11GRdz2epcqwLKrMMKyrV8TuyHbVPrKcVwZ0Ue5FRJuLeiTzqmE5xY0us7p8KfESlg53INPaZSAqplRa5uHsAoVQ5L@V29e@GNk1jJ5biFc8o1L@pJfLw7gO1t9K8m5cf "Java (OpenJDK 8) – Try It Online")
## Explanation
```
s->{                                // Consumer<String> lambda
 for(int l=s.length(),i=-l;++i<l;)  // For each length between l and 1 and back to l, 
  System.out.printf("%"+l+"s%n",    // Print with align to right
    s.substring(i<0?-i:i)           // skip the first |i| characters
     .replaceAll("(.).","$1 ")      // replace every even-positioned character with a space.
   );
}
```
[Answer]
# C++, 135 bytes
Okay, here's my shot with C++:
```
auto f=[&](auto f,int y)->void{
  for(int i{};i<n;i++) putchar(y<0?f(f,y+1?i+1:n-1-i),'\n':i<y||i+y&1?' ':s[i]);
}; f(f,-1); f(f,-2);
```
[Try It Online (ideone)!](https://ideone.com/VhsZpN)
[Answer]
# [Haskell](https://www.haskell.org/), ~~140~~ 137 bytes
```
(m#n)s=(\(i,x)->' ':(last$"  ":[x:" "|rem i 2==m&&i>n]))=<<zip[0..]s
g s=((++)=<<reverse.tail)$id=<<[[(0#n)s,(1#n)s]|n<-[-1,1..length s]]
```
[Try it online!](https://tio.run/##FY6xDoIwFEVn@YqXSqQN0IgjocwOOjk41A5NaKCxLaSthhj@HWE6yRnOvYMMb2XMumJ7dCQw/MK6mEnZZpDV2MgQUwSAaj7XCNDilQUNF8bs6aRbJwhhTfPTEz9TKkLSw1bAeb5br77KB0Wj1IakutsU5/i8rxS42iEW15S8rIqKUqNcHwcIQqxWagcMuhGSg5XTHaZPfER/c5BCD@i63R3hOXrTofUP "Haskell – Try It Online")
*Saved 3 bytes thanls to Challenger5*
I don't think that's optimal...
`f` produces one of the lines (`m` = 0 or 1 is the modulo of the line number, `n` is the number of the line)
`g` intercalates "odd" and "even" lines, and add to the result a mirror of itself.
[Answer]
# [Pyth](https://pyth.readthedocs.io), 25 bytes
```
j+_Km++*d;@Qdtj;%2>QdUQtK
```
[Try it here.](https://pyth.herokuapp.com/?code=j%2B_Km%2B%2B%2ad%3B%40Qdtj%3B%252%3EQdUQtK&input=%22Hello+World%22&debug=0)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 18 bytes
```
JrLm€2Ṭ;€0a⁸o⁶ṚŒḄG
```
[Try it online!](https://tio.run/##y0rNyan8/9@ryCf3UdMao4c711gDaYPER4078h81bnu4c9bRSQ93tLj///9fyQOoNl8hPL8oJ0UJAA "Jelly – Try It Online")
[Answer]
## Mathematica 105 Bytes
```
(c=Characters@#;l=Length@c;StringRiffle@Table[If[Abs[j-l]<i&&EvenQ[j+i],c[[i]]," "],{j,1,2l+1},{i,1,l}])&
```
Maybe I could shave off another byte or two, but the character count overhead of dealing with strings in Mathematica makes simple challenges like this uncompetitive. 
[Answer]
# J, 54 bytes
```
[:|:|.@i.@#(>@],~' '#~[)"_1[:(,' '&,)/&.>>:@i.@#<@#"0]
```
[Try it online!](https://tio.run/##y/r/P03BVk8h2qrGqkbPIVPPQVnDziFWp05dQV25LlpTKd4w2kpDB8hT09HUV9Ozs7MCK7JxUFYyiOXiSk3OyFdIU1D3SM3JyVcIzy/KSVH//x8A) (note that the output on TIO has a newline and three spaces, but that isn't from the function call -- it's probably just what the J interpreter does automatically).
I think the general idea for solving this is right, but there are small things that I'm probably doing sub-optimally that are adding to the bytecount.
### Previous variants
55 bytes
```
<:@+:@#{.[:|:|.@i.@#(],~' '#~[)"_1>:@i.@#(,' '&,)/@#"0]
```
56 bytes
```
<:@+:@#{.[:|:|.@i.@#(],~' '#~[)"_1#{.[:(,' '&,)//.[:]\.]
```
# Explanation
This will be split into a few functions. Also, I wasn't as thorough with latter parts of the explanation, so let me know if you want a better explanation for a certain part and I can edit that in.
```
dup   =. >:@i.@# <@#"0 ]
space =. (,' '&,)/&.>
pad   =. |.@i.@# (>@],~' '#~[)"_1 ]
trans =. |:
```
* `dup` duplicates each character as many times as its index (plus one) in the string
* `space` inserts spaces between each character
* `pad` pads the characters with the right amount of spaces
* `trans` transposes the resulting matrix
Sample call:
```
   trans pad space dup 'abc'
  c
 b 
a c
 b 
  c
```
### Dup
```
>:@i.@# <@#"0 ]
>:@i.@#         Indices of each character plus one
      #          Length of the string
   i.            Range [0,length)
>:               Add one
        <@#"0 ] Duplicate each character as many times as it index (plus one)
           "0   For each
          #   ]  Copy the character
>:@i.@#           as many times as it index
        <        Box the result
```
The results are boxed to prevent J from padding the ends with spaces (since they're of uneven length).
Sample call:
```
   dup 'abc'
┌─┬──┬───┐
│a│bb│ccc│
└─┴──┴───┘
```
### Space
```
(,' '&,)/&.>
         &.>  For each boxed element
(,' '&,)/      Insert spaces between each
```
Sample call:
```
   space dup 'abc'
┌─┬───┬─────┐
│a│b b│c c c│
└─┴───┴─────┘
```
### Pad
```
|.@i.@# (>@],~' '#~[)"_1 ]
        (>@],~' '#~[)      Pad the right arg with spaces given by the left arg
|.@i.@#                    Indices in reverse order
   i. #                     Range [0,length)
|.                          Reverse
```
Basically, pad the first element with length - 1 spaces, the second with length - 2, etc. It also removes the boxing.
Sample call:
```
   pad space dup 'abc'
  a  
 b b 
c c c
```
### Transpose
This is just the built-in function `|:` which takes the transpose of a matrix.
[Answer]
# JavaScript (ECMAScript 6), 161 bytes
```
(s,n=console.log)=>s.split("").map((q,i,a,p)=>n(p=" ".repeat(q=a.length-++i)+a.map((v,j)=>j>=q&&j%2==q%2?a[j]+' ':'').join(''))||p).reverse().map((v,i)=>i&&n(v))
```
[Try it online!](https://tio.run/##NYy9CoMwFEZfJQSq92LM4FiIXfsGHUqHoBebkObHBHHw3W2gdPvgnPNZvek8rSaW3oeZTkeF7UydkIVXU/A5OJIuLKjGLHN0pgDnKD86AiRhhBaxIg9RccblSpF0gaS0dOSX8u67zmCnf/4mbHXtqFLT2MugVLoMN/20r65l7bVtUdpgPNSBxxGxvm20ZgL856bmpmk8bIjnDvxOzgX2CKubOZ5f "JavaScript (Node.js) – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 86 + 2 (-F) = 88 bytes
Used @Dom's suggestions and a few of my own tweaks to lower the byte count.
```
for$k(0..$#F){$i=1;$a[$#F+$k]=$a[$#F-$k]=[map$i++<$k|($i+$k)%2?$":$_,@F]}say"@$_"for@a
```
[Try it online!](https://tio.run/##K0gtyjH9X1qcqmCqZ2BoYP0/Lb9IJVvDQE9PRdlNs1ol09bQWiUxGsjRVsmOtYUwdUHM6NzEApVMbW0blewaDSBDJVtT1cheRclKJV7HwS22tjixUslBJV4JaKBD4v//Hqk5OfkK4flFOSn/8gtKMvPziv/rugEA "Perl 5 – Try It Online")
[Answer]
# q/kdb+, 55 bytes
**Solution:**
```
-1(+){{1_a,((2*y)#" ",z),a:x#" "}'[(|)c;1+c:(!)(#)x]x};
```
**Example:**
```
q)-1(+){{1_a,((2*y)#" ",z),a:x#" "}'[(|)c;1+c:(!)(#)x]x}"Hello World";
          d
         l
        r d
       o l
      W r d
       o l
    o W r d
   l   o l
  l o W r d
 e l   o l
H l o W r d
 e l   o l
  l o W r d
   l   o l
    o W r d
       o l
      W r d
       o l
        r d
         l
          d
```
**Explanation:**
TODO. ungolfed version is 66 bytes:
```
-1 flip{{1_a,((2*y)#" ",z),a:x#" "}'[reverse c;1+c:til count x]x};
```
**Bonus:**
To get the same output as the example (74 bytes):
```
q)-1(+){1_'raze{(a,((2*y)#" ",z),a:x#" ";(2*y+x)#" ")}'[(|)c;1+c:(!)(#)x]x}"Hello World";
                    d
                  l
                r   d
              o   l
            W   r   d
              o   l
        o   W   r   d
      l       o   l
    l   o   W   r   d
  e   l       o   l
H   l   o   W   r   d
  e   l       o   l
    l   o   W   r   d
      l       o   l
        o   W   r   d
              o   l
            W   r   d
              o   l
                r   d
                  l
                    d
```
]