Construct a word ladder





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







30












$begingroup$


Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, relatively to the initial direction from left to right.



When you finish writing a word, change the direction and only then start writing the next word.



If your language doesn't support lists of words, or it's more convenient for you, you can take the input as a string of words, separated by a single space.



Leading and trailing whitespaces are allowed.



["hello", "world"] or "hello world"



hello
w
o
r
l
d


Here we start by writing hello and when we come to the next word (or in the case of the input as a string - a space is found), we change the relative direction to the right and continue to write world



Test cases:



["another", "test", "string"] or "another test string" ->   

another
t
e
s
tstring


["programming", "puzzles", "and", "code", "golf"] or "programming puzzles and code golf" ->

programming
p
u
z
z
l
e
sand
c
o
d
egolf

["a", "single", "a"] or "a single a" ->

a
s
i
n
g
l
ea


Wining criteria



The shortest code in bytes in every language wins. Don't let be discouraged by the golfing languages!



Sandbox










share|improve this question











$endgroup$










  • 1




    $begingroup$
    Related
    $endgroup$
    – Bassdrop Cumberwubwubwub
    May 23 at 7:48






  • 1




    $begingroup$
    @Arnauld Yes, I'll add it to the description.
    $endgroup$
    – Galen Ivanov
    May 23 at 9:04


















30












$begingroup$


Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, relatively to the initial direction from left to right.



When you finish writing a word, change the direction and only then start writing the next word.



If your language doesn't support lists of words, or it's more convenient for you, you can take the input as a string of words, separated by a single space.



Leading and trailing whitespaces are allowed.



["hello", "world"] or "hello world"



hello
w
o
r
l
d


Here we start by writing hello and when we come to the next word (or in the case of the input as a string - a space is found), we change the relative direction to the right and continue to write world



Test cases:



["another", "test", "string"] or "another test string" ->   

another
t
e
s
tstring


["programming", "puzzles", "and", "code", "golf"] or "programming puzzles and code golf" ->

programming
p
u
z
z
l
e
sand
c
o
d
egolf

["a", "single", "a"] or "a single a" ->

a
s
i
n
g
l
ea


Wining criteria



The shortest code in bytes in every language wins. Don't let be discouraged by the golfing languages!



Sandbox










share|improve this question











$endgroup$










  • 1




    $begingroup$
    Related
    $endgroup$
    – Bassdrop Cumberwubwubwub
    May 23 at 7:48






  • 1




    $begingroup$
    @Arnauld Yes, I'll add it to the description.
    $endgroup$
    – Galen Ivanov
    May 23 at 9:04














30












30








30


2



$begingroup$


Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, relatively to the initial direction from left to right.



When you finish writing a word, change the direction and only then start writing the next word.



If your language doesn't support lists of words, or it's more convenient for you, you can take the input as a string of words, separated by a single space.



Leading and trailing whitespaces are allowed.



["hello", "world"] or "hello world"



hello
w
o
r
l
d


Here we start by writing hello and when we come to the next word (or in the case of the input as a string - a space is found), we change the relative direction to the right and continue to write world



Test cases:



["another", "test", "string"] or "another test string" ->   

another
t
e
s
tstring


["programming", "puzzles", "and", "code", "golf"] or "programming puzzles and code golf" ->

programming
p
u
z
z
l
e
sand
c
o
d
egolf

["a", "single", "a"] or "a single a" ->

a
s
i
n
g
l
ea


Wining criteria



The shortest code in bytes in every language wins. Don't let be discouraged by the golfing languages!



Sandbox










share|improve this question











$endgroup$




Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, relatively to the initial direction from left to right.



When you finish writing a word, change the direction and only then start writing the next word.



If your language doesn't support lists of words, or it's more convenient for you, you can take the input as a string of words, separated by a single space.



Leading and trailing whitespaces are allowed.



["hello", "world"] or "hello world"



hello
w
o
r
l
d


Here we start by writing hello and when we come to the next word (or in the case of the input as a string - a space is found), we change the relative direction to the right and continue to write world



Test cases:



["another", "test", "string"] or "another test string" ->   

another
t
e
s
tstring


["programming", "puzzles", "and", "code", "golf"] or "programming puzzles and code golf" ->

programming
p
u
z
z
l
e
sand
c
o
d
egolf

["a", "single", "a"] or "a single a" ->

a
s
i
n
g
l
ea


Wining criteria



The shortest code in bytes in every language wins. Don't let be discouraged by the golfing languages!



Sandbox







code-golf ascii-art






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 at 9:05







Galen Ivanov

















asked May 23 at 7:35









Galen IvanovGalen Ivanov

9,1871 gold badge14 silver badges39 bronze badges




9,1871 gold badge14 silver badges39 bronze badges











  • 1




    $begingroup$
    Related
    $endgroup$
    – Bassdrop Cumberwubwubwub
    May 23 at 7:48






  • 1




    $begingroup$
    @Arnauld Yes, I'll add it to the description.
    $endgroup$
    – Galen Ivanov
    May 23 at 9:04














  • 1




    $begingroup$
    Related
    $endgroup$
    – Bassdrop Cumberwubwubwub
    May 23 at 7:48






  • 1




    $begingroup$
    @Arnauld Yes, I'll add it to the description.
    $endgroup$
    – Galen Ivanov
    May 23 at 9:04








1




1




$begingroup$
Related
$endgroup$
– Bassdrop Cumberwubwubwub
May 23 at 7:48




$begingroup$
Related
$endgroup$
– Bassdrop Cumberwubwubwub
May 23 at 7:48




1




1




$begingroup$
@Arnauld Yes, I'll add it to the description.
$endgroup$
– Galen Ivanov
May 23 at 9:04




$begingroup$
@Arnauld Yes, I'll add it to the description.
$endgroup$
– Galen Ivanov
May 23 at 9:04










32 Answers
32






active

oldest

votes













1 2
next












12












$begingroup$


Charcoal, 9 bytes



F⮌A«↑⮌ι‖↗


Try it online! Link is to verbose version of code. Explanation: Works by drawing the text backwards, transposing the canvas after every word. 10 bytes for string input:



F⮌S≡ι ‖↗←ι


Try it online! Link is to verbose version of code. Explanation: Draws the text backwards, transposing the canvas for spaces.






share|improve this answer









$endgroup$























    9












    $begingroup$


    C (gcc), 94 78 74 bytes



    -4 from Johan du Toit



    o,f;g(int*s){for(o=f=0;*s;s++)*s<33?f=!f:printf("n%*c"+!f,f*(o+=!f),*s);}


    Try it online!



    Prints the ladder, one character (of the input) at a time. Takes a space-separated string of words.






    share|improve this answer











    $endgroup$











    • 1




      $begingroup$
      Could change *s==32 into *s<33 to save a byte.
      $endgroup$
      – gastropner
      May 24 at 11:03










    • $begingroup$
      74 Bytes
      $endgroup$
      – Johan du Toit
      May 25 at 12:01



















    6












    $begingroup$


    05AB1E, 19 16 bytes



    €θ¨õšøíJD€gs24SΛ


    -3 bytes thanks to @Emigna.



    Try it online.



    General explanation:



    Just like @Emigna's 05AB1E answer (make sure to upvote him btw!!), I use the Canvas builtin Λ.



    The options I use are different however (which is why my answer is longer..):





    • b (the strings to print): I leave the first string in the list unchanged, and add the trailing character to each next string in the list. For example ["abc","def","ghi","jklmno"] would become ["abc","cdef","fghi","ijklmno"].


    • a (the sizes of the lines): This would be equal to these strings, so [3,4,4,7] with the example above.


    • c (the direction to print in): [2,4], which would map to [→,↓,→,↓,→,↓,...]


    So the example above would step-by-step do the following:




    1. Draw abc in direction 2/.

    2. Draw cdef in direction 4/ (where the first character overlaps with the last character, which is why we had to modify the list like this)

    3. Draw fghi in direction 2/ again (also with overlap of trailing/leading characters)

    4. Draw ijklmno in direction 4/ again (also with overlap)

    5. Output the result of the drawn Canvas immediately to STDOUT


    Code explanation:





    €θ                # Only leave the last characters in the (implicit) input-list
    ¨ # Remove the last one
    õš # And prepend an empty string "" instead
    ø # Create pairs with the (implicit) input-list
    í # Reverse each pair
    J # And then join each pair together to single strings
    D€g # Get the length of each string (without popping by duplicating first)
    s # Swap so the lengths are before the strings
    24S # Push [2,4]
    Λ # Use the Canvas builtin (which outputs immediately implicitly)





    share|improve this answer











    $endgroup$











    • 1




      $begingroup$
      Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
      $endgroup$
      – Emigna
      May 23 at 9:45










    • $begingroup$
      @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
      $endgroup$
      – Kevin Cruijssen
      May 23 at 10:15










    • $begingroup$
      Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
      $endgroup$
      – Grimy
      May 23 at 14:27










    • $begingroup$
      @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
      $endgroup$
      – Kevin Cruijssen
      May 23 at 14:30












    • $begingroup$
      õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
      $endgroup$
      – Grimy
      May 23 at 14:36



















    6












    $begingroup$


    05AB1E, 14 13 bytes



    Saved 1 byte thanks to Grimy



    €ðÀD€g>sŽ9÷SΛ


    Try it online!



    Explanation



                     # example input ["Hello", "World"]
    €ðÀ # push a space after each word
    # STACK: ["Hello"," ","World"," "]
    D # duplicate
    €g> # get the length of each word in the copy and add 1
    # these are the lengths to draw
    # STACK: ["Hello"," ","World"," "], [6, 2, 6, 2]
    s # swap the list of word to the top of the stack
    Ž9÷S # push [2, 5, 4, 1]
    # this is the list of directions to draw
    # 1=northeast, 2=east, 4=south, 5=southwest
    Λ # paint on canvas





    share|improve this answer











    $endgroup$











    • 1




      $begingroup$
      Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
      $endgroup$
      – Kevin Cruijssen
      May 23 at 7:50






    • 1




      $begingroup$
      Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
      $endgroup$
      – Kevin Cruijssen
      May 23 at 8:13












    • $begingroup$
      @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
      $endgroup$
      – Emigna
      May 23 at 9:29










    • $begingroup$
      13, other 13
      $endgroup$
      – Grimy
      May 23 at 11:49






    • 2




      $begingroup$
      My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
      $endgroup$
      – Grimy
      May 23 at 14:24



















    5












    $begingroup$


    Canvas, 17 12 11 10 bytes



    ø⁸⇵{⟳K└×∔⤢


    Try it here!



    Explanation:



    ø⁸⇵{⟳K└×∔⤢  full program taking array as input (loaded with ⁸)

    ø push an empty canvas ["test", "str"], ""
    ⁸⇵{ for each input word, in reverse: "str", "test" (showing 2nd iter)
    ⟳ rotate the word vertically "str", "t¶e¶s¶t"
    K pop off the last letter "str", "t¶e¶s", "t"
    └ swap the two items below top "t¶e¶s", "str", "t"
    × prepend "t¶e¶s", "tstr"
    ∔ vertically append "t¶e¶s¶tstr"
    ⤢ transpose the canvas "test
    s
    t
    r"





    share|improve this answer











    $endgroup$























      5












      $begingroup$

      JavaScript (ES8),  91 79  77 bytes



      Takes input as an array of words.





      a=>a.map((s,i)=>i&1?[...s].join(p):s+=p+=''.padEnd(s.length-!i),p=`
      `).join``


      Try it online!



      Commented



      a =>                 // a = input array
      a.map((s, i) => // for each word s at position i in a:
      i & 1 ? // if this is a vertical word:
      [...s].join(p) // split s and join it with p
      : // else:
      s += // add to s:
      p += // add to p:
      ''.padEnd( // as many spaces
      s.length // as there are letters in s
      - !i // minus 1 if this is the 1st word (because it's not connected
      ), // with the last letter of the previous vertical word)
      p = `n` // start with p = linefeed
      ).join`` // end of map(); join everything





      share|improve this answer











      $endgroup$















      • $begingroup$
        Use of p for keeping track of line endings is very smart +1
        $endgroup$
        – Downgoat
        May 30 at 23:04



















      5












      $begingroup$


      Python 2, 82 bytes





      b=p=0
      r=''
      for w in input():
      for c in w:r+='n'.ljust(p)*b+c;p+=1-b
      b^=1
      print r


      Try it online!






      share|improve this answer









      $endgroup$























        5












        $begingroup$


        brainfuck, 57 bytes



        ->,[[.<+>,],[<<[-]++++++++++.--[-<++++>]>[-<+<.>>]>.<,],]


        Try it online!



        Takes input as NUL separated strings. Note that this is using EOF as 0, and will stop working when the ladder exceeds 256 spaces.



        Explanation:



        -           Initialise counter as -1
        >,[ Start ladder
        [.<+>,] Print the first word, adding the length of it to the counter
        ,[ Loop over each letter of the second word
        <<[-]++++++++++. Print a newline
        --[-<++++>] Create a space character
        >[-<+<.>>] Print counter many spaces
        >.<, Print the letter and move to the next letter
        ]
        , Repeat until there are no more words
        ]





        share|improve this answer











        $endgroup$















        • $begingroup$
          May I ask for solution in Brain-Flak?
          $endgroup$
          – Galen Ivanov
          May 24 at 17:44










        • $begingroup$
          My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
          $endgroup$
          – Jonah
          May 25 at 18:52






        • 1




          $begingroup$
          @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
          $endgroup$
          – Jo King
          May 26 at 4:15





















        5












        $begingroup$

        JavaScript, 62 bytes





        a=>' '+a.replace(/./g,c=>1-c?(a=!a,''):a?(p+=' ',c):p+c,p=`
        `)


        Try it online!



        Thanks Rick Hitchcock, 2 bytes saved.





        JavaScript, 65 bytes





        a=>a.replace(/./g,c=>1-c?(t=!t,''):t?p+c:(p+=p?' ':`
        `,c),t=p='')


        Try it online!



        a=>a.replace(/./g,c=>( // for each character c in string a
        1 - c ? // if (c is space)
        (t = !t, // update t: boolean value describe word index
        // truthy: odd indexed words;
        // falsy: even indexed words
        '') : // generate nothing for space
        t? // if (is odd index) which means is vertical
        p+c : // add 'n', some spaces, and a sigle charater
        // else
        (p+=p?' ':'n', // prepare the prepend string for vertical words
        c) // add a single character
        ),
        t=p='' // initialize
        )





        share|improve this answer











        $endgroup$















        • $begingroup$
          I think you can save 2 bytes by replacing t with a, then removing t=
          $endgroup$
          – Rick Hitchcock
          May 24 at 21:43



















        5












        $begingroup$


        Aheui (esotope), 490 458 455 bytes



        삭뱃밸때샏배샐배새뱄밿때빠뱋빼쌘투@밧우
        @두내백뱃빼선대내백뱃섣@여우샐처샐추
        희차@@@뭏누번사@빼뭏오추뻐@@@배
        By@@@새대백@@@우뻐색
        Legen@@빼쵸누번@@빼
        DUST@@@샌뽀터본섣숃멓
        @@@@@@@오어아@먛요아@@샏매우
        @@@@@아@@@@@@오@@@@@서어
        @@@@@희차@@요


        Try it online!



        Slightly golfed by using full-width characters(2 bytes) instead Korean(3 bytes).



        Explanation



        Aheui is befunge-like esolang. Here is code with color:
        Aheui code with color
        ?1 part checks if current character is space or not.



        ?2 parts check whether words had written right-to-left or top-to-down.



        ?3 part is break condition of loop which types spaces.



        ?4 parts check if current character is end of line(-1).



        Red part is stack initialization. Aheui uses stacks (from Nothing to : 28 stacks) to store value.



        Orange part takes input() and check if it is space, by subtracting with 32(ascii code of space).



        Green part add 1 to stack which stores value of length of space, if writing right-to-left.



        Purple part is loop for printing spaces, if writing up-to-down.



        Grey part check if current character is -1, by adding one to current character.



        Blue part prints current character, and prepare for next character.






        share|improve this answer











        $endgroup$















        • $begingroup$
          What did you use to generate the image in this post?
          $endgroup$
          – bb94
          Jun 10 at 9:13










        • $begingroup$
          @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
          $endgroup$
          – LegenDUST
          Jun 10 at 9:14



















        4












        $begingroup$


        Japt -P, 15 bytes



        ò mrÈ+R+YÕùT±Xl


        Try it



        ò mrÈ+R+YÕùT±Xl     :Implicit input of string array
        ò :Partition into 2s
        m :Map each pair
        r : Reduce by
        È : Passing through the following function as X & Y
        + : Append to X
        R : Newline
        + : Append
        YÕ : Transpose Y
        ù : Left pad each line with spaces to length
        T± : T (initially 0) incremented by
        Xl : Length of X
        :Implicitly join and output





        share|improve this answer











        $endgroup$























          4












          $begingroup$

          bash, 119 chars



          X=("e7" "ne8")
          w="$@"
          l=${#w}
          d=0
          for((i=0;i<l;i++));do
          c="${w:$i:1}"
          [ -z $c ]&&d=$((1-d))||printf ${X[$d]}$c
          done


          This uses ANSI control sequences to move the cursor - here I'm only using save e7 and restore e8; but the restore has to be prefixed with n to scroll the output if it's already at the bottom of the terminal. For some reason it doesn't work if you're not already at the bottom of the terminal. * shrug *



          The current character $c is isolated as a single-character substring from the input string $w, using the for loop index $i as the index into the string.



          The only real trick I'm using here is [ -z $c ] which will return true, i.e. the string is blank, when $c is a space, because it's unquoted. In correct usage of bash, you would quote the string being tested with -z to avoid exactly this situation. This allows us flip the direction flag $d between 1 and 0, which is then used as an index into the ANSI control sequence array, X on the next non-space value of $c.



          I'd be interested to see something that uses printf "%${x}s" $c.



          Oh gosh let's add some whitespace. I can't see where I am...



          X=("e7" "ne8")
          w="$@"
          l=${#w}
          d=0
          for ((i=0;i<l;i++)); do
          c="${w:$i:1}"
          [ -z $c ] && d=$((1-d)) || printf ${X[$d]}$c
          done





          share|improve this answer









          $endgroup$















          • $begingroup$
            Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
            $endgroup$
            – Rich
            May 24 at 2:17



















          4












          $begingroup$


          Perl 6, 65 bytes





          {$/=0;.map:{$/+=$++%2??!.comb.fmt("%$/s","
          ").print!!.say*.comb}}


          Try it online!



          Anonymous code block that takes a list of words and prints straight to STDOUT.



          Explanation



          {                           }  # Anonymous code block
          $/=0; # Initialise $/ to 0
          .map:{ } # Map the list of words to
          $/+= # Increment $/ by
          $++%2?? # For even indexes
          .comb # Each letter of the word
          .fmt( ) # Formatted as
          "%$/s" # Padded with $/-1 spaces
          ,"n" # Joined by newlines
          .print # And printed without a newline
          ! # Boolean not this to add 0 to $/
          !! # For odd indexes
          .say # Print with a newline
          *.comb # And add the length of the word





          share|improve this answer











          $endgroup$















          • $begingroup$
            I'm curious how this one works Jo, I don't know Perl 6
            $endgroup$
            – Jonah
            May 24 at 2:23










          • $begingroup$
            @Jonah I've added an explanation
            $endgroup$
            – Jo King
            May 24 at 2:49










          • $begingroup$
            Thanks, nice solution.
            $endgroup$
            – Jonah
            May 24 at 3:17



















          3












          $begingroup$


          Charcoal, 19 bytes



          FLθ¿﹪鲫↓§θι↗»«§θι↙


          Input as a list of strings



          Try it online (verbose) or try it online (pure)



          Explanation:



          Loop in the range [0, input-length):



          For(Length(q))
          FLθ


          If the index is odd:



          If(Modulo(i,2)){...}
          ﹪鲫...»


          Print the string at index i in a downward direction:



          Print(:Down, AtIndex(q,i));
          ↓§θι


          And then move the cursor once towards the top-right:



          Move(:UpRight);



          Else (the index is even):



          Else{...}
          «...


          Print the string at index i in a regular right direction:



          Print(AtIndex(q,i));
          §θι


          And then move the cursor once towards the bottom-left:



          Move(:DownLeft);






          share|improve this answer











          $endgroup$























            3












            $begingroup$


            Python 2, 89 88 bytes





            s=i=-1
            r=''
            for w in input():r+=[('n'+' '*s).join(' '+w),w][i];s-=i*len(w);i=~i
            print r


            Try it online!






            share|improve this answer









            $endgroup$























              3












              $begingroup$


              C# (Visual C# Interactive Compiler), 122 bytes





              a=>{int i=0;var t="n";foreach(var z in a)Write(i++%2<1?z+(t+="".PadRight(z.Length-(i<2?1:0))):string.Join(t,z.Skip(0)));}


              Try it online!






              share|improve this answer









              $endgroup$























                3












                $begingroup$


                J, 47 45 43 bytes



                ;[`(([:<@(+/)#&>##$#:@1 2)@])`([' '"0/[)}]


                Try it online!



                I found a fun, different approach...



                I started messing around with left pads and zips with cyclic gerunds and so on, but then I realized it would be easier to just calculate each letter's position (this boils down to a scan sum of the correctly chosen array) and apply amend } to a blank canvas on the razed input.



                The solution is handled almost entirely by Amend }:



                ; [`(([: <@(+/) #&> # # $ #:@1 2)@])`([ ' '"0/ [)} ]




                • ; ( single verb that does all the work ) ] overall fork


                • ; left part razes the input, ie, puts all the letters into a contiguous string


                • ] right part is the input itself


                • (stuff)} we use the gerund form of amend }, which consists of three parts v0`v1`v2.



                  • v0 gives us the "new values", which is the raze (ie, all the characters of the input as one string), so we use [.


                  • v2 gives us the starting value, which we are transforming. we simply want a blank canvas of spaces of the needed dimensions. ([ ' '"0/ [) gives us one of size (all chars)x(all chars).

                  • The middle verb v1 selects which positions we will put our replacement characters in. This is the crux of the logic...



                • Starting at position 0 0 in the upper left, we notice that each new character is either 1 to the right of the previous position (ie, prev + 0 1) or one down (ie, prev + 1 0). Indeed we do the former "len of word 1" times, then the latter "len of word 2" times, and so on, alternating. So we'll just create the correct sequence of these movements, then scan sum them, and we'll have our positions, which we then box because that's how Amend works. What follows is just the mechanics of this idea...


                • ([: <@(+/) #&> # # $ 1 - e.@0 1)


                  • First #:@1 2 creates the constant matrix 0 1;1 0.


                  • # $ then extends it so it has as many rows as the input. eg, if the input contains 3 words it will produce 0 1;1 0;0 1.


                  • #&> # the left part of that is an array of the lengths of the input words and # is copy, so it copies 0 1 "len of word 1" times, then 1 0 "len of word 2 times", etc.


                  • [: <@(+/) does the scan sum and box.








                share|improve this answer











                $endgroup$























                  3












                  $begingroup$

                  T-SQL, 185 bytes



                  DECLARE @ varchar(max)='Thomas Clausen Codegolf Script'
                  ,@b bit=0,@s INT=0SET @+=':'WHILE @ like'%_:%'SELECT
                  @b+=len(left(@,1))-1,@=stuff(@,1,1,'')+iif(left(@,@b)='','','
                  '+space(@s))+trim(left(@,1)),@s+=len(left(@,~@b))PRINT
                  stuff(@,1,1,'')


                  Try it online






                  share|improve this answer











                  $endgroup$











                  • 1




                    $begingroup$
                    Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                    $endgroup$
                    – Muqo
                    May 24 at 12:13



















                  2












                  $begingroup$


                  Retina, 51 bytes



                  1,2,`w+
                  ;$&
                  +(m`^(.(.*?)) ?;(.)
                  $1¶$.2* $3;
                  ; |;$



                  Try it online!



                  A rather straightforward approach that marks every other word and then applies the transformation directly.



                  Explanation



                  1,2,`w+
                  ;$&


                  We mark every other word with a semicolon by matching each word, but only applying the replacement to the matches (which are zero indexed) starting from match 1 and then 3 and so on.



                  +(m`^(.(.*?)) ?;(.)
                  $1¶$.2* $3;


                  +(m sets some properties for the following stages. The plus begins a "while this group of stages changes something" loop, and the open bracket denotes that the plus should apply to all of the following stages until there is a close bracket in front of a backtick (which is all of the stages in this case). The m just tells the regex to treat ^ as also matching from the beginning of lines instead of just the beginning of the string.



                  The actual regex is pretty straightforward. We simply match the appropriate amount of stuff before the first semicolon and then use Retina's * replacement syntax to put in the correct number of spaces.



                  ; |;$



                  This stage is applied after the last one to remove semicolons and spaces at the end of words that we changed to vertical.






                  share|improve this answer









                  $endgroup$























                    2












                    $begingroup$


                    Retina 0.8.2, 58 bytes



                    (?<!^(S* S* )*S*)

                    ¶?

                    +`(..(.)*¶)((?<-2> )*S)
                    $1 $3


                    Try it online! Link includes test cases. Alternative solution, also 58 bytes:



                    ( S*) 
                    $1¶
                    +` (.)
                    ¶$1


                    +`(..(.)*¶)((?<-2> )*S)
                    $1 $3


                    Try it online! Link includes test cases.



                    I'm deliberately not using Retina 1 here, so I don't get operations on alternate words for free; instead I have two approaches. The first approach splits on all letters in alternate words by counting preceding spaces, while the second approach replaces alternate spaces with newlines and then uses the remaining spaces to help it split alternate words into letters. Each approach has to then join the last vertical letter with the next horizontal word, although the code is different because they split the words in different ways. The final stage of both approaches then pads each line until its first non-space character is aligned under the last character of the previous line.



                    Note that I don't assume that words are just letters because I don't have to.






                    share|improve this answer









                    $endgroup$























                      2












                      $begingroup$


                      PowerShell, 101 89 83 bytes



                      -12 bytes thanks to mazzy.



                      $args|%{$l+=if(++$i%2){$_.length-1;$t+=$_}else{1;$_|% t*y|%{$t+='
                      '+' '*$l+$_}}};$t


                      Try it online!






                      share|improve this answer











                      $endgroup$















                      • $begingroup$
                        nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                        $endgroup$
                        – mazzy
                        May 25 at 14:37










                      • $begingroup$
                        @mazzy, with the splatting i get wrong answer for foo. see the code.
                        $endgroup$
                        – Andrei Odegov
                        May 25 at 15:25










                      • $begingroup$
                        oO! The splatting splits one word to a char array. Interesting. Thanks!
                        $endgroup$
                        – mazzy
                        May 25 at 17:01








                      • 1




                        $begingroup$
                        @mazzy, it's not my fault :)
                        $endgroup$
                        – Andrei Odegov
                        May 25 at 17:54












                      • $begingroup$
                        I think we can use the rule Given a list of at least two words...
                        $endgroup$
                        – mazzy
                        May 25 at 18:03



















                      2












                      $begingroup$


                      PowerShell, 74 65 bytes





                      -join($args|%{$_|% t*y|%{($p+=(' ','
                      ')[!$p]*!$i)*$i;$_};$i=!$i})


                      Try it online!






                      share|improve this answer











                      $endgroup$























                        2












                        $begingroup$


                        R, 126 bytes





                        function(x,`>`=strrep)for(i in seq(x)){H=i%%2;cat(paste0('
                        '>!H,' '>F*!H,e<-'if'(H,x,strsplit(x,''))[[i]]))
                        F=F+nchar(e[1])-H}


                        Try it online!




                        • -3 bytes thanks to @Giuseppe






                        share|improve this answer











                        $endgroup$























                          2












                          $begingroup$

                          T-SQL, 289 bytes



                          DECLARE @ VARCHAR(MAX)='a a',@I INT=1,@S INT=0,@B INT=0WHILE @I<=LEN(@)IF SUBSTRING(@,@I,1)=''IF @B=0SELECT @S-=1,@=STUFF(@,@I,1,'
                          '+SPACE(@S)),@I+=@S+3,@B=1 ELSE SELECT @=STUFF(@,@I,1,''),@S+=1,@B=ELSE IF @B=0SELECT @I+=1,@S+=1 ELSE SELECT @=STUFF(@,@I,0,'
                          '+SPACE(@S)),@I+=@S+3PRINT @


                          This runs on SQL Server 2016 and other versions.



                          @ holds the space-delimited list. @I tracks the index position in the string. @S tracks the total number of spaces to indent from the left. @B tracks which axis the string is aligned with at point @I.



                          The byte count includes the minimal example list. The script goes through the list, character by character, and changes the string so that it will display according to the requirements. When the end of the string is reached, the string is PRINTed.






                          share|improve this answer











                          $endgroup$















                          • $begingroup$
                            Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                            $endgroup$
                            – t-clausen.dk
                            May 24 at 10:29










                          • $begingroup$
                            @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                            $endgroup$
                            – Muqo
                            May 24 at 10:55










                          • $begingroup$
                            confirmed it works now
                            $endgroup$
                            – t-clausen.dk
                            May 24 at 11:08



















                          1












                          $begingroup$


                          JavaScript (Node.js), 75 bytes





                          a=>a.map(x=>i++&1?[,...x].join(`
                          `.padEnd(n)):(n+=x.length,x),n=i=0).join``


                          Try it online!



                          Explanation and ungolfed



                          function f(a) {                   // Main function:
                          return a.map( // Map through all words:
                          function(x) {
                          if (i++ & 1) // If i % 2 == 1 (i.e. vertical):
                          return [,...x].join( // Since the first one needs to have its own linefeed
                          // and indentation, add a dummy item to the start.
                          "n".padEnd(n) // Join the array with the padded line feeds.
                          );
                          else { // If i % 2 == 0 (i.e. horizontal):
                          n += x.length; // Add the length of this string to the variable that
                          // counts how long the padded line feeds should be.
                          return x; // Append the string at the end without line feeds.
                          }
                          },
                          n = i = 0 // Initialize variables.
                          // n: the length of the padded line feeds
                          // (including the line feed)
                          // i: keeps track of the direction
                          ).join("") // Join all stuffs and return.
                          }





                          share|improve this answer











                          $endgroup$























                            1












                            $begingroup$


                            Stax, 12 bytes



                            ìZΣFτëWº═φ‼R


                            Run and debug it






                            share|improve this answer











                            $endgroup$























                              1












                              $begingroup$


                              Jelly, 21 bytes



                              Ẉm2Ä’x2Ż⁶xⱮṛ;⁷ɗ;ⱮY¥ƭ"


                              Try it online!



                              A full program taking the input as a list of strings and implicitly outputting to stdout the word ladder.






                              share|improve this answer









                              $endgroup$























                                1












                                $begingroup$


                                C (gcc), 93 87 bytes



                                Thanks to gastropner for the suggestions.



                                This version takes an array of strings terminated by a NULL pointer.





                                c,d;f(s,t)char**s,*t;{for(c=d=0;t=*s++;d=!d)for(;*t;c+=!d)printf("n%*c"+!d,d*c,*t++);}


                                Try it online!






                                share|improve this answer











                                $endgroup$















                                • $begingroup$
                                  87 bytes
                                  $endgroup$
                                  – gastropner
                                  May 24 at 11:09



















                                1












                                $begingroup$


                                Brain-Flak, 152 bytes



                                <>([()])<>{<>({}<>{()<({}<>)><>}<>)<>{}{<>({}<((()()()()()){})>)({<({}[()]<((((()()()()){}){}){})>)>()}{})<>(({}<>({}))[({}[{}])])<>}{}}<>{}{({}<>)<>}<>


                                Try it online!



                                I suspect this can be shorter by combining the two loops for odd and even words.






                                share|improve this answer









                                $endgroup$











                                • 1




                                  $begingroup$
                                  Thank you for this!
                                  $endgroup$
                                  – Galen Ivanov
                                  May 25 at 6:23



















                                1












                                $begingroup$

                                J, 35 33 bytes



                                3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y'


                                This is a verb that takes the input as a single string with the words separated by spaces. For example, you could call it like this:



                                3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y' 'programming puzzles and code golf'


                                The output is a matrix of letters and spaces, which the interpreter outputs with newlines as required. Each line will be padded with spaces so they have the exact same length.



                                There's one slight problem with the code: it won't work if the input has more than 98 words. If you want to allow a longer input, replace the _98 in the code by _998 to allow up to 998 words, etc.





                                Let me explain how this works through some examples.



                                Suppose we have a matrix of letters and spaces that we imagine is a partial output for some words, starting with a horizontal word.



                                   [m=: 3 3$'vwx  y  z'
                                vwx
                                y
                                z


                                How could we prepend a new word before this, vertically? It's not hard: just turn the new word to a single-column matrix of letters with the verb ,., then append the output to that single-column matrix. (The verb ,. is convenient because it behaves as an identity function if you apply it to a matrix, which we use for golfing.)



                                   (,.'cat') , m
                                c
                                a
                                t
                                vwx
                                y
                                z


                                Now we can't just iterate this way of prepending a word as is, because then we'd only get vertical words. But if we transpose the output matrix between each step, then every other word will be horizontal.



                                   (,.'dog') , |: (,.'cat') , m
                                d
                                o
                                g
                                catv
                                w
                                xyz


                                So our first attempt for a solution is to put each word into a single-column matrix, then fold these by appending and transposing between them.



                                   > (,|:)&.>/ ,.&.>;: 'car house dog children'
                                c
                                a
                                r
                                housed
                                o
                                g
                                children


                                But there's a big problem with this. This puts the first letter of the next word before turning a right angle, but the specification requires turning before putting the first letter, so the output should be something like this instead:



                                c             
                                a
                                rhouse
                                d
                                o
                                gchildren


                                The way we achieve this is to reverse the entire input string, as in



                                nerdlihc god esuoh rac


                                then use the above procedure to build the zig-zag but turning only after the first letter of each word:



                                n     
                                e
                                r
                                d
                                l
                                i
                                h
                                c
                                gode
                                s
                                u
                                o
                                h
                                rac


                                Then flip the output:



                                   [;.0> (,|:)&.>/ ,.&.>;:|. 'car house dog children'
                                car
                                h
                                o
                                u
                                s
                                edog
                                c
                                h
                                i
                                l
                                d
                                r
                                e
                                n


                                But now we have yet another problem. If the input has an odd number of words, then the output will have the first word vertical, whereas the specification says that the first word must be horizontal. To fix this, my solution pads the list of words to exactly 98 words, appending empty words, since that doesn't change the output.






                                share|improve this answer











                                $endgroup$



















                                  1 2
                                  next






                                  Your Answer






                                  StackExchange.ifUsing("editor", function () {
                                  StackExchange.using("externalEditor", function () {
                                  StackExchange.using("snippets", function () {
                                  StackExchange.snippets.init();
                                  });
                                  });
                                  }, "code-snippets");

                                  StackExchange.ready(function() {
                                  var channelOptions = {
                                  tags: "".split(" "),
                                  id: "200"
                                  };
                                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                                  StackExchange.using("externalEditor", function() {
                                  // Have to fire editor after snippets, if snippets enabled
                                  if (StackExchange.settings.snippets.snippetsEnabled) {
                                  StackExchange.using("snippets", function() {
                                  createEditor();
                                  });
                                  }
                                  else {
                                  createEditor();
                                  }
                                  });

                                  function createEditor() {
                                  StackExchange.prepareEditor({
                                  heartbeatType: 'answer',
                                  autoActivateHeartbeat: false,
                                  convertImagesToLinks: false,
                                  noModals: true,
                                  showLowRepImageUploadWarning: true,
                                  reputationToPostImages: null,
                                  bindNavPrevention: true,
                                  postfix: "",
                                  imageUploader: {
                                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                                  allowUrls: true
                                  },
                                  onDemand: true,
                                  discardSelector: ".discard-answer"
                                  ,immediatelyShowMarkdownHelp:true
                                  });


                                  }
                                  });














                                  draft saved

                                  draft discarded


















                                  StackExchange.ready(
                                  function () {
                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f186005%2fconstruct-a-word-ladder%23new-answer', 'question_page');
                                  }
                                  );

                                  Post as a guest















                                  Required, but never shown

























                                  32 Answers
                                  32






                                  active

                                  oldest

                                  votes








                                  32 Answers
                                  32






                                  active

                                  oldest

                                  votes









                                  active

                                  oldest

                                  votes






                                  active

                                  oldest

                                  votes








                                  1 2
                                  next










                                  12












                                  $begingroup$


                                  Charcoal, 9 bytes



                                  F⮌A«↑⮌ι‖↗


                                  Try it online! Link is to verbose version of code. Explanation: Works by drawing the text backwards, transposing the canvas after every word. 10 bytes for string input:



                                  F⮌S≡ι ‖↗←ι


                                  Try it online! Link is to verbose version of code. Explanation: Draws the text backwards, transposing the canvas for spaces.






                                  share|improve this answer









                                  $endgroup$




















                                    12












                                    $begingroup$


                                    Charcoal, 9 bytes



                                    F⮌A«↑⮌ι‖↗


                                    Try it online! Link is to verbose version of code. Explanation: Works by drawing the text backwards, transposing the canvas after every word. 10 bytes for string input:



                                    F⮌S≡ι ‖↗←ι


                                    Try it online! Link is to verbose version of code. Explanation: Draws the text backwards, transposing the canvas for spaces.






                                    share|improve this answer









                                    $endgroup$


















                                      12












                                      12








                                      12





                                      $begingroup$


                                      Charcoal, 9 bytes



                                      F⮌A«↑⮌ι‖↗


                                      Try it online! Link is to verbose version of code. Explanation: Works by drawing the text backwards, transposing the canvas after every word. 10 bytes for string input:



                                      F⮌S≡ι ‖↗←ι


                                      Try it online! Link is to verbose version of code. Explanation: Draws the text backwards, transposing the canvas for spaces.






                                      share|improve this answer









                                      $endgroup$




                                      Charcoal, 9 bytes



                                      F⮌A«↑⮌ι‖↗


                                      Try it online! Link is to verbose version of code. Explanation: Works by drawing the text backwards, transposing the canvas after every word. 10 bytes for string input:



                                      F⮌S≡ι ‖↗←ι


                                      Try it online! Link is to verbose version of code. Explanation: Draws the text backwards, transposing the canvas for spaces.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered May 23 at 9:22









                                      NeilNeil

                                      87k8 gold badges46 silver badges183 bronze badges




                                      87k8 gold badges46 silver badges183 bronze badges




























                                          9












                                          $begingroup$


                                          C (gcc), 94 78 74 bytes



                                          -4 from Johan du Toit



                                          o,f;g(int*s){for(o=f=0;*s;s++)*s<33?f=!f:printf("n%*c"+!f,f*(o+=!f),*s);}


                                          Try it online!



                                          Prints the ladder, one character (of the input) at a time. Takes a space-separated string of words.






                                          share|improve this answer











                                          $endgroup$











                                          • 1




                                            $begingroup$
                                            Could change *s==32 into *s<33 to save a byte.
                                            $endgroup$
                                            – gastropner
                                            May 24 at 11:03










                                          • $begingroup$
                                            74 Bytes
                                            $endgroup$
                                            – Johan du Toit
                                            May 25 at 12:01
















                                          9












                                          $begingroup$


                                          C (gcc), 94 78 74 bytes



                                          -4 from Johan du Toit



                                          o,f;g(int*s){for(o=f=0;*s;s++)*s<33?f=!f:printf("n%*c"+!f,f*(o+=!f),*s);}


                                          Try it online!



                                          Prints the ladder, one character (of the input) at a time. Takes a space-separated string of words.






                                          share|improve this answer











                                          $endgroup$











                                          • 1




                                            $begingroup$
                                            Could change *s==32 into *s<33 to save a byte.
                                            $endgroup$
                                            – gastropner
                                            May 24 at 11:03










                                          • $begingroup$
                                            74 Bytes
                                            $endgroup$
                                            – Johan du Toit
                                            May 25 at 12:01














                                          9












                                          9








                                          9





                                          $begingroup$


                                          C (gcc), 94 78 74 bytes



                                          -4 from Johan du Toit



                                          o,f;g(int*s){for(o=f=0;*s;s++)*s<33?f=!f:printf("n%*c"+!f,f*(o+=!f),*s);}


                                          Try it online!



                                          Prints the ladder, one character (of the input) at a time. Takes a space-separated string of words.






                                          share|improve this answer











                                          $endgroup$




                                          C (gcc), 94 78 74 bytes



                                          -4 from Johan du Toit



                                          o,f;g(int*s){for(o=f=0;*s;s++)*s<33?f=!f:printf("n%*c"+!f,f*(o+=!f),*s);}


                                          Try it online!



                                          Prints the ladder, one character (of the input) at a time. Takes a space-separated string of words.







                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited May 27 at 5:53

























                                          answered May 23 at 10:17









                                          attinatattinat

                                          1,8372 silver badges9 bronze badges




                                          1,8372 silver badges9 bronze badges











                                          • 1




                                            $begingroup$
                                            Could change *s==32 into *s<33 to save a byte.
                                            $endgroup$
                                            – gastropner
                                            May 24 at 11:03










                                          • $begingroup$
                                            74 Bytes
                                            $endgroup$
                                            – Johan du Toit
                                            May 25 at 12:01














                                          • 1




                                            $begingroup$
                                            Could change *s==32 into *s<33 to save a byte.
                                            $endgroup$
                                            – gastropner
                                            May 24 at 11:03










                                          • $begingroup$
                                            74 Bytes
                                            $endgroup$
                                            – Johan du Toit
                                            May 25 at 12:01








                                          1




                                          1




                                          $begingroup$
                                          Could change *s==32 into *s<33 to save a byte.
                                          $endgroup$
                                          – gastropner
                                          May 24 at 11:03




                                          $begingroup$
                                          Could change *s==32 into *s<33 to save a byte.
                                          $endgroup$
                                          – gastropner
                                          May 24 at 11:03












                                          $begingroup$
                                          74 Bytes
                                          $endgroup$
                                          – Johan du Toit
                                          May 25 at 12:01




                                          $begingroup$
                                          74 Bytes
                                          $endgroup$
                                          – Johan du Toit
                                          May 25 at 12:01











                                          6












                                          $begingroup$


                                          05AB1E, 19 16 bytes



                                          €θ¨õšøíJD€gs24SΛ


                                          -3 bytes thanks to @Emigna.



                                          Try it online.



                                          General explanation:



                                          Just like @Emigna's 05AB1E answer (make sure to upvote him btw!!), I use the Canvas builtin Λ.



                                          The options I use are different however (which is why my answer is longer..):





                                          • b (the strings to print): I leave the first string in the list unchanged, and add the trailing character to each next string in the list. For example ["abc","def","ghi","jklmno"] would become ["abc","cdef","fghi","ijklmno"].


                                          • a (the sizes of the lines): This would be equal to these strings, so [3,4,4,7] with the example above.


                                          • c (the direction to print in): [2,4], which would map to [→,↓,→,↓,→,↓,...]


                                          So the example above would step-by-step do the following:




                                          1. Draw abc in direction 2/.

                                          2. Draw cdef in direction 4/ (where the first character overlaps with the last character, which is why we had to modify the list like this)

                                          3. Draw fghi in direction 2/ again (also with overlap of trailing/leading characters)

                                          4. Draw ijklmno in direction 4/ again (also with overlap)

                                          5. Output the result of the drawn Canvas immediately to STDOUT


                                          Code explanation:





                                          €θ                # Only leave the last characters in the (implicit) input-list
                                          ¨ # Remove the last one
                                          õš # And prepend an empty string "" instead
                                          ø # Create pairs with the (implicit) input-list
                                          í # Reverse each pair
                                          J # And then join each pair together to single strings
                                          D€g # Get the length of each string (without popping by duplicating first)
                                          s # Swap so the lengths are before the strings
                                          24S # Push [2,4]
                                          Λ # Use the Canvas builtin (which outputs immediately implicitly)





                                          share|improve this answer











                                          $endgroup$











                                          • 1




                                            $begingroup$
                                            Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:45










                                          • $begingroup$
                                            @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 10:15










                                          • $begingroup$
                                            Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:27










                                          • $begingroup$
                                            @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 14:30












                                          • $begingroup$
                                            õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:36
















                                          6












                                          $begingroup$


                                          05AB1E, 19 16 bytes



                                          €θ¨õšøíJD€gs24SΛ


                                          -3 bytes thanks to @Emigna.



                                          Try it online.



                                          General explanation:



                                          Just like @Emigna's 05AB1E answer (make sure to upvote him btw!!), I use the Canvas builtin Λ.



                                          The options I use are different however (which is why my answer is longer..):





                                          • b (the strings to print): I leave the first string in the list unchanged, and add the trailing character to each next string in the list. For example ["abc","def","ghi","jklmno"] would become ["abc","cdef","fghi","ijklmno"].


                                          • a (the sizes of the lines): This would be equal to these strings, so [3,4,4,7] with the example above.


                                          • c (the direction to print in): [2,4], which would map to [→,↓,→,↓,→,↓,...]


                                          So the example above would step-by-step do the following:




                                          1. Draw abc in direction 2/.

                                          2. Draw cdef in direction 4/ (where the first character overlaps with the last character, which is why we had to modify the list like this)

                                          3. Draw fghi in direction 2/ again (also with overlap of trailing/leading characters)

                                          4. Draw ijklmno in direction 4/ again (also with overlap)

                                          5. Output the result of the drawn Canvas immediately to STDOUT


                                          Code explanation:





                                          €θ                # Only leave the last characters in the (implicit) input-list
                                          ¨ # Remove the last one
                                          õš # And prepend an empty string "" instead
                                          ø # Create pairs with the (implicit) input-list
                                          í # Reverse each pair
                                          J # And then join each pair together to single strings
                                          D€g # Get the length of each string (without popping by duplicating first)
                                          s # Swap so the lengths are before the strings
                                          24S # Push [2,4]
                                          Λ # Use the Canvas builtin (which outputs immediately implicitly)





                                          share|improve this answer











                                          $endgroup$











                                          • 1




                                            $begingroup$
                                            Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:45










                                          • $begingroup$
                                            @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 10:15










                                          • $begingroup$
                                            Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:27










                                          • $begingroup$
                                            @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 14:30












                                          • $begingroup$
                                            õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:36














                                          6












                                          6








                                          6





                                          $begingroup$


                                          05AB1E, 19 16 bytes



                                          €θ¨õšøíJD€gs24SΛ


                                          -3 bytes thanks to @Emigna.



                                          Try it online.



                                          General explanation:



                                          Just like @Emigna's 05AB1E answer (make sure to upvote him btw!!), I use the Canvas builtin Λ.



                                          The options I use are different however (which is why my answer is longer..):





                                          • b (the strings to print): I leave the first string in the list unchanged, and add the trailing character to each next string in the list. For example ["abc","def","ghi","jklmno"] would become ["abc","cdef","fghi","ijklmno"].


                                          • a (the sizes of the lines): This would be equal to these strings, so [3,4,4,7] with the example above.


                                          • c (the direction to print in): [2,4], which would map to [→,↓,→,↓,→,↓,...]


                                          So the example above would step-by-step do the following:




                                          1. Draw abc in direction 2/.

                                          2. Draw cdef in direction 4/ (where the first character overlaps with the last character, which is why we had to modify the list like this)

                                          3. Draw fghi in direction 2/ again (also with overlap of trailing/leading characters)

                                          4. Draw ijklmno in direction 4/ again (also with overlap)

                                          5. Output the result of the drawn Canvas immediately to STDOUT


                                          Code explanation:





                                          €θ                # Only leave the last characters in the (implicit) input-list
                                          ¨ # Remove the last one
                                          õš # And prepend an empty string "" instead
                                          ø # Create pairs with the (implicit) input-list
                                          í # Reverse each pair
                                          J # And then join each pair together to single strings
                                          D€g # Get the length of each string (without popping by duplicating first)
                                          s # Swap so the lengths are before the strings
                                          24S # Push [2,4]
                                          Λ # Use the Canvas builtin (which outputs immediately implicitly)





                                          share|improve this answer











                                          $endgroup$




                                          05AB1E, 19 16 bytes



                                          €θ¨õšøíJD€gs24SΛ


                                          -3 bytes thanks to @Emigna.



                                          Try it online.



                                          General explanation:



                                          Just like @Emigna's 05AB1E answer (make sure to upvote him btw!!), I use the Canvas builtin Λ.



                                          The options I use are different however (which is why my answer is longer..):





                                          • b (the strings to print): I leave the first string in the list unchanged, and add the trailing character to each next string in the list. For example ["abc","def","ghi","jklmno"] would become ["abc","cdef","fghi","ijklmno"].


                                          • a (the sizes of the lines): This would be equal to these strings, so [3,4,4,7] with the example above.


                                          • c (the direction to print in): [2,4], which would map to [→,↓,→,↓,→,↓,...]


                                          So the example above would step-by-step do the following:




                                          1. Draw abc in direction 2/.

                                          2. Draw cdef in direction 4/ (where the first character overlaps with the last character, which is why we had to modify the list like this)

                                          3. Draw fghi in direction 2/ again (also with overlap of trailing/leading characters)

                                          4. Draw ijklmno in direction 4/ again (also with overlap)

                                          5. Output the result of the drawn Canvas immediately to STDOUT


                                          Code explanation:





                                          €θ                # Only leave the last characters in the (implicit) input-list
                                          ¨ # Remove the last one
                                          õš # And prepend an empty string "" instead
                                          ø # Create pairs with the (implicit) input-list
                                          í # Reverse each pair
                                          J # And then join each pair together to single strings
                                          D€g # Get the length of each string (without popping by duplicating first)
                                          s # Swap so the lengths are before the strings
                                          24S # Push [2,4]
                                          Λ # Use the Canvas builtin (which outputs immediately implicitly)






                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited May 23 at 10:15

























                                          answered May 23 at 8:07









                                          Kevin CruijssenKevin Cruijssen

                                          49.3k7 gold badges83 silver badges245 bronze badges




                                          49.3k7 gold badges83 silver badges245 bronze badges











                                          • 1




                                            $begingroup$
                                            Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:45










                                          • $begingroup$
                                            @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 10:15










                                          • $begingroup$
                                            Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:27










                                          • $begingroup$
                                            @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 14:30












                                          • $begingroup$
                                            õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:36














                                          • 1




                                            $begingroup$
                                            Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:45










                                          • $begingroup$
                                            @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 10:15










                                          • $begingroup$
                                            Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:27










                                          • $begingroup$
                                            @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 14:30












                                          • $begingroup$
                                            õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:36








                                          1




                                          1




                                          $begingroup$
                                          Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
                                          $endgroup$
                                          – Emigna
                                          May 23 at 9:45




                                          $begingroup$
                                          Your versions 2/3/4 could save 3 bytes with €θ¨õšsøJ.
                                          $endgroup$
                                          – Emigna
                                          May 23 at 9:45












                                          $begingroup$
                                          @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 10:15




                                          $begingroup$
                                          @Emigna Thanks! Now that I see it it looks so simple.. And here I had three alternative 19-byters instead..
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 10:15












                                          $begingroup$
                                          Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
                                          $endgroup$
                                          – Grimy
                                          May 23 at 14:27




                                          $begingroup$
                                          Some alternatives to €θ¨õšsøJ are õIvy«¤}), õUεXì¤U} and ε¯Jθ줈} (the last two require --no-lazy). Unfortunately, those are all the same length. This would be much easier if one of the variables defaulted to ""...
                                          $endgroup$
                                          – Grimy
                                          May 23 at 14:27












                                          $begingroup$
                                          @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 14:30






                                          $begingroup$
                                          @Grimy "This would be much easier if one of the variables defaulted to ""..." Are you looking for õ, or you mean if X/Y/® would have been ""? Btw, nice 13 byter in the comment of Emigna's answer. Quite different than both mine and his tbh, with the directions [→,↙,↓,↗] that you've used.
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 14:30














                                          $begingroup$
                                          õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
                                          $endgroup$
                                          – Grimy
                                          May 23 at 14:36




                                          $begingroup$
                                          õ is not a variable. Yes, I mean a variable that defaults to "". I literally do õU at the start of one of the snippets, so if X (or any other variable) defaulted to "", it would trivially save two bytes. Thanks! Yeah, ↙↗ is a bit new, but I got the idea of interspersing the true writes with length 2 dummy writes from Emigna's answer.
                                          $endgroup$
                                          – Grimy
                                          May 23 at 14:36











                                          6












                                          $begingroup$


                                          05AB1E, 14 13 bytes



                                          Saved 1 byte thanks to Grimy



                                          €ðÀD€g>sŽ9÷SΛ


                                          Try it online!



                                          Explanation



                                                           # example input ["Hello", "World"]
                                          €ðÀ # push a space after each word
                                          # STACK: ["Hello"," ","World"," "]
                                          D # duplicate
                                          €g> # get the length of each word in the copy and add 1
                                          # these are the lengths to draw
                                          # STACK: ["Hello"," ","World"," "], [6, 2, 6, 2]
                                          s # swap the list of word to the top of the stack
                                          Ž9÷S # push [2, 5, 4, 1]
                                          # this is the list of directions to draw
                                          # 1=northeast, 2=east, 4=south, 5=southwest
                                          Λ # paint on canvas





                                          share|improve this answer











                                          $endgroup$











                                          • 1




                                            $begingroup$
                                            Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 7:50






                                          • 1




                                            $begingroup$
                                            Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 8:13












                                          • $begingroup$
                                            @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:29










                                          • $begingroup$
                                            13, other 13
                                            $endgroup$
                                            – Grimy
                                            May 23 at 11:49






                                          • 2




                                            $begingroup$
                                            My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:24
















                                          6












                                          $begingroup$


                                          05AB1E, 14 13 bytes



                                          Saved 1 byte thanks to Grimy



                                          €ðÀD€g>sŽ9÷SΛ


                                          Try it online!



                                          Explanation



                                                           # example input ["Hello", "World"]
                                          €ðÀ # push a space after each word
                                          # STACK: ["Hello"," ","World"," "]
                                          D # duplicate
                                          €g> # get the length of each word in the copy and add 1
                                          # these are the lengths to draw
                                          # STACK: ["Hello"," ","World"," "], [6, 2, 6, 2]
                                          s # swap the list of word to the top of the stack
                                          Ž9÷S # push [2, 5, 4, 1]
                                          # this is the list of directions to draw
                                          # 1=northeast, 2=east, 4=south, 5=southwest
                                          Λ # paint on canvas





                                          share|improve this answer











                                          $endgroup$











                                          • 1




                                            $begingroup$
                                            Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 7:50






                                          • 1




                                            $begingroup$
                                            Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 8:13












                                          • $begingroup$
                                            @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:29










                                          • $begingroup$
                                            13, other 13
                                            $endgroup$
                                            – Grimy
                                            May 23 at 11:49






                                          • 2




                                            $begingroup$
                                            My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:24














                                          6












                                          6








                                          6





                                          $begingroup$


                                          05AB1E, 14 13 bytes



                                          Saved 1 byte thanks to Grimy



                                          €ðÀD€g>sŽ9÷SΛ


                                          Try it online!



                                          Explanation



                                                           # example input ["Hello", "World"]
                                          €ðÀ # push a space after each word
                                          # STACK: ["Hello"," ","World"," "]
                                          D # duplicate
                                          €g> # get the length of each word in the copy and add 1
                                          # these are the lengths to draw
                                          # STACK: ["Hello"," ","World"," "], [6, 2, 6, 2]
                                          s # swap the list of word to the top of the stack
                                          Ž9÷S # push [2, 5, 4, 1]
                                          # this is the list of directions to draw
                                          # 1=northeast, 2=east, 4=south, 5=southwest
                                          Λ # paint on canvas





                                          share|improve this answer











                                          $endgroup$




                                          05AB1E, 14 13 bytes



                                          Saved 1 byte thanks to Grimy



                                          €ðÀD€g>sŽ9÷SΛ


                                          Try it online!



                                          Explanation



                                                           # example input ["Hello", "World"]
                                          €ðÀ # push a space after each word
                                          # STACK: ["Hello"," ","World"," "]
                                          D # duplicate
                                          €g> # get the length of each word in the copy and add 1
                                          # these are the lengths to draw
                                          # STACK: ["Hello"," ","World"," "], [6, 2, 6, 2]
                                          s # swap the list of word to the top of the stack
                                          Ž9÷S # push [2, 5, 4, 1]
                                          # this is the list of directions to draw
                                          # 1=northeast, 2=east, 4=south, 5=southwest
                                          Λ # paint on canvas






                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited May 23 at 14:39

























                                          answered May 23 at 7:40









                                          EmignaEmigna

                                          50.3k5 gold badges37 silver badges153 bronze badges




                                          50.3k5 gold badges37 silver badges153 bronze badges











                                          • 1




                                            $begingroup$
                                            Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 7:50






                                          • 1




                                            $begingroup$
                                            Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 8:13












                                          • $begingroup$
                                            @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:29










                                          • $begingroup$
                                            13, other 13
                                            $endgroup$
                                            – Grimy
                                            May 23 at 11:49






                                          • 2




                                            $begingroup$
                                            My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:24














                                          • 1




                                            $begingroup$
                                            Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 7:50






                                          • 1




                                            $begingroup$
                                            Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
                                            $endgroup$
                                            – Kevin Cruijssen
                                            May 23 at 8:13












                                          • $begingroup$
                                            @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
                                            $endgroup$
                                            – Emigna
                                            May 23 at 9:29










                                          • $begingroup$
                                            13, other 13
                                            $endgroup$
                                            – Grimy
                                            May 23 at 11:49






                                          • 2




                                            $begingroup$
                                            My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
                                            $endgroup$
                                            – Grimy
                                            May 23 at 14:24








                                          1




                                          1




                                          $begingroup$
                                          Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 7:50




                                          $begingroup$
                                          Oh dang, nice approach! I will post my 19-byte versions in a moment, but very nice with the Bifurcate and drawing just two letters.
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 7:50




                                          1




                                          1




                                          $begingroup$
                                          Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 8:13






                                          $begingroup$
                                          Btw, you know there is a builtin for interspersing, right? €Y¦ could be 2.ý (not that it would save any bytes here). And this is the first time where I've seen the new behavior of in comparison to the regular map being useful.
                                          $endgroup$
                                          – Kevin Cruijssen
                                          May 23 at 8:13














                                          $begingroup$
                                          @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
                                          $endgroup$
                                          – Emigna
                                          May 23 at 9:29




                                          $begingroup$
                                          @KevinCruijssen: I have seen used before but I've never used myself so I didn't think of it. is the regular map to me and I've often used it, the other one is the "new" map ;)
                                          $endgroup$
                                          – Emigna
                                          May 23 at 9:29












                                          $begingroup$
                                          13, other 13
                                          $endgroup$
                                          – Grimy
                                          May 23 at 11:49




                                          $begingroup$
                                          13, other 13
                                          $endgroup$
                                          – Grimy
                                          May 23 at 11:49




                                          2




                                          2




                                          $begingroup$
                                          My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
                                          $endgroup$
                                          – Grimy
                                          May 23 at 14:24




                                          $begingroup$
                                          My bad, I failed to notice the even/odd difficulty! Here's a 13 that should actually work: €ðÀD€g>sŽ9÷SΛ
                                          $endgroup$
                                          – Grimy
                                          May 23 at 14:24











                                          5












                                          $begingroup$


                                          Canvas, 17 12 11 10 bytes



                                          ø⁸⇵{⟳K└×∔⤢


                                          Try it here!



                                          Explanation:



                                          ø⁸⇵{⟳K└×∔⤢  full program taking array as input (loaded with ⁸)

                                          ø push an empty canvas ["test", "str"], ""
                                          ⁸⇵{ for each input word, in reverse: "str", "test" (showing 2nd iter)
                                          ⟳ rotate the word vertically "str", "t¶e¶s¶t"
                                          K pop off the last letter "str", "t¶e¶s", "t"
                                          └ swap the two items below top "t¶e¶s", "str", "t"
                                          × prepend "t¶e¶s", "tstr"
                                          ∔ vertically append "t¶e¶s¶tstr"
                                          ⤢ transpose the canvas "test
                                          s
                                          t
                                          r"





                                          share|improve this answer











                                          $endgroup$




















                                            5












                                            $begingroup$


                                            Canvas, 17 12 11 10 bytes



                                            ø⁸⇵{⟳K└×∔⤢


                                            Try it here!



                                            Explanation:



                                            ø⁸⇵{⟳K└×∔⤢  full program taking array as input (loaded with ⁸)

                                            ø push an empty canvas ["test", "str"], ""
                                            ⁸⇵{ for each input word, in reverse: "str", "test" (showing 2nd iter)
                                            ⟳ rotate the word vertically "str", "t¶e¶s¶t"
                                            K pop off the last letter "str", "t¶e¶s", "t"
                                            └ swap the two items below top "t¶e¶s", "str", "t"
                                            × prepend "t¶e¶s", "tstr"
                                            ∔ vertically append "t¶e¶s¶tstr"
                                            ⤢ transpose the canvas "test
                                            s
                                            t
                                            r"





                                            share|improve this answer











                                            $endgroup$


















                                              5












                                              5








                                              5





                                              $begingroup$


                                              Canvas, 17 12 11 10 bytes



                                              ø⁸⇵{⟳K└×∔⤢


                                              Try it here!



                                              Explanation:



                                              ø⁸⇵{⟳K└×∔⤢  full program taking array as input (loaded with ⁸)

                                              ø push an empty canvas ["test", "str"], ""
                                              ⁸⇵{ for each input word, in reverse: "str", "test" (showing 2nd iter)
                                              ⟳ rotate the word vertically "str", "t¶e¶s¶t"
                                              K pop off the last letter "str", "t¶e¶s", "t"
                                              └ swap the two items below top "t¶e¶s", "str", "t"
                                              × prepend "t¶e¶s", "tstr"
                                              ∔ vertically append "t¶e¶s¶tstr"
                                              ⤢ transpose the canvas "test
                                              s
                                              t
                                              r"





                                              share|improve this answer











                                              $endgroup$




                                              Canvas, 17 12 11 10 bytes



                                              ø⁸⇵{⟳K└×∔⤢


                                              Try it here!



                                              Explanation:



                                              ø⁸⇵{⟳K└×∔⤢  full program taking array as input (loaded with ⁸)

                                              ø push an empty canvas ["test", "str"], ""
                                              ⁸⇵{ for each input word, in reverse: "str", "test" (showing 2nd iter)
                                              ⟳ rotate the word vertically "str", "t¶e¶s¶t"
                                              K pop off the last letter "str", "t¶e¶s", "t"
                                              └ swap the two items below top "t¶e¶s", "str", "t"
                                              × prepend "t¶e¶s", "tstr"
                                              ∔ vertically append "t¶e¶s¶tstr"
                                              ⤢ transpose the canvas "test
                                              s
                                              t
                                              r"






                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited May 23 at 9:35

























                                              answered May 23 at 8:21









                                              dzaimadzaima

                                              17.3k2 gold badges27 silver badges66 bronze badges




                                              17.3k2 gold badges27 silver badges66 bronze badges


























                                                  5












                                                  $begingroup$

                                                  JavaScript (ES8),  91 79  77 bytes



                                                  Takes input as an array of words.





                                                  a=>a.map((s,i)=>i&1?[...s].join(p):s+=p+=''.padEnd(s.length-!i),p=`
                                                  `).join``


                                                  Try it online!



                                                  Commented



                                                  a =>                 // a = input array
                                                  a.map((s, i) => // for each word s at position i in a:
                                                  i & 1 ? // if this is a vertical word:
                                                  [...s].join(p) // split s and join it with p
                                                  : // else:
                                                  s += // add to s:
                                                  p += // add to p:
                                                  ''.padEnd( // as many spaces
                                                  s.length // as there are letters in s
                                                  - !i // minus 1 if this is the 1st word (because it's not connected
                                                  ), // with the last letter of the previous vertical word)
                                                  p = `n` // start with p = linefeed
                                                  ).join`` // end of map(); join everything





                                                  share|improve this answer











                                                  $endgroup$















                                                  • $begingroup$
                                                    Use of p for keeping track of line endings is very smart +1
                                                    $endgroup$
                                                    – Downgoat
                                                    May 30 at 23:04
















                                                  5












                                                  $begingroup$

                                                  JavaScript (ES8),  91 79  77 bytes



                                                  Takes input as an array of words.





                                                  a=>a.map((s,i)=>i&1?[...s].join(p):s+=p+=''.padEnd(s.length-!i),p=`
                                                  `).join``


                                                  Try it online!



                                                  Commented



                                                  a =>                 // a = input array
                                                  a.map((s, i) => // for each word s at position i in a:
                                                  i & 1 ? // if this is a vertical word:
                                                  [...s].join(p) // split s and join it with p
                                                  : // else:
                                                  s += // add to s:
                                                  p += // add to p:
                                                  ''.padEnd( // as many spaces
                                                  s.length // as there are letters in s
                                                  - !i // minus 1 if this is the 1st word (because it's not connected
                                                  ), // with the last letter of the previous vertical word)
                                                  p = `n` // start with p = linefeed
                                                  ).join`` // end of map(); join everything





                                                  share|improve this answer











                                                  $endgroup$















                                                  • $begingroup$
                                                    Use of p for keeping track of line endings is very smart +1
                                                    $endgroup$
                                                    – Downgoat
                                                    May 30 at 23:04














                                                  5












                                                  5








                                                  5





                                                  $begingroup$

                                                  JavaScript (ES8),  91 79  77 bytes



                                                  Takes input as an array of words.





                                                  a=>a.map((s,i)=>i&1?[...s].join(p):s+=p+=''.padEnd(s.length-!i),p=`
                                                  `).join``


                                                  Try it online!



                                                  Commented



                                                  a =>                 // a = input array
                                                  a.map((s, i) => // for each word s at position i in a:
                                                  i & 1 ? // if this is a vertical word:
                                                  [...s].join(p) // split s and join it with p
                                                  : // else:
                                                  s += // add to s:
                                                  p += // add to p:
                                                  ''.padEnd( // as many spaces
                                                  s.length // as there are letters in s
                                                  - !i // minus 1 if this is the 1st word (because it's not connected
                                                  ), // with the last letter of the previous vertical word)
                                                  p = `n` // start with p = linefeed
                                                  ).join`` // end of map(); join everything





                                                  share|improve this answer











                                                  $endgroup$



                                                  JavaScript (ES8),  91 79  77 bytes



                                                  Takes input as an array of words.





                                                  a=>a.map((s,i)=>i&1?[...s].join(p):s+=p+=''.padEnd(s.length-!i),p=`
                                                  `).join``


                                                  Try it online!



                                                  Commented



                                                  a =>                 // a = input array
                                                  a.map((s, i) => // for each word s at position i in a:
                                                  i & 1 ? // if this is a vertical word:
                                                  [...s].join(p) // split s and join it with p
                                                  : // else:
                                                  s += // add to s:
                                                  p += // add to p:
                                                  ''.padEnd( // as many spaces
                                                  s.length // as there are letters in s
                                                  - !i // minus 1 if this is the 1st word (because it's not connected
                                                  ), // with the last letter of the previous vertical word)
                                                  p = `n` // start with p = linefeed
                                                  ).join`` // end of map(); join everything






                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited May 23 at 10:36

























                                                  answered May 23 at 8:37









                                                  ArnauldArnauld

                                                  89.6k7 gold badges104 silver badges366 bronze badges




                                                  89.6k7 gold badges104 silver badges366 bronze badges















                                                  • $begingroup$
                                                    Use of p for keeping track of line endings is very smart +1
                                                    $endgroup$
                                                    – Downgoat
                                                    May 30 at 23:04


















                                                  • $begingroup$
                                                    Use of p for keeping track of line endings is very smart +1
                                                    $endgroup$
                                                    – Downgoat
                                                    May 30 at 23:04
















                                                  $begingroup$
                                                  Use of p for keeping track of line endings is very smart +1
                                                  $endgroup$
                                                  – Downgoat
                                                  May 30 at 23:04




                                                  $begingroup$
                                                  Use of p for keeping track of line endings is very smart +1
                                                  $endgroup$
                                                  – Downgoat
                                                  May 30 at 23:04











                                                  5












                                                  $begingroup$


                                                  Python 2, 82 bytes





                                                  b=p=0
                                                  r=''
                                                  for w in input():
                                                  for c in w:r+='n'.ljust(p)*b+c;p+=1-b
                                                  b^=1
                                                  print r


                                                  Try it online!






                                                  share|improve this answer









                                                  $endgroup$




















                                                    5












                                                    $begingroup$


                                                    Python 2, 82 bytes





                                                    b=p=0
                                                    r=''
                                                    for w in input():
                                                    for c in w:r+='n'.ljust(p)*b+c;p+=1-b
                                                    b^=1
                                                    print r


                                                    Try it online!






                                                    share|improve this answer









                                                    $endgroup$


















                                                      5












                                                      5








                                                      5





                                                      $begingroup$


                                                      Python 2, 82 bytes





                                                      b=p=0
                                                      r=''
                                                      for w in input():
                                                      for c in w:r+='n'.ljust(p)*b+c;p+=1-b
                                                      b^=1
                                                      print r


                                                      Try it online!






                                                      share|improve this answer









                                                      $endgroup$




                                                      Python 2, 82 bytes





                                                      b=p=0
                                                      r=''
                                                      for w in input():
                                                      for c in w:r+='n'.ljust(p)*b+c;p+=1-b
                                                      b^=1
                                                      print r


                                                      Try it online!







                                                      share|improve this answer












                                                      share|improve this answer



                                                      share|improve this answer










                                                      answered May 24 at 0:09









                                                      xnorxnor

                                                      97.7k19 gold badges201 silver badges461 bronze badges




                                                      97.7k19 gold badges201 silver badges461 bronze badges


























                                                          5












                                                          $begingroup$


                                                          brainfuck, 57 bytes



                                                          ->,[[.<+>,],[<<[-]++++++++++.--[-<++++>]>[-<+<.>>]>.<,],]


                                                          Try it online!



                                                          Takes input as NUL separated strings. Note that this is using EOF as 0, and will stop working when the ladder exceeds 256 spaces.



                                                          Explanation:



                                                          -           Initialise counter as -1
                                                          >,[ Start ladder
                                                          [.<+>,] Print the first word, adding the length of it to the counter
                                                          ,[ Loop over each letter of the second word
                                                          <<[-]++++++++++. Print a newline
                                                          --[-<++++>] Create a space character
                                                          >[-<+<.>>] Print counter many spaces
                                                          >.<, Print the letter and move to the next letter
                                                          ]
                                                          , Repeat until there are no more words
                                                          ]





                                                          share|improve this answer











                                                          $endgroup$















                                                          • $begingroup$
                                                            May I ask for solution in Brain-Flak?
                                                            $endgroup$
                                                            – Galen Ivanov
                                                            May 24 at 17:44










                                                          • $begingroup$
                                                            My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
                                                            $endgroup$
                                                            – Jonah
                                                            May 25 at 18:52






                                                          • 1




                                                            $begingroup$
                                                            @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
                                                            $endgroup$
                                                            – Jo King
                                                            May 26 at 4:15


















                                                          5












                                                          $begingroup$


                                                          brainfuck, 57 bytes



                                                          ->,[[.<+>,],[<<[-]++++++++++.--[-<++++>]>[-<+<.>>]>.<,],]


                                                          Try it online!



                                                          Takes input as NUL separated strings. Note that this is using EOF as 0, and will stop working when the ladder exceeds 256 spaces.



                                                          Explanation:



                                                          -           Initialise counter as -1
                                                          >,[ Start ladder
                                                          [.<+>,] Print the first word, adding the length of it to the counter
                                                          ,[ Loop over each letter of the second word
                                                          <<[-]++++++++++. Print a newline
                                                          --[-<++++>] Create a space character
                                                          >[-<+<.>>] Print counter many spaces
                                                          >.<, Print the letter and move to the next letter
                                                          ]
                                                          , Repeat until there are no more words
                                                          ]





                                                          share|improve this answer











                                                          $endgroup$















                                                          • $begingroup$
                                                            May I ask for solution in Brain-Flak?
                                                            $endgroup$
                                                            – Galen Ivanov
                                                            May 24 at 17:44










                                                          • $begingroup$
                                                            My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
                                                            $endgroup$
                                                            – Jonah
                                                            May 25 at 18:52






                                                          • 1




                                                            $begingroup$
                                                            @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
                                                            $endgroup$
                                                            – Jo King
                                                            May 26 at 4:15
















                                                          5












                                                          5








                                                          5





                                                          $begingroup$


                                                          brainfuck, 57 bytes



                                                          ->,[[.<+>,],[<<[-]++++++++++.--[-<++++>]>[-<+<.>>]>.<,],]


                                                          Try it online!



                                                          Takes input as NUL separated strings. Note that this is using EOF as 0, and will stop working when the ladder exceeds 256 spaces.



                                                          Explanation:



                                                          -           Initialise counter as -1
                                                          >,[ Start ladder
                                                          [.<+>,] Print the first word, adding the length of it to the counter
                                                          ,[ Loop over each letter of the second word
                                                          <<[-]++++++++++. Print a newline
                                                          --[-<++++>] Create a space character
                                                          >[-<+<.>>] Print counter many spaces
                                                          >.<, Print the letter and move to the next letter
                                                          ]
                                                          , Repeat until there are no more words
                                                          ]





                                                          share|improve this answer











                                                          $endgroup$




                                                          brainfuck, 57 bytes



                                                          ->,[[.<+>,],[<<[-]++++++++++.--[-<++++>]>[-<+<.>>]>.<,],]


                                                          Try it online!



                                                          Takes input as NUL separated strings. Note that this is using EOF as 0, and will stop working when the ladder exceeds 256 spaces.



                                                          Explanation:



                                                          -           Initialise counter as -1
                                                          >,[ Start ladder
                                                          [.<+>,] Print the first word, adding the length of it to the counter
                                                          ,[ Loop over each letter of the second word
                                                          <<[-]++++++++++. Print a newline
                                                          --[-<++++>] Create a space character
                                                          >[-<+<.>>] Print counter many spaces
                                                          >.<, Print the letter and move to the next letter
                                                          ]
                                                          , Repeat until there are no more words
                                                          ]






                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited May 26 at 4:13

























                                                          answered May 24 at 11:59









                                                          Jo KingJo King

                                                          30.5k3 gold badges71 silver badges138 bronze badges




                                                          30.5k3 gold badges71 silver badges138 bronze badges















                                                          • $begingroup$
                                                            May I ask for solution in Brain-Flak?
                                                            $endgroup$
                                                            – Galen Ivanov
                                                            May 24 at 17:44










                                                          • $begingroup$
                                                            My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
                                                            $endgroup$
                                                            – Jonah
                                                            May 25 at 18:52






                                                          • 1




                                                            $begingroup$
                                                            @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
                                                            $endgroup$
                                                            – Jo King
                                                            May 26 at 4:15




















                                                          • $begingroup$
                                                            May I ask for solution in Brain-Flak?
                                                            $endgroup$
                                                            – Galen Ivanov
                                                            May 24 at 17:44










                                                          • $begingroup$
                                                            My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
                                                            $endgroup$
                                                            – Jonah
                                                            May 25 at 18:52






                                                          • 1




                                                            $begingroup$
                                                            @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
                                                            $endgroup$
                                                            – Jo King
                                                            May 26 at 4:15


















                                                          $begingroup$
                                                          May I ask for solution in Brain-Flak?
                                                          $endgroup$
                                                          – Galen Ivanov
                                                          May 24 at 17:44




                                                          $begingroup$
                                                          May I ask for solution in Brain-Flak?
                                                          $endgroup$
                                                          – Galen Ivanov
                                                          May 24 at 17:44












                                                          $begingroup$
                                                          My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
                                                          $endgroup$
                                                          – Jonah
                                                          May 25 at 18:52




                                                          $begingroup$
                                                          My first attempt to understand BF. 2 questions: How is the first word being printed when there is no . char in line 3 (of the commented version)? I was trying to play with the input on TIO. On Mac, I switched keyboard to Unicode text input and tried creating new word boundaries by typing option+0000 but it didn't work. Any idea why not?
                                                          $endgroup$
                                                          – Jonah
                                                          May 25 at 18:52




                                                          1




                                                          1




                                                          $begingroup$
                                                          @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
                                                          $endgroup$
                                                          – Jo King
                                                          May 26 at 4:15






                                                          $begingroup$
                                                          @Jonah Ah good catch, I accidentally typed - instead of . for the explanation. For adding NUL bytes in TIO, I recommend using the console and running a command like $('#input').value = $('#input').value.replace(/s/g,"");. I don't know why your way didn't work
                                                          $endgroup$
                                                          – Jo King
                                                          May 26 at 4:15













                                                          5












                                                          $begingroup$

                                                          JavaScript, 62 bytes





                                                          a=>' '+a.replace(/./g,c=>1-c?(a=!a,''):a?(p+=' ',c):p+c,p=`
                                                          `)


                                                          Try it online!



                                                          Thanks Rick Hitchcock, 2 bytes saved.





                                                          JavaScript, 65 bytes





                                                          a=>a.replace(/./g,c=>1-c?(t=!t,''):t?p+c:(p+=p?' ':`
                                                          `,c),t=p='')


                                                          Try it online!



                                                          a=>a.replace(/./g,c=>( // for each character c in string a
                                                          1 - c ? // if (c is space)
                                                          (t = !t, // update t: boolean value describe word index
                                                          // truthy: odd indexed words;
                                                          // falsy: even indexed words
                                                          '') : // generate nothing for space
                                                          t? // if (is odd index) which means is vertical
                                                          p+c : // add 'n', some spaces, and a sigle charater
                                                          // else
                                                          (p+=p?' ':'n', // prepare the prepend string for vertical words
                                                          c) // add a single character
                                                          ),
                                                          t=p='' // initialize
                                                          )





                                                          share|improve this answer











                                                          $endgroup$















                                                          • $begingroup$
                                                            I think you can save 2 bytes by replacing t with a, then removing t=
                                                            $endgroup$
                                                            – Rick Hitchcock
                                                            May 24 at 21:43
















                                                          5












                                                          $begingroup$

                                                          JavaScript, 62 bytes





                                                          a=>' '+a.replace(/./g,c=>1-c?(a=!a,''):a?(p+=' ',c):p+c,p=`
                                                          `)


                                                          Try it online!



                                                          Thanks Rick Hitchcock, 2 bytes saved.





                                                          JavaScript, 65 bytes





                                                          a=>a.replace(/./g,c=>1-c?(t=!t,''):t?p+c:(p+=p?' ':`
                                                          `,c),t=p='')


                                                          Try it online!



                                                          a=>a.replace(/./g,c=>( // for each character c in string a
                                                          1 - c ? // if (c is space)
                                                          (t = !t, // update t: boolean value describe word index
                                                          // truthy: odd indexed words;
                                                          // falsy: even indexed words
                                                          '') : // generate nothing for space
                                                          t? // if (is odd index) which means is vertical
                                                          p+c : // add 'n', some spaces, and a sigle charater
                                                          // else
                                                          (p+=p?' ':'n', // prepare the prepend string for vertical words
                                                          c) // add a single character
                                                          ),
                                                          t=p='' // initialize
                                                          )





                                                          share|improve this answer











                                                          $endgroup$















                                                          • $begingroup$
                                                            I think you can save 2 bytes by replacing t with a, then removing t=
                                                            $endgroup$
                                                            – Rick Hitchcock
                                                            May 24 at 21:43














                                                          5












                                                          5








                                                          5





                                                          $begingroup$

                                                          JavaScript, 62 bytes





                                                          a=>' '+a.replace(/./g,c=>1-c?(a=!a,''):a?(p+=' ',c):p+c,p=`
                                                          `)


                                                          Try it online!



                                                          Thanks Rick Hitchcock, 2 bytes saved.





                                                          JavaScript, 65 bytes





                                                          a=>a.replace(/./g,c=>1-c?(t=!t,''):t?p+c:(p+=p?' ':`
                                                          `,c),t=p='')


                                                          Try it online!



                                                          a=>a.replace(/./g,c=>( // for each character c in string a
                                                          1 - c ? // if (c is space)
                                                          (t = !t, // update t: boolean value describe word index
                                                          // truthy: odd indexed words;
                                                          // falsy: even indexed words
                                                          '') : // generate nothing for space
                                                          t? // if (is odd index) which means is vertical
                                                          p+c : // add 'n', some spaces, and a sigle charater
                                                          // else
                                                          (p+=p?' ':'n', // prepare the prepend string for vertical words
                                                          c) // add a single character
                                                          ),
                                                          t=p='' // initialize
                                                          )





                                                          share|improve this answer











                                                          $endgroup$



                                                          JavaScript, 62 bytes





                                                          a=>' '+a.replace(/./g,c=>1-c?(a=!a,''):a?(p+=' ',c):p+c,p=`
                                                          `)


                                                          Try it online!



                                                          Thanks Rick Hitchcock, 2 bytes saved.





                                                          JavaScript, 65 bytes





                                                          a=>a.replace(/./g,c=>1-c?(t=!t,''):t?p+c:(p+=p?' ':`
                                                          `,c),t=p='')


                                                          Try it online!



                                                          a=>a.replace(/./g,c=>( // for each character c in string a
                                                          1 - c ? // if (c is space)
                                                          (t = !t, // update t: boolean value describe word index
                                                          // truthy: odd indexed words;
                                                          // falsy: even indexed words
                                                          '') : // generate nothing for space
                                                          t? // if (is odd index) which means is vertical
                                                          p+c : // add 'n', some spaces, and a sigle charater
                                                          // else
                                                          (p+=p?' ':'n', // prepare the prepend string for vertical words
                                                          c) // add a single character
                                                          ),
                                                          t=p='' // initialize
                                                          )






                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited May 26 at 5:02

























                                                          answered May 24 at 7:34









                                                          tshtsh

                                                          11.3k1 gold badge17 silver badges59 bronze badges




                                                          11.3k1 gold badge17 silver badges59 bronze badges















                                                          • $begingroup$
                                                            I think you can save 2 bytes by replacing t with a, then removing t=
                                                            $endgroup$
                                                            – Rick Hitchcock
                                                            May 24 at 21:43


















                                                          • $begingroup$
                                                            I think you can save 2 bytes by replacing t with a, then removing t=
                                                            $endgroup$
                                                            – Rick Hitchcock
                                                            May 24 at 21:43
















                                                          $begingroup$
                                                          I think you can save 2 bytes by replacing t with a, then removing t=
                                                          $endgroup$
                                                          – Rick Hitchcock
                                                          May 24 at 21:43




                                                          $begingroup$
                                                          I think you can save 2 bytes by replacing t with a, then removing t=
                                                          $endgroup$
                                                          – Rick Hitchcock
                                                          May 24 at 21:43











                                                          5












                                                          $begingroup$


                                                          Aheui (esotope), 490 458 455 bytes



                                                          삭뱃밸때샏배샐배새뱄밿때빠뱋빼쌘투@밧우
                                                          @두내백뱃빼선대내백뱃섣@여우샐처샐추
                                                          희차@@@뭏누번사@빼뭏오추뻐@@@배
                                                          By@@@새대백@@@우뻐색
                                                          Legen@@빼쵸누번@@빼
                                                          DUST@@@샌뽀터본섣숃멓
                                                          @@@@@@@오어아@먛요아@@샏매우
                                                          @@@@@아@@@@@@오@@@@@서어
                                                          @@@@@희차@@요


                                                          Try it online!



                                                          Slightly golfed by using full-width characters(2 bytes) instead Korean(3 bytes).



                                                          Explanation



                                                          Aheui is befunge-like esolang. Here is code with color:
                                                          Aheui code with color
                                                          ?1 part checks if current character is space or not.



                                                          ?2 parts check whether words had written right-to-left or top-to-down.



                                                          ?3 part is break condition of loop which types spaces.



                                                          ?4 parts check if current character is end of line(-1).



                                                          Red part is stack initialization. Aheui uses stacks (from Nothing to : 28 stacks) to store value.



                                                          Orange part takes input() and check if it is space, by subtracting with 32(ascii code of space).



                                                          Green part add 1 to stack which stores value of length of space, if writing right-to-left.



                                                          Purple part is loop for printing spaces, if writing up-to-down.



                                                          Grey part check if current character is -1, by adding one to current character.



                                                          Blue part prints current character, and prepare for next character.






                                                          share|improve this answer











                                                          $endgroup$















                                                          • $begingroup$
                                                            What did you use to generate the image in this post?
                                                            $endgroup$
                                                            – bb94
                                                            Jun 10 at 9:13










                                                          • $begingroup$
                                                            @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
                                                            $endgroup$
                                                            – LegenDUST
                                                            Jun 10 at 9:14
















                                                          5












                                                          $begingroup$


                                                          Aheui (esotope), 490 458 455 bytes



                                                          삭뱃밸때샏배샐배새뱄밿때빠뱋빼쌘투@밧우
                                                          @두내백뱃빼선대내백뱃섣@여우샐처샐추
                                                          희차@@@뭏누번사@빼뭏오추뻐@@@배
                                                          By@@@새대백@@@우뻐색
                                                          Legen@@빼쵸누번@@빼
                                                          DUST@@@샌뽀터본섣숃멓
                                                          @@@@@@@오어아@먛요아@@샏매우
                                                          @@@@@아@@@@@@오@@@@@서어
                                                          @@@@@희차@@요


                                                          Try it online!



                                                          Slightly golfed by using full-width characters(2 bytes) instead Korean(3 bytes).



                                                          Explanation



                                                          Aheui is befunge-like esolang. Here is code with color:
                                                          Aheui code with color
                                                          ?1 part checks if current character is space or not.



                                                          ?2 parts check whether words had written right-to-left or top-to-down.



                                                          ?3 part is break condition of loop which types spaces.



                                                          ?4 parts check if current character is end of line(-1).



                                                          Red part is stack initialization. Aheui uses stacks (from Nothing to : 28 stacks) to store value.



                                                          Orange part takes input() and check if it is space, by subtracting with 32(ascii code of space).



                                                          Green part add 1 to stack which stores value of length of space, if writing right-to-left.



                                                          Purple part is loop for printing spaces, if writing up-to-down.



                                                          Grey part check if current character is -1, by adding one to current character.



                                                          Blue part prints current character, and prepare for next character.






                                                          share|improve this answer











                                                          $endgroup$















                                                          • $begingroup$
                                                            What did you use to generate the image in this post?
                                                            $endgroup$
                                                            – bb94
                                                            Jun 10 at 9:13










                                                          • $begingroup$
                                                            @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
                                                            $endgroup$
                                                            – LegenDUST
                                                            Jun 10 at 9:14














                                                          5












                                                          5








                                                          5





                                                          $begingroup$


                                                          Aheui (esotope), 490 458 455 bytes



                                                          삭뱃밸때샏배샐배새뱄밿때빠뱋빼쌘투@밧우
                                                          @두내백뱃빼선대내백뱃섣@여우샐처샐추
                                                          희차@@@뭏누번사@빼뭏오추뻐@@@배
                                                          By@@@새대백@@@우뻐색
                                                          Legen@@빼쵸누번@@빼
                                                          DUST@@@샌뽀터본섣숃멓
                                                          @@@@@@@오어아@먛요아@@샏매우
                                                          @@@@@아@@@@@@오@@@@@서어
                                                          @@@@@희차@@요


                                                          Try it online!



                                                          Slightly golfed by using full-width characters(2 bytes) instead Korean(3 bytes).



                                                          Explanation



                                                          Aheui is befunge-like esolang. Here is code with color:
                                                          Aheui code with color
                                                          ?1 part checks if current character is space or not.



                                                          ?2 parts check whether words had written right-to-left or top-to-down.



                                                          ?3 part is break condition of loop which types spaces.



                                                          ?4 parts check if current character is end of line(-1).



                                                          Red part is stack initialization. Aheui uses stacks (from Nothing to : 28 stacks) to store value.



                                                          Orange part takes input() and check if it is space, by subtracting with 32(ascii code of space).



                                                          Green part add 1 to stack which stores value of length of space, if writing right-to-left.



                                                          Purple part is loop for printing spaces, if writing up-to-down.



                                                          Grey part check if current character is -1, by adding one to current character.



                                                          Blue part prints current character, and prepare for next character.






                                                          share|improve this answer











                                                          $endgroup$




                                                          Aheui (esotope), 490 458 455 bytes



                                                          삭뱃밸때샏배샐배새뱄밿때빠뱋빼쌘투@밧우
                                                          @두내백뱃빼선대내백뱃섣@여우샐처샐추
                                                          희차@@@뭏누번사@빼뭏오추뻐@@@배
                                                          By@@@새대백@@@우뻐색
                                                          Legen@@빼쵸누번@@빼
                                                          DUST@@@샌뽀터본섣숃멓
                                                          @@@@@@@오어아@먛요아@@샏매우
                                                          @@@@@아@@@@@@오@@@@@서어
                                                          @@@@@희차@@요


                                                          Try it online!



                                                          Slightly golfed by using full-width characters(2 bytes) instead Korean(3 bytes).



                                                          Explanation



                                                          Aheui is befunge-like esolang. Here is code with color:
                                                          Aheui code with color
                                                          ?1 part checks if current character is space or not.



                                                          ?2 parts check whether words had written right-to-left or top-to-down.



                                                          ?3 part is break condition of loop which types spaces.



                                                          ?4 parts check if current character is end of line(-1).



                                                          Red part is stack initialization. Aheui uses stacks (from Nothing to : 28 stacks) to store value.



                                                          Orange part takes input() and check if it is space, by subtracting with 32(ascii code of space).



                                                          Green part add 1 to stack which stores value of length of space, if writing right-to-left.



                                                          Purple part is loop for printing spaces, if writing up-to-down.



                                                          Grey part check if current character is -1, by adding one to current character.



                                                          Blue part prints current character, and prepare for next character.







                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited May 28 at 9:19

























                                                          answered May 27 at 14:02









                                                          LegenDUSTLegenDUST

                                                          4421 silver badge11 bronze badges




                                                          4421 silver badge11 bronze badges















                                                          • $begingroup$
                                                            What did you use to generate the image in this post?
                                                            $endgroup$
                                                            – bb94
                                                            Jun 10 at 9:13










                                                          • $begingroup$
                                                            @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
                                                            $endgroup$
                                                            – LegenDUST
                                                            Jun 10 at 9:14


















                                                          • $begingroup$
                                                            What did you use to generate the image in this post?
                                                            $endgroup$
                                                            – bb94
                                                            Jun 10 at 9:13










                                                          • $begingroup$
                                                            @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
                                                            $endgroup$
                                                            – LegenDUST
                                                            Jun 10 at 9:14
















                                                          $begingroup$
                                                          What did you use to generate the image in this post?
                                                          $endgroup$
                                                          – bb94
                                                          Jun 10 at 9:13




                                                          $begingroup$
                                                          What did you use to generate the image in this post?
                                                          $endgroup$
                                                          – bb94
                                                          Jun 10 at 9:13












                                                          $begingroup$
                                                          @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
                                                          $endgroup$
                                                          – LegenDUST
                                                          Jun 10 at 9:14




                                                          $begingroup$
                                                          @bb94 base is AheuiChem, nice built Korean Aheui online (sort of) IDE. And I used Powerpoint to color it.
                                                          $endgroup$
                                                          – LegenDUST
                                                          Jun 10 at 9:14











                                                          4












                                                          $begingroup$


                                                          Japt -P, 15 bytes



                                                          ò mrÈ+R+YÕùT±Xl


                                                          Try it



                                                          ò mrÈ+R+YÕùT±Xl     :Implicit input of string array
                                                          ò :Partition into 2s
                                                          m :Map each pair
                                                          r : Reduce by
                                                          È : Passing through the following function as X & Y
                                                          + : Append to X
                                                          R : Newline
                                                          + : Append
                                                          YÕ : Transpose Y
                                                          ù : Left pad each line with spaces to length
                                                          T± : T (initially 0) incremented by
                                                          Xl : Length of X
                                                          :Implicitly join and output





                                                          share|improve this answer











                                                          $endgroup$




















                                                            4












                                                            $begingroup$


                                                            Japt -P, 15 bytes



                                                            ò mrÈ+R+YÕùT±Xl


                                                            Try it



                                                            ò mrÈ+R+YÕùT±Xl     :Implicit input of string array
                                                            ò :Partition into 2s
                                                            m :Map each pair
                                                            r : Reduce by
                                                            È : Passing through the following function as X & Y
                                                            + : Append to X
                                                            R : Newline
                                                            + : Append
                                                            YÕ : Transpose Y
                                                            ù : Left pad each line with spaces to length
                                                            T± : T (initially 0) incremented by
                                                            Xl : Length of X
                                                            :Implicitly join and output





                                                            share|improve this answer











                                                            $endgroup$


















                                                              4












                                                              4








                                                              4





                                                              $begingroup$


                                                              Japt -P, 15 bytes



                                                              ò mrÈ+R+YÕùT±Xl


                                                              Try it



                                                              ò mrÈ+R+YÕùT±Xl     :Implicit input of string array
                                                              ò :Partition into 2s
                                                              m :Map each pair
                                                              r : Reduce by
                                                              È : Passing through the following function as X & Y
                                                              + : Append to X
                                                              R : Newline
                                                              + : Append
                                                              YÕ : Transpose Y
                                                              ù : Left pad each line with spaces to length
                                                              T± : T (initially 0) incremented by
                                                              Xl : Length of X
                                                              :Implicitly join and output





                                                              share|improve this answer











                                                              $endgroup$




                                                              Japt -P, 15 bytes



                                                              ò mrÈ+R+YÕùT±Xl


                                                              Try it



                                                              ò mrÈ+R+YÕùT±Xl     :Implicit input of string array
                                                              ò :Partition into 2s
                                                              m :Map each pair
                                                              r : Reduce by
                                                              È : Passing through the following function as X & Y
                                                              + : Append to X
                                                              R : Newline
                                                              + : Append
                                                              YÕ : Transpose Y
                                                              ù : Left pad each line with spaces to length
                                                              T± : T (initially 0) incremented by
                                                              Xl : Length of X
                                                              :Implicitly join and output






                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited May 23 at 20:36

























                                                              answered May 23 at 18:37









                                                              ShaggyShaggy

                                                              21k3 gold badges20 silver badges70 bronze badges




                                                              21k3 gold badges20 silver badges70 bronze badges


























                                                                  4












                                                                  $begingroup$

                                                                  bash, 119 chars



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for((i=0;i<l;i++));do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ]&&d=$((1-d))||printf ${X[$d]}$c
                                                                  done


                                                                  This uses ANSI control sequences to move the cursor - here I'm only using save e7 and restore e8; but the restore has to be prefixed with n to scroll the output if it's already at the bottom of the terminal. For some reason it doesn't work if you're not already at the bottom of the terminal. * shrug *



                                                                  The current character $c is isolated as a single-character substring from the input string $w, using the for loop index $i as the index into the string.



                                                                  The only real trick I'm using here is [ -z $c ] which will return true, i.e. the string is blank, when $c is a space, because it's unquoted. In correct usage of bash, you would quote the string being tested with -z to avoid exactly this situation. This allows us flip the direction flag $d between 1 and 0, which is then used as an index into the ANSI control sequence array, X on the next non-space value of $c.



                                                                  I'd be interested to see something that uses printf "%${x}s" $c.



                                                                  Oh gosh let's add some whitespace. I can't see where I am...



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for ((i=0;i<l;i++)); do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ] && d=$((1-d)) || printf ${X[$d]}$c
                                                                  done





                                                                  share|improve this answer









                                                                  $endgroup$















                                                                  • $begingroup$
                                                                    Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
                                                                    $endgroup$
                                                                    – Rich
                                                                    May 24 at 2:17
















                                                                  4












                                                                  $begingroup$

                                                                  bash, 119 chars



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for((i=0;i<l;i++));do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ]&&d=$((1-d))||printf ${X[$d]}$c
                                                                  done


                                                                  This uses ANSI control sequences to move the cursor - here I'm only using save e7 and restore e8; but the restore has to be prefixed with n to scroll the output if it's already at the bottom of the terminal. For some reason it doesn't work if you're not already at the bottom of the terminal. * shrug *



                                                                  The current character $c is isolated as a single-character substring from the input string $w, using the for loop index $i as the index into the string.



                                                                  The only real trick I'm using here is [ -z $c ] which will return true, i.e. the string is blank, when $c is a space, because it's unquoted. In correct usage of bash, you would quote the string being tested with -z to avoid exactly this situation. This allows us flip the direction flag $d between 1 and 0, which is then used as an index into the ANSI control sequence array, X on the next non-space value of $c.



                                                                  I'd be interested to see something that uses printf "%${x}s" $c.



                                                                  Oh gosh let's add some whitespace. I can't see where I am...



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for ((i=0;i<l;i++)); do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ] && d=$((1-d)) || printf ${X[$d]}$c
                                                                  done





                                                                  share|improve this answer









                                                                  $endgroup$















                                                                  • $begingroup$
                                                                    Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
                                                                    $endgroup$
                                                                    – Rich
                                                                    May 24 at 2:17














                                                                  4












                                                                  4








                                                                  4





                                                                  $begingroup$

                                                                  bash, 119 chars



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for((i=0;i<l;i++));do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ]&&d=$((1-d))||printf ${X[$d]}$c
                                                                  done


                                                                  This uses ANSI control sequences to move the cursor - here I'm only using save e7 and restore e8; but the restore has to be prefixed with n to scroll the output if it's already at the bottom of the terminal. For some reason it doesn't work if you're not already at the bottom of the terminal. * shrug *



                                                                  The current character $c is isolated as a single-character substring from the input string $w, using the for loop index $i as the index into the string.



                                                                  The only real trick I'm using here is [ -z $c ] which will return true, i.e. the string is blank, when $c is a space, because it's unquoted. In correct usage of bash, you would quote the string being tested with -z to avoid exactly this situation. This allows us flip the direction flag $d between 1 and 0, which is then used as an index into the ANSI control sequence array, X on the next non-space value of $c.



                                                                  I'd be interested to see something that uses printf "%${x}s" $c.



                                                                  Oh gosh let's add some whitespace. I can't see where I am...



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for ((i=0;i<l;i++)); do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ] && d=$((1-d)) || printf ${X[$d]}$c
                                                                  done





                                                                  share|improve this answer









                                                                  $endgroup$



                                                                  bash, 119 chars



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for((i=0;i<l;i++));do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ]&&d=$((1-d))||printf ${X[$d]}$c
                                                                  done


                                                                  This uses ANSI control sequences to move the cursor - here I'm only using save e7 and restore e8; but the restore has to be prefixed with n to scroll the output if it's already at the bottom of the terminal. For some reason it doesn't work if you're not already at the bottom of the terminal. * shrug *



                                                                  The current character $c is isolated as a single-character substring from the input string $w, using the for loop index $i as the index into the string.



                                                                  The only real trick I'm using here is [ -z $c ] which will return true, i.e. the string is blank, when $c is a space, because it's unquoted. In correct usage of bash, you would quote the string being tested with -z to avoid exactly this situation. This allows us flip the direction flag $d between 1 and 0, which is then used as an index into the ANSI control sequence array, X on the next non-space value of $c.



                                                                  I'd be interested to see something that uses printf "%${x}s" $c.



                                                                  Oh gosh let's add some whitespace. I can't see where I am...



                                                                  X=("e7" "ne8")
                                                                  w="$@"
                                                                  l=${#w}
                                                                  d=0
                                                                  for ((i=0;i<l;i++)); do
                                                                  c="${w:$i:1}"
                                                                  [ -z $c ] && d=$((1-d)) || printf ${X[$d]}$c
                                                                  done






                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered May 24 at 2:12









                                                                  RichRich

                                                                  1614 bronze badges




                                                                  1614 bronze badges















                                                                  • $begingroup$
                                                                    Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
                                                                    $endgroup$
                                                                    – Rich
                                                                    May 24 at 2:17


















                                                                  • $begingroup$
                                                                    Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
                                                                    $endgroup$
                                                                    – Rich
                                                                    May 24 at 2:17
















                                                                  $begingroup$
                                                                  Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
                                                                  $endgroup$
                                                                  – Rich
                                                                  May 24 at 2:17




                                                                  $begingroup$
                                                                  Oh by the way, you can't try this one on that tio.run site - like a few others, there's no ANSI control sequence handling so it just barfs.
                                                                  $endgroup$
                                                                  – Rich
                                                                  May 24 at 2:17











                                                                  4












                                                                  $begingroup$


                                                                  Perl 6, 65 bytes





                                                                  {$/=0;.map:{$/+=$++%2??!.comb.fmt("%$/s","
                                                                  ").print!!.say*.comb}}


                                                                  Try it online!



                                                                  Anonymous code block that takes a list of words and prints straight to STDOUT.



                                                                  Explanation



                                                                  {                           }  # Anonymous code block
                                                                  $/=0; # Initialise $/ to 0
                                                                  .map:{ } # Map the list of words to
                                                                  $/+= # Increment $/ by
                                                                  $++%2?? # For even indexes
                                                                  .comb # Each letter of the word
                                                                  .fmt( ) # Formatted as
                                                                  "%$/s" # Padded with $/-1 spaces
                                                                  ,"n" # Joined by newlines
                                                                  .print # And printed without a newline
                                                                  ! # Boolean not this to add 0 to $/
                                                                  !! # For odd indexes
                                                                  .say # Print with a newline
                                                                  *.comb # And add the length of the word





                                                                  share|improve this answer











                                                                  $endgroup$















                                                                  • $begingroup$
                                                                    I'm curious how this one works Jo, I don't know Perl 6
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 2:23










                                                                  • $begingroup$
                                                                    @Jonah I've added an explanation
                                                                    $endgroup$
                                                                    – Jo King
                                                                    May 24 at 2:49










                                                                  • $begingroup$
                                                                    Thanks, nice solution.
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 3:17
















                                                                  4












                                                                  $begingroup$


                                                                  Perl 6, 65 bytes





                                                                  {$/=0;.map:{$/+=$++%2??!.comb.fmt("%$/s","
                                                                  ").print!!.say*.comb}}


                                                                  Try it online!



                                                                  Anonymous code block that takes a list of words and prints straight to STDOUT.



                                                                  Explanation



                                                                  {                           }  # Anonymous code block
                                                                  $/=0; # Initialise $/ to 0
                                                                  .map:{ } # Map the list of words to
                                                                  $/+= # Increment $/ by
                                                                  $++%2?? # For even indexes
                                                                  .comb # Each letter of the word
                                                                  .fmt( ) # Formatted as
                                                                  "%$/s" # Padded with $/-1 spaces
                                                                  ,"n" # Joined by newlines
                                                                  .print # And printed without a newline
                                                                  ! # Boolean not this to add 0 to $/
                                                                  !! # For odd indexes
                                                                  .say # Print with a newline
                                                                  *.comb # And add the length of the word





                                                                  share|improve this answer











                                                                  $endgroup$















                                                                  • $begingroup$
                                                                    I'm curious how this one works Jo, I don't know Perl 6
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 2:23










                                                                  • $begingroup$
                                                                    @Jonah I've added an explanation
                                                                    $endgroup$
                                                                    – Jo King
                                                                    May 24 at 2:49










                                                                  • $begingroup$
                                                                    Thanks, nice solution.
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 3:17














                                                                  4












                                                                  4








                                                                  4





                                                                  $begingroup$


                                                                  Perl 6, 65 bytes





                                                                  {$/=0;.map:{$/+=$++%2??!.comb.fmt("%$/s","
                                                                  ").print!!.say*.comb}}


                                                                  Try it online!



                                                                  Anonymous code block that takes a list of words and prints straight to STDOUT.



                                                                  Explanation



                                                                  {                           }  # Anonymous code block
                                                                  $/=0; # Initialise $/ to 0
                                                                  .map:{ } # Map the list of words to
                                                                  $/+= # Increment $/ by
                                                                  $++%2?? # For even indexes
                                                                  .comb # Each letter of the word
                                                                  .fmt( ) # Formatted as
                                                                  "%$/s" # Padded with $/-1 spaces
                                                                  ,"n" # Joined by newlines
                                                                  .print # And printed without a newline
                                                                  ! # Boolean not this to add 0 to $/
                                                                  !! # For odd indexes
                                                                  .say # Print with a newline
                                                                  *.comb # And add the length of the word





                                                                  share|improve this answer











                                                                  $endgroup$




                                                                  Perl 6, 65 bytes





                                                                  {$/=0;.map:{$/+=$++%2??!.comb.fmt("%$/s","
                                                                  ").print!!.say*.comb}}


                                                                  Try it online!



                                                                  Anonymous code block that takes a list of words and prints straight to STDOUT.



                                                                  Explanation



                                                                  {                           }  # Anonymous code block
                                                                  $/=0; # Initialise $/ to 0
                                                                  .map:{ } # Map the list of words to
                                                                  $/+= # Increment $/ by
                                                                  $++%2?? # For even indexes
                                                                  .comb # Each letter of the word
                                                                  .fmt( ) # Formatted as
                                                                  "%$/s" # Padded with $/-1 spaces
                                                                  ,"n" # Joined by newlines
                                                                  .print # And printed without a newline
                                                                  ! # Boolean not this to add 0 to $/
                                                                  !! # For odd indexes
                                                                  .say # Print with a newline
                                                                  *.comb # And add the length of the word






                                                                  share|improve this answer














                                                                  share|improve this answer



                                                                  share|improve this answer








                                                                  edited May 24 at 2:49

























                                                                  answered May 23 at 15:16









                                                                  Jo KingJo King

                                                                  30.5k3 gold badges71 silver badges138 bronze badges




                                                                  30.5k3 gold badges71 silver badges138 bronze badges















                                                                  • $begingroup$
                                                                    I'm curious how this one works Jo, I don't know Perl 6
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 2:23










                                                                  • $begingroup$
                                                                    @Jonah I've added an explanation
                                                                    $endgroup$
                                                                    – Jo King
                                                                    May 24 at 2:49










                                                                  • $begingroup$
                                                                    Thanks, nice solution.
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 3:17


















                                                                  • $begingroup$
                                                                    I'm curious how this one works Jo, I don't know Perl 6
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 2:23










                                                                  • $begingroup$
                                                                    @Jonah I've added an explanation
                                                                    $endgroup$
                                                                    – Jo King
                                                                    May 24 at 2:49










                                                                  • $begingroup$
                                                                    Thanks, nice solution.
                                                                    $endgroup$
                                                                    – Jonah
                                                                    May 24 at 3:17
















                                                                  $begingroup$
                                                                  I'm curious how this one works Jo, I don't know Perl 6
                                                                  $endgroup$
                                                                  – Jonah
                                                                  May 24 at 2:23




                                                                  $begingroup$
                                                                  I'm curious how this one works Jo, I don't know Perl 6
                                                                  $endgroup$
                                                                  – Jonah
                                                                  May 24 at 2:23












                                                                  $begingroup$
                                                                  @Jonah I've added an explanation
                                                                  $endgroup$
                                                                  – Jo King
                                                                  May 24 at 2:49




                                                                  $begingroup$
                                                                  @Jonah I've added an explanation
                                                                  $endgroup$
                                                                  – Jo King
                                                                  May 24 at 2:49












                                                                  $begingroup$
                                                                  Thanks, nice solution.
                                                                  $endgroup$
                                                                  – Jonah
                                                                  May 24 at 3:17




                                                                  $begingroup$
                                                                  Thanks, nice solution.
                                                                  $endgroup$
                                                                  – Jonah
                                                                  May 24 at 3:17











                                                                  3












                                                                  $begingroup$


                                                                  Charcoal, 19 bytes



                                                                  FLθ¿﹪鲫↓§θι↗»«§θι↙


                                                                  Input as a list of strings



                                                                  Try it online (verbose) or try it online (pure)



                                                                  Explanation:



                                                                  Loop in the range [0, input-length):



                                                                  For(Length(q))
                                                                  FLθ


                                                                  If the index is odd:



                                                                  If(Modulo(i,2)){...}
                                                                  ﹪鲫...»


                                                                  Print the string at index i in a downward direction:



                                                                  Print(:Down, AtIndex(q,i));
                                                                  ↓§θι


                                                                  And then move the cursor once towards the top-right:



                                                                  Move(:UpRight);



                                                                  Else (the index is even):



                                                                  Else{...}
                                                                  «...


                                                                  Print the string at index i in a regular right direction:



                                                                  Print(AtIndex(q,i));
                                                                  §θι


                                                                  And then move the cursor once towards the bottom-left:



                                                                  Move(:DownLeft);






                                                                  share|improve this answer











                                                                  $endgroup$




















                                                                    3












                                                                    $begingroup$


                                                                    Charcoal, 19 bytes



                                                                    FLθ¿﹪鲫↓§θι↗»«§θι↙


                                                                    Input as a list of strings



                                                                    Try it online (verbose) or try it online (pure)



                                                                    Explanation:



                                                                    Loop in the range [0, input-length):



                                                                    For(Length(q))
                                                                    FLθ


                                                                    If the index is odd:



                                                                    If(Modulo(i,2)){...}
                                                                    ﹪鲫...»


                                                                    Print the string at index i in a downward direction:



                                                                    Print(:Down, AtIndex(q,i));
                                                                    ↓§θι


                                                                    And then move the cursor once towards the top-right:



                                                                    Move(:UpRight);



                                                                    Else (the index is even):



                                                                    Else{...}
                                                                    «...


                                                                    Print the string at index i in a regular right direction:



                                                                    Print(AtIndex(q,i));
                                                                    §θι


                                                                    And then move the cursor once towards the bottom-left:



                                                                    Move(:DownLeft);






                                                                    share|improve this answer











                                                                    $endgroup$


















                                                                      3












                                                                      3








                                                                      3





                                                                      $begingroup$


                                                                      Charcoal, 19 bytes



                                                                      FLθ¿﹪鲫↓§θι↗»«§θι↙


                                                                      Input as a list of strings



                                                                      Try it online (verbose) or try it online (pure)



                                                                      Explanation:



                                                                      Loop in the range [0, input-length):



                                                                      For(Length(q))
                                                                      FLθ


                                                                      If the index is odd:



                                                                      If(Modulo(i,2)){...}
                                                                      ﹪鲫...»


                                                                      Print the string at index i in a downward direction:



                                                                      Print(:Down, AtIndex(q,i));
                                                                      ↓§θι


                                                                      And then move the cursor once towards the top-right:



                                                                      Move(:UpRight);



                                                                      Else (the index is even):



                                                                      Else{...}
                                                                      «...


                                                                      Print the string at index i in a regular right direction:



                                                                      Print(AtIndex(q,i));
                                                                      §θι


                                                                      And then move the cursor once towards the bottom-left:



                                                                      Move(:DownLeft);






                                                                      share|improve this answer











                                                                      $endgroup$




                                                                      Charcoal, 19 bytes



                                                                      FLθ¿﹪鲫↓§θι↗»«§θι↙


                                                                      Input as a list of strings



                                                                      Try it online (verbose) or try it online (pure)



                                                                      Explanation:



                                                                      Loop in the range [0, input-length):



                                                                      For(Length(q))
                                                                      FLθ


                                                                      If the index is odd:



                                                                      If(Modulo(i,2)){...}
                                                                      ﹪鲫...»


                                                                      Print the string at index i in a downward direction:



                                                                      Print(:Down, AtIndex(q,i));
                                                                      ↓§θι


                                                                      And then move the cursor once towards the top-right:



                                                                      Move(:UpRight);



                                                                      Else (the index is even):



                                                                      Else{...}
                                                                      «...


                                                                      Print the string at index i in a regular right direction:



                                                                      Print(AtIndex(q,i));
                                                                      §θι


                                                                      And then move the cursor once towards the bottom-left:



                                                                      Move(:DownLeft);







                                                                      share|improve this answer














                                                                      share|improve this answer



                                                                      share|improve this answer








                                                                      edited May 23 at 7:56

























                                                                      answered May 23 at 7:49









                                                                      Kevin CruijssenKevin Cruijssen

                                                                      49.3k7 gold badges83 silver badges245 bronze badges




                                                                      49.3k7 gold badges83 silver badges245 bronze badges


























                                                                          3












                                                                          $begingroup$


                                                                          Python 2, 89 88 bytes





                                                                          s=i=-1
                                                                          r=''
                                                                          for w in input():r+=[('n'+' '*s).join(' '+w),w][i];s-=i*len(w);i=~i
                                                                          print r


                                                                          Try it online!






                                                                          share|improve this answer









                                                                          $endgroup$




















                                                                            3












                                                                            $begingroup$


                                                                            Python 2, 89 88 bytes





                                                                            s=i=-1
                                                                            r=''
                                                                            for w in input():r+=[('n'+' '*s).join(' '+w),w][i];s-=i*len(w);i=~i
                                                                            print r


                                                                            Try it online!






                                                                            share|improve this answer









                                                                            $endgroup$


















                                                                              3












                                                                              3








                                                                              3





                                                                              $begingroup$


                                                                              Python 2, 89 88 bytes





                                                                              s=i=-1
                                                                              r=''
                                                                              for w in input():r+=[('n'+' '*s).join(' '+w),w][i];s-=i*len(w);i=~i
                                                                              print r


                                                                              Try it online!






                                                                              share|improve this answer









                                                                              $endgroup$




                                                                              Python 2, 89 88 bytes





                                                                              s=i=-1
                                                                              r=''
                                                                              for w in input():r+=[('n'+' '*s).join(' '+w),w][i];s-=i*len(w);i=~i
                                                                              print r


                                                                              Try it online!







                                                                              share|improve this answer












                                                                              share|improve this answer



                                                                              share|improve this answer










                                                                              answered May 23 at 8:05









                                                                              TFeldTFeld

                                                                              18k3 gold badges14 silver badges57 bronze badges




                                                                              18k3 gold badges14 silver badges57 bronze badges


























                                                                                  3












                                                                                  $begingroup$


                                                                                  C# (Visual C# Interactive Compiler), 122 bytes





                                                                                  a=>{int i=0;var t="n";foreach(var z in a)Write(i++%2<1?z+(t+="".PadRight(z.Length-(i<2?1:0))):string.Join(t,z.Skip(0)));}


                                                                                  Try it online!






                                                                                  share|improve this answer









                                                                                  $endgroup$




















                                                                                    3












                                                                                    $begingroup$


                                                                                    C# (Visual C# Interactive Compiler), 122 bytes





                                                                                    a=>{int i=0;var t="n";foreach(var z in a)Write(i++%2<1?z+(t+="".PadRight(z.Length-(i<2?1:0))):string.Join(t,z.Skip(0)));}


                                                                                    Try it online!






                                                                                    share|improve this answer









                                                                                    $endgroup$


















                                                                                      3












                                                                                      3








                                                                                      3





                                                                                      $begingroup$


                                                                                      C# (Visual C# Interactive Compiler), 122 bytes





                                                                                      a=>{int i=0;var t="n";foreach(var z in a)Write(i++%2<1?z+(t+="".PadRight(z.Length-(i<2?1:0))):string.Join(t,z.Skip(0)));}


                                                                                      Try it online!






                                                                                      share|improve this answer









                                                                                      $endgroup$




                                                                                      C# (Visual C# Interactive Compiler), 122 bytes





                                                                                      a=>{int i=0;var t="n";foreach(var z in a)Write(i++%2<1?z+(t+="".PadRight(z.Length-(i<2?1:0))):string.Join(t,z.Skip(0)));}


                                                                                      Try it online!







                                                                                      share|improve this answer












                                                                                      share|improve this answer



                                                                                      share|improve this answer










                                                                                      answered May 24 at 3:40









                                                                                      Embodiment of IgnoranceEmbodiment of Ignorance

                                                                                      4,7261 silver badge28 bronze badges




                                                                                      4,7261 silver badge28 bronze badges


























                                                                                          3












                                                                                          $begingroup$


                                                                                          J, 47 45 43 bytes



                                                                                          ;[`(([:<@(+/)#&>##$#:@1 2)@])`([' '"0/[)}]


                                                                                          Try it online!



                                                                                          I found a fun, different approach...



                                                                                          I started messing around with left pads and zips with cyclic gerunds and so on, but then I realized it would be easier to just calculate each letter's position (this boils down to a scan sum of the correctly chosen array) and apply amend } to a blank canvas on the razed input.



                                                                                          The solution is handled almost entirely by Amend }:



                                                                                          ; [`(([: <@(+/) #&> # # $ #:@1 2)@])`([ ' '"0/ [)} ]




                                                                                          • ; ( single verb that does all the work ) ] overall fork


                                                                                          • ; left part razes the input, ie, puts all the letters into a contiguous string


                                                                                          • ] right part is the input itself


                                                                                          • (stuff)} we use the gerund form of amend }, which consists of three parts v0`v1`v2.



                                                                                            • v0 gives us the "new values", which is the raze (ie, all the characters of the input as one string), so we use [.


                                                                                            • v2 gives us the starting value, which we are transforming. we simply want a blank canvas of spaces of the needed dimensions. ([ ' '"0/ [) gives us one of size (all chars)x(all chars).

                                                                                            • The middle verb v1 selects which positions we will put our replacement characters in. This is the crux of the logic...



                                                                                          • Starting at position 0 0 in the upper left, we notice that each new character is either 1 to the right of the previous position (ie, prev + 0 1) or one down (ie, prev + 1 0). Indeed we do the former "len of word 1" times, then the latter "len of word 2" times, and so on, alternating. So we'll just create the correct sequence of these movements, then scan sum them, and we'll have our positions, which we then box because that's how Amend works. What follows is just the mechanics of this idea...


                                                                                          • ([: <@(+/) #&> # # $ 1 - e.@0 1)


                                                                                            • First #:@1 2 creates the constant matrix 0 1;1 0.


                                                                                            • # $ then extends it so it has as many rows as the input. eg, if the input contains 3 words it will produce 0 1;1 0;0 1.


                                                                                            • #&> # the left part of that is an array of the lengths of the input words and # is copy, so it copies 0 1 "len of word 1" times, then 1 0 "len of word 2 times", etc.


                                                                                            • [: <@(+/) does the scan sum and box.








                                                                                          share|improve this answer











                                                                                          $endgroup$




















                                                                                            3












                                                                                            $begingroup$


                                                                                            J, 47 45 43 bytes



                                                                                            ;[`(([:<@(+/)#&>##$#:@1 2)@])`([' '"0/[)}]


                                                                                            Try it online!



                                                                                            I found a fun, different approach...



                                                                                            I started messing around with left pads and zips with cyclic gerunds and so on, but then I realized it would be easier to just calculate each letter's position (this boils down to a scan sum of the correctly chosen array) and apply amend } to a blank canvas on the razed input.



                                                                                            The solution is handled almost entirely by Amend }:



                                                                                            ; [`(([: <@(+/) #&> # # $ #:@1 2)@])`([ ' '"0/ [)} ]




                                                                                            • ; ( single verb that does all the work ) ] overall fork


                                                                                            • ; left part razes the input, ie, puts all the letters into a contiguous string


                                                                                            • ] right part is the input itself


                                                                                            • (stuff)} we use the gerund form of amend }, which consists of three parts v0`v1`v2.



                                                                                              • v0 gives us the "new values", which is the raze (ie, all the characters of the input as one string), so we use [.


                                                                                              • v2 gives us the starting value, which we are transforming. we simply want a blank canvas of spaces of the needed dimensions. ([ ' '"0/ [) gives us one of size (all chars)x(all chars).

                                                                                              • The middle verb v1 selects which positions we will put our replacement characters in. This is the crux of the logic...



                                                                                            • Starting at position 0 0 in the upper left, we notice that each new character is either 1 to the right of the previous position (ie, prev + 0 1) or one down (ie, prev + 1 0). Indeed we do the former "len of word 1" times, then the latter "len of word 2" times, and so on, alternating. So we'll just create the correct sequence of these movements, then scan sum them, and we'll have our positions, which we then box because that's how Amend works. What follows is just the mechanics of this idea...


                                                                                            • ([: <@(+/) #&> # # $ 1 - e.@0 1)


                                                                                              • First #:@1 2 creates the constant matrix 0 1;1 0.


                                                                                              • # $ then extends it so it has as many rows as the input. eg, if the input contains 3 words it will produce 0 1;1 0;0 1.


                                                                                              • #&> # the left part of that is an array of the lengths of the input words and # is copy, so it copies 0 1 "len of word 1" times, then 1 0 "len of word 2 times", etc.


                                                                                              • [: <@(+/) does the scan sum and box.








                                                                                            share|improve this answer











                                                                                            $endgroup$


















                                                                                              3












                                                                                              3








                                                                                              3





                                                                                              $begingroup$


                                                                                              J, 47 45 43 bytes



                                                                                              ;[`(([:<@(+/)#&>##$#:@1 2)@])`([' '"0/[)}]


                                                                                              Try it online!



                                                                                              I found a fun, different approach...



                                                                                              I started messing around with left pads and zips with cyclic gerunds and so on, but then I realized it would be easier to just calculate each letter's position (this boils down to a scan sum of the correctly chosen array) and apply amend } to a blank canvas on the razed input.



                                                                                              The solution is handled almost entirely by Amend }:



                                                                                              ; [`(([: <@(+/) #&> # # $ #:@1 2)@])`([ ' '"0/ [)} ]




                                                                                              • ; ( single verb that does all the work ) ] overall fork


                                                                                              • ; left part razes the input, ie, puts all the letters into a contiguous string


                                                                                              • ] right part is the input itself


                                                                                              • (stuff)} we use the gerund form of amend }, which consists of three parts v0`v1`v2.



                                                                                                • v0 gives us the "new values", which is the raze (ie, all the characters of the input as one string), so we use [.


                                                                                                • v2 gives us the starting value, which we are transforming. we simply want a blank canvas of spaces of the needed dimensions. ([ ' '"0/ [) gives us one of size (all chars)x(all chars).

                                                                                                • The middle verb v1 selects which positions we will put our replacement characters in. This is the crux of the logic...



                                                                                              • Starting at position 0 0 in the upper left, we notice that each new character is either 1 to the right of the previous position (ie, prev + 0 1) or one down (ie, prev + 1 0). Indeed we do the former "len of word 1" times, then the latter "len of word 2" times, and so on, alternating. So we'll just create the correct sequence of these movements, then scan sum them, and we'll have our positions, which we then box because that's how Amend works. What follows is just the mechanics of this idea...


                                                                                              • ([: <@(+/) #&> # # $ 1 - e.@0 1)


                                                                                                • First #:@1 2 creates the constant matrix 0 1;1 0.


                                                                                                • # $ then extends it so it has as many rows as the input. eg, if the input contains 3 words it will produce 0 1;1 0;0 1.


                                                                                                • #&> # the left part of that is an array of the lengths of the input words and # is copy, so it copies 0 1 "len of word 1" times, then 1 0 "len of word 2 times", etc.


                                                                                                • [: <@(+/) does the scan sum and box.








                                                                                              share|improve this answer











                                                                                              $endgroup$




                                                                                              J, 47 45 43 bytes



                                                                                              ;[`(([:<@(+/)#&>##$#:@1 2)@])`([' '"0/[)}]


                                                                                              Try it online!



                                                                                              I found a fun, different approach...



                                                                                              I started messing around with left pads and zips with cyclic gerunds and so on, but then I realized it would be easier to just calculate each letter's position (this boils down to a scan sum of the correctly chosen array) and apply amend } to a blank canvas on the razed input.



                                                                                              The solution is handled almost entirely by Amend }:



                                                                                              ; [`(([: <@(+/) #&> # # $ #:@1 2)@])`([ ' '"0/ [)} ]




                                                                                              • ; ( single verb that does all the work ) ] overall fork


                                                                                              • ; left part razes the input, ie, puts all the letters into a contiguous string


                                                                                              • ] right part is the input itself


                                                                                              • (stuff)} we use the gerund form of amend }, which consists of three parts v0`v1`v2.



                                                                                                • v0 gives us the "new values", which is the raze (ie, all the characters of the input as one string), so we use [.


                                                                                                • v2 gives us the starting value, which we are transforming. we simply want a blank canvas of spaces of the needed dimensions. ([ ' '"0/ [) gives us one of size (all chars)x(all chars).

                                                                                                • The middle verb v1 selects which positions we will put our replacement characters in. This is the crux of the logic...



                                                                                              • Starting at position 0 0 in the upper left, we notice that each new character is either 1 to the right of the previous position (ie, prev + 0 1) or one down (ie, prev + 1 0). Indeed we do the former "len of word 1" times, then the latter "len of word 2" times, and so on, alternating. So we'll just create the correct sequence of these movements, then scan sum them, and we'll have our positions, which we then box because that's how Amend works. What follows is just the mechanics of this idea...


                                                                                              • ([: <@(+/) #&> # # $ 1 - e.@0 1)


                                                                                                • First #:@1 2 creates the constant matrix 0 1;1 0.


                                                                                                • # $ then extends it so it has as many rows as the input. eg, if the input contains 3 words it will produce 0 1;1 0;0 1.


                                                                                                • #&> # the left part of that is an array of the lengths of the input words and # is copy, so it copies 0 1 "len of word 1" times, then 1 0 "len of word 2 times", etc.


                                                                                                • [: <@(+/) does the scan sum and box.









                                                                                              share|improve this answer














                                                                                              share|improve this answer



                                                                                              share|improve this answer








                                                                                              edited May 24 at 4:08

























                                                                                              answered May 24 at 3:15









                                                                                              JonahJonah

                                                                                              4,3982 gold badges12 silver badges22 bronze badges




                                                                                              4,3982 gold badges12 silver badges22 bronze badges


























                                                                                                  3












                                                                                                  $begingroup$

                                                                                                  T-SQL, 185 bytes



                                                                                                  DECLARE @ varchar(max)='Thomas Clausen Codegolf Script'
                                                                                                  ,@b bit=0,@s INT=0SET @+=':'WHILE @ like'%_:%'SELECT
                                                                                                  @b+=len(left(@,1))-1,@=stuff(@,1,1,'')+iif(left(@,@b)='','','
                                                                                                  '+space(@s))+trim(left(@,1)),@s+=len(left(@,~@b))PRINT
                                                                                                  stuff(@,1,1,'')


                                                                                                  Try it online






                                                                                                  share|improve this answer











                                                                                                  $endgroup$











                                                                                                  • 1




                                                                                                    $begingroup$
                                                                                                    Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                                                                                                    $endgroup$
                                                                                                    – Muqo
                                                                                                    May 24 at 12:13
















                                                                                                  3












                                                                                                  $begingroup$

                                                                                                  T-SQL, 185 bytes



                                                                                                  DECLARE @ varchar(max)='Thomas Clausen Codegolf Script'
                                                                                                  ,@b bit=0,@s INT=0SET @+=':'WHILE @ like'%_:%'SELECT
                                                                                                  @b+=len(left(@,1))-1,@=stuff(@,1,1,'')+iif(left(@,@b)='','','
                                                                                                  '+space(@s))+trim(left(@,1)),@s+=len(left(@,~@b))PRINT
                                                                                                  stuff(@,1,1,'')


                                                                                                  Try it online






                                                                                                  share|improve this answer











                                                                                                  $endgroup$











                                                                                                  • 1




                                                                                                    $begingroup$
                                                                                                    Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                                                                                                    $endgroup$
                                                                                                    – Muqo
                                                                                                    May 24 at 12:13














                                                                                                  3












                                                                                                  3








                                                                                                  3





                                                                                                  $begingroup$

                                                                                                  T-SQL, 185 bytes



                                                                                                  DECLARE @ varchar(max)='Thomas Clausen Codegolf Script'
                                                                                                  ,@b bit=0,@s INT=0SET @+=':'WHILE @ like'%_:%'SELECT
                                                                                                  @b+=len(left(@,1))-1,@=stuff(@,1,1,'')+iif(left(@,@b)='','','
                                                                                                  '+space(@s))+trim(left(@,1)),@s+=len(left(@,~@b))PRINT
                                                                                                  stuff(@,1,1,'')


                                                                                                  Try it online






                                                                                                  share|improve this answer











                                                                                                  $endgroup$



                                                                                                  T-SQL, 185 bytes



                                                                                                  DECLARE @ varchar(max)='Thomas Clausen Codegolf Script'
                                                                                                  ,@b bit=0,@s INT=0SET @+=':'WHILE @ like'%_:%'SELECT
                                                                                                  @b+=len(left(@,1))-1,@=stuff(@,1,1,'')+iif(left(@,@b)='','','
                                                                                                  '+space(@s))+trim(left(@,1)),@s+=len(left(@,~@b))PRINT
                                                                                                  stuff(@,1,1,'')


                                                                                                  Try it online







                                                                                                  share|improve this answer














                                                                                                  share|improve this answer



                                                                                                  share|improve this answer








                                                                                                  edited May 29 at 12:23

























                                                                                                  answered May 24 at 10:26









                                                                                                  t-clausen.dkt-clausen.dk

                                                                                                  2,4545 silver badges14 bronze badges




                                                                                                  2,4545 silver badges14 bronze badges











                                                                                                  • 1




                                                                                                    $begingroup$
                                                                                                    Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                                                                                                    $endgroup$
                                                                                                    – Muqo
                                                                                                    May 24 at 12:13














                                                                                                  • 1




                                                                                                    $begingroup$
                                                                                                    Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                                                                                                    $endgroup$
                                                                                                    – Muqo
                                                                                                    May 24 at 12:13








                                                                                                  1




                                                                                                  1




                                                                                                  $begingroup$
                                                                                                  Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                                                                                                  $endgroup$
                                                                                                  – Muqo
                                                                                                  May 24 at 12:13




                                                                                                  $begingroup$
                                                                                                  Very clever use of BIT values, the delimiter spaces, and circular string processing. Much better answer than mine!
                                                                                                  $endgroup$
                                                                                                  – Muqo
                                                                                                  May 24 at 12:13











                                                                                                  2












                                                                                                  $begingroup$


                                                                                                  Retina, 51 bytes



                                                                                                  1,2,`w+
                                                                                                  ;$&
                                                                                                  +(m`^(.(.*?)) ?;(.)
                                                                                                  $1¶$.2* $3;
                                                                                                  ; |;$



                                                                                                  Try it online!



                                                                                                  A rather straightforward approach that marks every other word and then applies the transformation directly.



                                                                                                  Explanation



                                                                                                  1,2,`w+
                                                                                                  ;$&


                                                                                                  We mark every other word with a semicolon by matching each word, but only applying the replacement to the matches (which are zero indexed) starting from match 1 and then 3 and so on.



                                                                                                  +(m`^(.(.*?)) ?;(.)
                                                                                                  $1¶$.2* $3;


                                                                                                  +(m sets some properties for the following stages. The plus begins a "while this group of stages changes something" loop, and the open bracket denotes that the plus should apply to all of the following stages until there is a close bracket in front of a backtick (which is all of the stages in this case). The m just tells the regex to treat ^ as also matching from the beginning of lines instead of just the beginning of the string.



                                                                                                  The actual regex is pretty straightforward. We simply match the appropriate amount of stuff before the first semicolon and then use Retina's * replacement syntax to put in the correct number of spaces.



                                                                                                  ; |;$



                                                                                                  This stage is applied after the last one to remove semicolons and spaces at the end of words that we changed to vertical.






                                                                                                  share|improve this answer









                                                                                                  $endgroup$




















                                                                                                    2












                                                                                                    $begingroup$


                                                                                                    Retina, 51 bytes



                                                                                                    1,2,`w+
                                                                                                    ;$&
                                                                                                    +(m`^(.(.*?)) ?;(.)
                                                                                                    $1¶$.2* $3;
                                                                                                    ; |;$



                                                                                                    Try it online!



                                                                                                    A rather straightforward approach that marks every other word and then applies the transformation directly.



                                                                                                    Explanation



                                                                                                    1,2,`w+
                                                                                                    ;$&


                                                                                                    We mark every other word with a semicolon by matching each word, but only applying the replacement to the matches (which are zero indexed) starting from match 1 and then 3 and so on.



                                                                                                    +(m`^(.(.*?)) ?;(.)
                                                                                                    $1¶$.2* $3;


                                                                                                    +(m sets some properties for the following stages. The plus begins a "while this group of stages changes something" loop, and the open bracket denotes that the plus should apply to all of the following stages until there is a close bracket in front of a backtick (which is all of the stages in this case). The m just tells the regex to treat ^ as also matching from the beginning of lines instead of just the beginning of the string.



                                                                                                    The actual regex is pretty straightforward. We simply match the appropriate amount of stuff before the first semicolon and then use Retina's * replacement syntax to put in the correct number of spaces.



                                                                                                    ; |;$



                                                                                                    This stage is applied after the last one to remove semicolons and spaces at the end of words that we changed to vertical.






                                                                                                    share|improve this answer









                                                                                                    $endgroup$


















                                                                                                      2












                                                                                                      2








                                                                                                      2





                                                                                                      $begingroup$


                                                                                                      Retina, 51 bytes



                                                                                                      1,2,`w+
                                                                                                      ;$&
                                                                                                      +(m`^(.(.*?)) ?;(.)
                                                                                                      $1¶$.2* $3;
                                                                                                      ; |;$



                                                                                                      Try it online!



                                                                                                      A rather straightforward approach that marks every other word and then applies the transformation directly.



                                                                                                      Explanation



                                                                                                      1,2,`w+
                                                                                                      ;$&


                                                                                                      We mark every other word with a semicolon by matching each word, but only applying the replacement to the matches (which are zero indexed) starting from match 1 and then 3 and so on.



                                                                                                      +(m`^(.(.*?)) ?;(.)
                                                                                                      $1¶$.2* $3;


                                                                                                      +(m sets some properties for the following stages. The plus begins a "while this group of stages changes something" loop, and the open bracket denotes that the plus should apply to all of the following stages until there is a close bracket in front of a backtick (which is all of the stages in this case). The m just tells the regex to treat ^ as also matching from the beginning of lines instead of just the beginning of the string.



                                                                                                      The actual regex is pretty straightforward. We simply match the appropriate amount of stuff before the first semicolon and then use Retina's * replacement syntax to put in the correct number of spaces.



                                                                                                      ; |;$



                                                                                                      This stage is applied after the last one to remove semicolons and spaces at the end of words that we changed to vertical.






                                                                                                      share|improve this answer









                                                                                                      $endgroup$




                                                                                                      Retina, 51 bytes



                                                                                                      1,2,`w+
                                                                                                      ;$&
                                                                                                      +(m`^(.(.*?)) ?;(.)
                                                                                                      $1¶$.2* $3;
                                                                                                      ; |;$



                                                                                                      Try it online!



                                                                                                      A rather straightforward approach that marks every other word and then applies the transformation directly.



                                                                                                      Explanation



                                                                                                      1,2,`w+
                                                                                                      ;$&


                                                                                                      We mark every other word with a semicolon by matching each word, but only applying the replacement to the matches (which are zero indexed) starting from match 1 and then 3 and so on.



                                                                                                      +(m`^(.(.*?)) ?;(.)
                                                                                                      $1¶$.2* $3;


                                                                                                      +(m sets some properties for the following stages. The plus begins a "while this group of stages changes something" loop, and the open bracket denotes that the plus should apply to all of the following stages until there is a close bracket in front of a backtick (which is all of the stages in this case). The m just tells the regex to treat ^ as also matching from the beginning of lines instead of just the beginning of the string.



                                                                                                      The actual regex is pretty straightforward. We simply match the appropriate amount of stuff before the first semicolon and then use Retina's * replacement syntax to put in the correct number of spaces.



                                                                                                      ; |;$



                                                                                                      This stage is applied after the last one to remove semicolons and spaces at the end of words that we changed to vertical.







                                                                                                      share|improve this answer












                                                                                                      share|improve this answer



                                                                                                      share|improve this answer










                                                                                                      answered May 23 at 15:51









                                                                                                      FryAmTheEggmanFryAmTheEggman

                                                                                                      15.2k3 gold badges25 silver badges85 bronze badges




                                                                                                      15.2k3 gold badges25 silver badges85 bronze badges


























                                                                                                          2












                                                                                                          $begingroup$


                                                                                                          Retina 0.8.2, 58 bytes



                                                                                                          (?<!^(S* S* )*S*)

                                                                                                          ¶?

                                                                                                          +`(..(.)*¶)((?<-2> )*S)
                                                                                                          $1 $3


                                                                                                          Try it online! Link includes test cases. Alternative solution, also 58 bytes:



                                                                                                          ( S*) 
                                                                                                          $1¶
                                                                                                          +` (.)
                                                                                                          ¶$1


                                                                                                          +`(..(.)*¶)((?<-2> )*S)
                                                                                                          $1 $3


                                                                                                          Try it online! Link includes test cases.



                                                                                                          I'm deliberately not using Retina 1 here, so I don't get operations on alternate words for free; instead I have two approaches. The first approach splits on all letters in alternate words by counting preceding spaces, while the second approach replaces alternate spaces with newlines and then uses the remaining spaces to help it split alternate words into letters. Each approach has to then join the last vertical letter with the next horizontal word, although the code is different because they split the words in different ways. The final stage of both approaches then pads each line until its first non-space character is aligned under the last character of the previous line.



                                                                                                          Note that I don't assume that words are just letters because I don't have to.






                                                                                                          share|improve this answer









                                                                                                          $endgroup$




















                                                                                                            2












                                                                                                            $begingroup$


                                                                                                            Retina 0.8.2, 58 bytes



                                                                                                            (?<!^(S* S* )*S*)

                                                                                                            ¶?

                                                                                                            +`(..(.)*¶)((?<-2> )*S)
                                                                                                            $1 $3


                                                                                                            Try it online! Link includes test cases. Alternative solution, also 58 bytes:



                                                                                                            ( S*) 
                                                                                                            $1¶
                                                                                                            +` (.)
                                                                                                            ¶$1


                                                                                                            +`(..(.)*¶)((?<-2> )*S)
                                                                                                            $1 $3


                                                                                                            Try it online! Link includes test cases.



                                                                                                            I'm deliberately not using Retina 1 here, so I don't get operations on alternate words for free; instead I have two approaches. The first approach splits on all letters in alternate words by counting preceding spaces, while the second approach replaces alternate spaces with newlines and then uses the remaining spaces to help it split alternate words into letters. Each approach has to then join the last vertical letter with the next horizontal word, although the code is different because they split the words in different ways. The final stage of both approaches then pads each line until its first non-space character is aligned under the last character of the previous line.



                                                                                                            Note that I don't assume that words are just letters because I don't have to.






                                                                                                            share|improve this answer









                                                                                                            $endgroup$


















                                                                                                              2












                                                                                                              2








                                                                                                              2





                                                                                                              $begingroup$


                                                                                                              Retina 0.8.2, 58 bytes



                                                                                                              (?<!^(S* S* )*S*)

                                                                                                              ¶?

                                                                                                              +`(..(.)*¶)((?<-2> )*S)
                                                                                                              $1 $3


                                                                                                              Try it online! Link includes test cases. Alternative solution, also 58 bytes:



                                                                                                              ( S*) 
                                                                                                              $1¶
                                                                                                              +` (.)
                                                                                                              ¶$1


                                                                                                              +`(..(.)*¶)((?<-2> )*S)
                                                                                                              $1 $3


                                                                                                              Try it online! Link includes test cases.



                                                                                                              I'm deliberately not using Retina 1 here, so I don't get operations on alternate words for free; instead I have two approaches. The first approach splits on all letters in alternate words by counting preceding spaces, while the second approach replaces alternate spaces with newlines and then uses the remaining spaces to help it split alternate words into letters. Each approach has to then join the last vertical letter with the next horizontal word, although the code is different because they split the words in different ways. The final stage of both approaches then pads each line until its first non-space character is aligned under the last character of the previous line.



                                                                                                              Note that I don't assume that words are just letters because I don't have to.






                                                                                                              share|improve this answer









                                                                                                              $endgroup$




                                                                                                              Retina 0.8.2, 58 bytes



                                                                                                              (?<!^(S* S* )*S*)

                                                                                                              ¶?

                                                                                                              +`(..(.)*¶)((?<-2> )*S)
                                                                                                              $1 $3


                                                                                                              Try it online! Link includes test cases. Alternative solution, also 58 bytes:



                                                                                                              ( S*) 
                                                                                                              $1¶
                                                                                                              +` (.)
                                                                                                              ¶$1


                                                                                                              +`(..(.)*¶)((?<-2> )*S)
                                                                                                              $1 $3


                                                                                                              Try it online! Link includes test cases.



                                                                                                              I'm deliberately not using Retina 1 here, so I don't get operations on alternate words for free; instead I have two approaches. The first approach splits on all letters in alternate words by counting preceding spaces, while the second approach replaces alternate spaces with newlines and then uses the remaining spaces to help it split alternate words into letters. Each approach has to then join the last vertical letter with the next horizontal word, although the code is different because they split the words in different ways. The final stage of both approaches then pads each line until its first non-space character is aligned under the last character of the previous line.



                                                                                                              Note that I don't assume that words are just letters because I don't have to.







                                                                                                              share|improve this answer












                                                                                                              share|improve this answer



                                                                                                              share|improve this answer










                                                                                                              answered May 23 at 19:16









                                                                                                              NeilNeil

                                                                                                              87k8 gold badges46 silver badges183 bronze badges




                                                                                                              87k8 gold badges46 silver badges183 bronze badges


























                                                                                                                  2












                                                                                                                  $begingroup$


                                                                                                                  PowerShell, 101 89 83 bytes



                                                                                                                  -12 bytes thanks to mazzy.



                                                                                                                  $args|%{$l+=if(++$i%2){$_.length-1;$t+=$_}else{1;$_|% t*y|%{$t+='
                                                                                                                  '+' '*$l+$_}}};$t


                                                                                                                  Try it online!






                                                                                                                  share|improve this answer











                                                                                                                  $endgroup$















                                                                                                                  • $begingroup$
                                                                                                                    nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 14:37










                                                                                                                  • $begingroup$
                                                                                                                    @mazzy, with the splatting i get wrong answer for foo. see the code.
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 15:25










                                                                                                                  • $begingroup$
                                                                                                                    oO! The splatting splits one word to a char array. Interesting. Thanks!
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 17:01








                                                                                                                  • 1




                                                                                                                    $begingroup$
                                                                                                                    @mazzy, it's not my fault :)
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 17:54












                                                                                                                  • $begingroup$
                                                                                                                    I think we can use the rule Given a list of at least two words...
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 18:03
















                                                                                                                  2












                                                                                                                  $begingroup$


                                                                                                                  PowerShell, 101 89 83 bytes



                                                                                                                  -12 bytes thanks to mazzy.



                                                                                                                  $args|%{$l+=if(++$i%2){$_.length-1;$t+=$_}else{1;$_|% t*y|%{$t+='
                                                                                                                  '+' '*$l+$_}}};$t


                                                                                                                  Try it online!






                                                                                                                  share|improve this answer











                                                                                                                  $endgroup$















                                                                                                                  • $begingroup$
                                                                                                                    nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 14:37










                                                                                                                  • $begingroup$
                                                                                                                    @mazzy, with the splatting i get wrong answer for foo. see the code.
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 15:25










                                                                                                                  • $begingroup$
                                                                                                                    oO! The splatting splits one word to a char array. Interesting. Thanks!
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 17:01








                                                                                                                  • 1




                                                                                                                    $begingroup$
                                                                                                                    @mazzy, it's not my fault :)
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 17:54












                                                                                                                  • $begingroup$
                                                                                                                    I think we can use the rule Given a list of at least two words...
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 18:03














                                                                                                                  2












                                                                                                                  2








                                                                                                                  2





                                                                                                                  $begingroup$


                                                                                                                  PowerShell, 101 89 83 bytes



                                                                                                                  -12 bytes thanks to mazzy.



                                                                                                                  $args|%{$l+=if(++$i%2){$_.length-1;$t+=$_}else{1;$_|% t*y|%{$t+='
                                                                                                                  '+' '*$l+$_}}};$t


                                                                                                                  Try it online!






                                                                                                                  share|improve this answer











                                                                                                                  $endgroup$




                                                                                                                  PowerShell, 101 89 83 bytes



                                                                                                                  -12 bytes thanks to mazzy.



                                                                                                                  $args|%{$l+=if(++$i%2){$_.length-1;$t+=$_}else{1;$_|% t*y|%{$t+='
                                                                                                                  '+' '*$l+$_}}};$t


                                                                                                                  Try it online!







                                                                                                                  share|improve this answer














                                                                                                                  share|improve this answer



                                                                                                                  share|improve this answer








                                                                                                                  edited May 26 at 15:04

























                                                                                                                  answered May 25 at 13:42









                                                                                                                  Andrei OdegovAndrei Odegov

                                                                                                                  7593 silver badges6 bronze badges




                                                                                                                  7593 silver badges6 bronze badges















                                                                                                                  • $begingroup$
                                                                                                                    nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 14:37










                                                                                                                  • $begingroup$
                                                                                                                    @mazzy, with the splatting i get wrong answer for foo. see the code.
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 15:25










                                                                                                                  • $begingroup$
                                                                                                                    oO! The splatting splits one word to a char array. Interesting. Thanks!
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 17:01








                                                                                                                  • 1




                                                                                                                    $begingroup$
                                                                                                                    @mazzy, it's not my fault :)
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 17:54












                                                                                                                  • $begingroup$
                                                                                                                    I think we can use the rule Given a list of at least two words...
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 18:03


















                                                                                                                  • $begingroup$
                                                                                                                    nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 14:37










                                                                                                                  • $begingroup$
                                                                                                                    @mazzy, with the splatting i get wrong answer for foo. see the code.
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 15:25










                                                                                                                  • $begingroup$
                                                                                                                    oO! The splatting splits one word to a char array. Interesting. Thanks!
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 17:01








                                                                                                                  • 1




                                                                                                                    $begingroup$
                                                                                                                    @mazzy, it's not my fault :)
                                                                                                                    $endgroup$
                                                                                                                    – Andrei Odegov
                                                                                                                    May 25 at 17:54












                                                                                                                  • $begingroup$
                                                                                                                    I think we can use the rule Given a list of at least two words...
                                                                                                                    $endgroup$
                                                                                                                    – mazzy
                                                                                                                    May 25 at 18:03
















                                                                                                                  $begingroup$
                                                                                                                  nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                                                                                                                  $endgroup$
                                                                                                                  – mazzy
                                                                                                                  May 25 at 14:37




                                                                                                                  $begingroup$
                                                                                                                  nice. you can: 1) remove first line, 2) use a splatting & $b @p (each word as one argument), 3) use shorter form for new line constant. see 3,4 line at this example
                                                                                                                  $endgroup$
                                                                                                                  – mazzy
                                                                                                                  May 25 at 14:37












                                                                                                                  $begingroup$
                                                                                                                  @mazzy, with the splatting i get wrong answer for foo. see the code.
                                                                                                                  $endgroup$
                                                                                                                  – Andrei Odegov
                                                                                                                  May 25 at 15:25




                                                                                                                  $begingroup$
                                                                                                                  @mazzy, with the splatting i get wrong answer for foo. see the code.
                                                                                                                  $endgroup$
                                                                                                                  – Andrei Odegov
                                                                                                                  May 25 at 15:25












                                                                                                                  $begingroup$
                                                                                                                  oO! The splatting splits one word to a char array. Interesting. Thanks!
                                                                                                                  $endgroup$
                                                                                                                  – mazzy
                                                                                                                  May 25 at 17:01






                                                                                                                  $begingroup$
                                                                                                                  oO! The splatting splits one word to a char array. Interesting. Thanks!
                                                                                                                  $endgroup$
                                                                                                                  – mazzy
                                                                                                                  May 25 at 17:01






                                                                                                                  1




                                                                                                                  1




                                                                                                                  $begingroup$
                                                                                                                  @mazzy, it's not my fault :)
                                                                                                                  $endgroup$
                                                                                                                  – Andrei Odegov
                                                                                                                  May 25 at 17:54






                                                                                                                  $begingroup$
                                                                                                                  @mazzy, it's not my fault :)
                                                                                                                  $endgroup$
                                                                                                                  – Andrei Odegov
                                                                                                                  May 25 at 17:54














                                                                                                                  $begingroup$
                                                                                                                  I think we can use the rule Given a list of at least two words...
                                                                                                                  $endgroup$
                                                                                                                  – mazzy
                                                                                                                  May 25 at 18:03




                                                                                                                  $begingroup$
                                                                                                                  I think we can use the rule Given a list of at least two words...
                                                                                                                  $endgroup$
                                                                                                                  – mazzy
                                                                                                                  May 25 at 18:03











                                                                                                                  2












                                                                                                                  $begingroup$


                                                                                                                  PowerShell, 74 65 bytes





                                                                                                                  -join($args|%{$_|% t*y|%{($p+=(' ','
                                                                                                                  ')[!$p]*!$i)*$i;$_};$i=!$i})


                                                                                                                  Try it online!






                                                                                                                  share|improve this answer











                                                                                                                  $endgroup$




















                                                                                                                    2












                                                                                                                    $begingroup$


                                                                                                                    PowerShell, 74 65 bytes





                                                                                                                    -join($args|%{$_|% t*y|%{($p+=(' ','
                                                                                                                    ')[!$p]*!$i)*$i;$_};$i=!$i})


                                                                                                                    Try it online!






                                                                                                                    share|improve this answer











                                                                                                                    $endgroup$


















                                                                                                                      2












                                                                                                                      2








                                                                                                                      2





                                                                                                                      $begingroup$


                                                                                                                      PowerShell, 74 65 bytes





                                                                                                                      -join($args|%{$_|% t*y|%{($p+=(' ','
                                                                                                                      ')[!$p]*!$i)*$i;$_};$i=!$i})


                                                                                                                      Try it online!






                                                                                                                      share|improve this answer











                                                                                                                      $endgroup$




                                                                                                                      PowerShell, 74 65 bytes





                                                                                                                      -join($args|%{$_|% t*y|%{($p+=(' ','
                                                                                                                      ')[!$p]*!$i)*$i;$_};$i=!$i})


                                                                                                                      Try it online!







                                                                                                                      share|improve this answer














                                                                                                                      share|improve this answer



                                                                                                                      share|improve this answer








                                                                                                                      edited May 27 at 6:29

























                                                                                                                      answered May 26 at 17:46









                                                                                                                      mazzymazzy

                                                                                                                      3,8321 gold badge4 silver badges20 bronze badges




                                                                                                                      3,8321 gold badge4 silver badges20 bronze badges


























                                                                                                                          2












                                                                                                                          $begingroup$


                                                                                                                          R, 126 bytes





                                                                                                                          function(x,`>`=strrep)for(i in seq(x)){H=i%%2;cat(paste0('
                                                                                                                          '>!H,' '>F*!H,e<-'if'(H,x,strsplit(x,''))[[i]]))
                                                                                                                          F=F+nchar(e[1])-H}


                                                                                                                          Try it online!




                                                                                                                          • -3 bytes thanks to @Giuseppe






                                                                                                                          share|improve this answer











                                                                                                                          $endgroup$




















                                                                                                                            2












                                                                                                                            $begingroup$


                                                                                                                            R, 126 bytes





                                                                                                                            function(x,`>`=strrep)for(i in seq(x)){H=i%%2;cat(paste0('
                                                                                                                            '>!H,' '>F*!H,e<-'if'(H,x,strsplit(x,''))[[i]]))
                                                                                                                            F=F+nchar(e[1])-H}


                                                                                                                            Try it online!




                                                                                                                            • -3 bytes thanks to @Giuseppe






                                                                                                                            share|improve this answer











                                                                                                                            $endgroup$


















                                                                                                                              2












                                                                                                                              2








                                                                                                                              2





                                                                                                                              $begingroup$


                                                                                                                              R, 126 bytes





                                                                                                                              function(x,`>`=strrep)for(i in seq(x)){H=i%%2;cat(paste0('
                                                                                                                              '>!H,' '>F*!H,e<-'if'(H,x,strsplit(x,''))[[i]]))
                                                                                                                              F=F+nchar(e[1])-H}


                                                                                                                              Try it online!




                                                                                                                              • -3 bytes thanks to @Giuseppe






                                                                                                                              share|improve this answer











                                                                                                                              $endgroup$




                                                                                                                              R, 126 bytes





                                                                                                                              function(x,`>`=strrep)for(i in seq(x)){H=i%%2;cat(paste0('
                                                                                                                              '>!H,' '>F*!H,e<-'if'(H,x,strsplit(x,''))[[i]]))
                                                                                                                              F=F+nchar(e[1])-H}


                                                                                                                              Try it online!




                                                                                                                              • -3 bytes thanks to @Giuseppe







                                                                                                                              share|improve this answer














                                                                                                                              share|improve this answer



                                                                                                                              share|improve this answer








                                                                                                                              edited May 27 at 17:43

























                                                                                                                              answered May 26 at 17:26









                                                                                                                              digEmAlldigEmAll

                                                                                                                              4,2846 silver badges19 bronze badges




                                                                                                                              4,2846 silver badges19 bronze badges


























                                                                                                                                  2












                                                                                                                                  $begingroup$

                                                                                                                                  T-SQL, 289 bytes



                                                                                                                                  DECLARE @ VARCHAR(MAX)='a a',@I INT=1,@S INT=0,@B INT=0WHILE @I<=LEN(@)IF SUBSTRING(@,@I,1)=''IF @B=0SELECT @S-=1,@=STUFF(@,@I,1,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3,@B=1 ELSE SELECT @=STUFF(@,@I,1,''),@S+=1,@B=ELSE IF @B=0SELECT @I+=1,@S+=1 ELSE SELECT @=STUFF(@,@I,0,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3PRINT @


                                                                                                                                  This runs on SQL Server 2016 and other versions.



                                                                                                                                  @ holds the space-delimited list. @I tracks the index position in the string. @S tracks the total number of spaces to indent from the left. @B tracks which axis the string is aligned with at point @I.



                                                                                                                                  The byte count includes the minimal example list. The script goes through the list, character by character, and changes the string so that it will display according to the requirements. When the end of the string is reached, the string is PRINTed.






                                                                                                                                  share|improve this answer











                                                                                                                                  $endgroup$















                                                                                                                                  • $begingroup$
                                                                                                                                    Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 10:29










                                                                                                                                  • $begingroup$
                                                                                                                                    @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                                                                                                                                    $endgroup$
                                                                                                                                    – Muqo
                                                                                                                                    May 24 at 10:55










                                                                                                                                  • $begingroup$
                                                                                                                                    confirmed it works now
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 11:08
















                                                                                                                                  2












                                                                                                                                  $begingroup$

                                                                                                                                  T-SQL, 289 bytes



                                                                                                                                  DECLARE @ VARCHAR(MAX)='a a',@I INT=1,@S INT=0,@B INT=0WHILE @I<=LEN(@)IF SUBSTRING(@,@I,1)=''IF @B=0SELECT @S-=1,@=STUFF(@,@I,1,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3,@B=1 ELSE SELECT @=STUFF(@,@I,1,''),@S+=1,@B=ELSE IF @B=0SELECT @I+=1,@S+=1 ELSE SELECT @=STUFF(@,@I,0,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3PRINT @


                                                                                                                                  This runs on SQL Server 2016 and other versions.



                                                                                                                                  @ holds the space-delimited list. @I tracks the index position in the string. @S tracks the total number of spaces to indent from the left. @B tracks which axis the string is aligned with at point @I.



                                                                                                                                  The byte count includes the minimal example list. The script goes through the list, character by character, and changes the string so that it will display according to the requirements. When the end of the string is reached, the string is PRINTed.






                                                                                                                                  share|improve this answer











                                                                                                                                  $endgroup$















                                                                                                                                  • $begingroup$
                                                                                                                                    Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 10:29










                                                                                                                                  • $begingroup$
                                                                                                                                    @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                                                                                                                                    $endgroup$
                                                                                                                                    – Muqo
                                                                                                                                    May 24 at 10:55










                                                                                                                                  • $begingroup$
                                                                                                                                    confirmed it works now
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 11:08














                                                                                                                                  2












                                                                                                                                  2








                                                                                                                                  2





                                                                                                                                  $begingroup$

                                                                                                                                  T-SQL, 289 bytes



                                                                                                                                  DECLARE @ VARCHAR(MAX)='a a',@I INT=1,@S INT=0,@B INT=0WHILE @I<=LEN(@)IF SUBSTRING(@,@I,1)=''IF @B=0SELECT @S-=1,@=STUFF(@,@I,1,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3,@B=1 ELSE SELECT @=STUFF(@,@I,1,''),@S+=1,@B=ELSE IF @B=0SELECT @I+=1,@S+=1 ELSE SELECT @=STUFF(@,@I,0,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3PRINT @


                                                                                                                                  This runs on SQL Server 2016 and other versions.



                                                                                                                                  @ holds the space-delimited list. @I tracks the index position in the string. @S tracks the total number of spaces to indent from the left. @B tracks which axis the string is aligned with at point @I.



                                                                                                                                  The byte count includes the minimal example list. The script goes through the list, character by character, and changes the string so that it will display according to the requirements. When the end of the string is reached, the string is PRINTed.






                                                                                                                                  share|improve this answer











                                                                                                                                  $endgroup$



                                                                                                                                  T-SQL, 289 bytes



                                                                                                                                  DECLARE @ VARCHAR(MAX)='a a',@I INT=1,@S INT=0,@B INT=0WHILE @I<=LEN(@)IF SUBSTRING(@,@I,1)=''IF @B=0SELECT @S-=1,@=STUFF(@,@I,1,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3,@B=1 ELSE SELECT @=STUFF(@,@I,1,''),@S+=1,@B=ELSE IF @B=0SELECT @I+=1,@S+=1 ELSE SELECT @=STUFF(@,@I,0,'
                                                                                                                                  '+SPACE(@S)),@I+=@S+3PRINT @


                                                                                                                                  This runs on SQL Server 2016 and other versions.



                                                                                                                                  @ holds the space-delimited list. @I tracks the index position in the string. @S tracks the total number of spaces to indent from the left. @B tracks which axis the string is aligned with at point @I.



                                                                                                                                  The byte count includes the minimal example list. The script goes through the list, character by character, and changes the string so that it will display according to the requirements. When the end of the string is reached, the string is PRINTed.







                                                                                                                                  share|improve this answer














                                                                                                                                  share|improve this answer



                                                                                                                                  share|improve this answer








                                                                                                                                  edited May 29 at 12:24









                                                                                                                                  t-clausen.dk

                                                                                                                                  2,4545 silver badges14 bronze badges




                                                                                                                                  2,4545 silver badges14 bronze badges










                                                                                                                                  answered May 24 at 2:17









                                                                                                                                  MuqoMuqo

                                                                                                                                  4995 silver badges9 bronze badges




                                                                                                                                  4995 silver badges9 bronze badges















                                                                                                                                  • $begingroup$
                                                                                                                                    Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 10:29










                                                                                                                                  • $begingroup$
                                                                                                                                    @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                                                                                                                                    $endgroup$
                                                                                                                                    – Muqo
                                                                                                                                    May 24 at 10:55










                                                                                                                                  • $begingroup$
                                                                                                                                    confirmed it works now
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 11:08


















                                                                                                                                  • $begingroup$
                                                                                                                                    Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 10:29










                                                                                                                                  • $begingroup$
                                                                                                                                    @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                                                                                                                                    $endgroup$
                                                                                                                                    – Muqo
                                                                                                                                    May 24 at 10:55










                                                                                                                                  • $begingroup$
                                                                                                                                    confirmed it works now
                                                                                                                                    $endgroup$
                                                                                                                                    – t-clausen.dk
                                                                                                                                    May 24 at 11:08
















                                                                                                                                  $begingroup$
                                                                                                                                  Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                                                                                                                                  $endgroup$
                                                                                                                                  – t-clausen.dk
                                                                                                                                  May 24 at 10:29




                                                                                                                                  $begingroup$
                                                                                                                                  Hi @Mugo It seems there is a glitch in your script when using longer input. If you test with the data from my answer, you will see there is a unintended bend in the last word between p and t
                                                                                                                                  $endgroup$
                                                                                                                                  – t-clausen.dk
                                                                                                                                  May 24 at 10:29












                                                                                                                                  $begingroup$
                                                                                                                                  @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                                                                                                                                  $endgroup$
                                                                                                                                  – Muqo
                                                                                                                                  May 24 at 10:55




                                                                                                                                  $begingroup$
                                                                                                                                  @t-clausen.dk Oops, I didn't handle the last iteration properly. Thanks!
                                                                                                                                  $endgroup$
                                                                                                                                  – Muqo
                                                                                                                                  May 24 at 10:55












                                                                                                                                  $begingroup$
                                                                                                                                  confirmed it works now
                                                                                                                                  $endgroup$
                                                                                                                                  – t-clausen.dk
                                                                                                                                  May 24 at 11:08




                                                                                                                                  $begingroup$
                                                                                                                                  confirmed it works now
                                                                                                                                  $endgroup$
                                                                                                                                  – t-clausen.dk
                                                                                                                                  May 24 at 11:08











                                                                                                                                  1












                                                                                                                                  $begingroup$


                                                                                                                                  JavaScript (Node.js), 75 bytes





                                                                                                                                  a=>a.map(x=>i++&1?[,...x].join(`
                                                                                                                                  `.padEnd(n)):(n+=x.length,x),n=i=0).join``


                                                                                                                                  Try it online!



                                                                                                                                  Explanation and ungolfed



                                                                                                                                  function f(a) {                   // Main function:
                                                                                                                                  return a.map( // Map through all words:
                                                                                                                                  function(x) {
                                                                                                                                  if (i++ & 1) // If i % 2 == 1 (i.e. vertical):
                                                                                                                                  return [,...x].join( // Since the first one needs to have its own linefeed
                                                                                                                                  // and indentation, add a dummy item to the start.
                                                                                                                                  "n".padEnd(n) // Join the array with the padded line feeds.
                                                                                                                                  );
                                                                                                                                  else { // If i % 2 == 0 (i.e. horizontal):
                                                                                                                                  n += x.length; // Add the length of this string to the variable that
                                                                                                                                  // counts how long the padded line feeds should be.
                                                                                                                                  return x; // Append the string at the end without line feeds.
                                                                                                                                  }
                                                                                                                                  },
                                                                                                                                  n = i = 0 // Initialize variables.
                                                                                                                                  // n: the length of the padded line feeds
                                                                                                                                  // (including the line feed)
                                                                                                                                  // i: keeps track of the direction
                                                                                                                                  ).join("") // Join all stuffs and return.
                                                                                                                                  }





                                                                                                                                  share|improve this answer











                                                                                                                                  $endgroup$




















                                                                                                                                    1












                                                                                                                                    $begingroup$


                                                                                                                                    JavaScript (Node.js), 75 bytes





                                                                                                                                    a=>a.map(x=>i++&1?[,...x].join(`
                                                                                                                                    `.padEnd(n)):(n+=x.length,x),n=i=0).join``


                                                                                                                                    Try it online!



                                                                                                                                    Explanation and ungolfed



                                                                                                                                    function f(a) {                   // Main function:
                                                                                                                                    return a.map( // Map through all words:
                                                                                                                                    function(x) {
                                                                                                                                    if (i++ & 1) // If i % 2 == 1 (i.e. vertical):
                                                                                                                                    return [,...x].join( // Since the first one needs to have its own linefeed
                                                                                                                                    // and indentation, add a dummy item to the start.
                                                                                                                                    "n".padEnd(n) // Join the array with the padded line feeds.
                                                                                                                                    );
                                                                                                                                    else { // If i % 2 == 0 (i.e. horizontal):
                                                                                                                                    n += x.length; // Add the length of this string to the variable that
                                                                                                                                    // counts how long the padded line feeds should be.
                                                                                                                                    return x; // Append the string at the end without line feeds.
                                                                                                                                    }
                                                                                                                                    },
                                                                                                                                    n = i = 0 // Initialize variables.
                                                                                                                                    // n: the length of the padded line feeds
                                                                                                                                    // (including the line feed)
                                                                                                                                    // i: keeps track of the direction
                                                                                                                                    ).join("") // Join all stuffs and return.
                                                                                                                                    }





                                                                                                                                    share|improve this answer











                                                                                                                                    $endgroup$


















                                                                                                                                      1












                                                                                                                                      1








                                                                                                                                      1





                                                                                                                                      $begingroup$


                                                                                                                                      JavaScript (Node.js), 75 bytes





                                                                                                                                      a=>a.map(x=>i++&1?[,...x].join(`
                                                                                                                                      `.padEnd(n)):(n+=x.length,x),n=i=0).join``


                                                                                                                                      Try it online!



                                                                                                                                      Explanation and ungolfed



                                                                                                                                      function f(a) {                   // Main function:
                                                                                                                                      return a.map( // Map through all words:
                                                                                                                                      function(x) {
                                                                                                                                      if (i++ & 1) // If i % 2 == 1 (i.e. vertical):
                                                                                                                                      return [,...x].join( // Since the first one needs to have its own linefeed
                                                                                                                                      // and indentation, add a dummy item to the start.
                                                                                                                                      "n".padEnd(n) // Join the array with the padded line feeds.
                                                                                                                                      );
                                                                                                                                      else { // If i % 2 == 0 (i.e. horizontal):
                                                                                                                                      n += x.length; // Add the length of this string to the variable that
                                                                                                                                      // counts how long the padded line feeds should be.
                                                                                                                                      return x; // Append the string at the end without line feeds.
                                                                                                                                      }
                                                                                                                                      },
                                                                                                                                      n = i = 0 // Initialize variables.
                                                                                                                                      // n: the length of the padded line feeds
                                                                                                                                      // (including the line feed)
                                                                                                                                      // i: keeps track of the direction
                                                                                                                                      ).join("") // Join all stuffs and return.
                                                                                                                                      }





                                                                                                                                      share|improve this answer











                                                                                                                                      $endgroup$




                                                                                                                                      JavaScript (Node.js), 75 bytes





                                                                                                                                      a=>a.map(x=>i++&1?[,...x].join(`
                                                                                                                                      `.padEnd(n)):(n+=x.length,x),n=i=0).join``


                                                                                                                                      Try it online!



                                                                                                                                      Explanation and ungolfed



                                                                                                                                      function f(a) {                   // Main function:
                                                                                                                                      return a.map( // Map through all words:
                                                                                                                                      function(x) {
                                                                                                                                      if (i++ & 1) // If i % 2 == 1 (i.e. vertical):
                                                                                                                                      return [,...x].join( // Since the first one needs to have its own linefeed
                                                                                                                                      // and indentation, add a dummy item to the start.
                                                                                                                                      "n".padEnd(n) // Join the array with the padded line feeds.
                                                                                                                                      );
                                                                                                                                      else { // If i % 2 == 0 (i.e. horizontal):
                                                                                                                                      n += x.length; // Add the length of this string to the variable that
                                                                                                                                      // counts how long the padded line feeds should be.
                                                                                                                                      return x; // Append the string at the end without line feeds.
                                                                                                                                      }
                                                                                                                                      },
                                                                                                                                      n = i = 0 // Initialize variables.
                                                                                                                                      // n: the length of the padded line feeds
                                                                                                                                      // (including the line feed)
                                                                                                                                      // i: keeps track of the direction
                                                                                                                                      ).join("") // Join all stuffs and return.
                                                                                                                                      }






                                                                                                                                      share|improve this answer














                                                                                                                                      share|improve this answer



                                                                                                                                      share|improve this answer








                                                                                                                                      edited May 24 at 1:54

























                                                                                                                                      answered May 24 at 1:31









                                                                                                                                      Shieru AsakotoShieru Asakoto

                                                                                                                                      3,1354 silver badges19 bronze badges




                                                                                                                                      3,1354 silver badges19 bronze badges


























                                                                                                                                          1












                                                                                                                                          $begingroup$


                                                                                                                                          Stax, 12 bytes



                                                                                                                                          ìZΣFτëWº═φ‼R


                                                                                                                                          Run and debug it






                                                                                                                                          share|improve this answer











                                                                                                                                          $endgroup$




















                                                                                                                                            1












                                                                                                                                            $begingroup$


                                                                                                                                            Stax, 12 bytes



                                                                                                                                            ìZΣFτëWº═φ‼R


                                                                                                                                            Run and debug it






                                                                                                                                            share|improve this answer











                                                                                                                                            $endgroup$


















                                                                                                                                              1












                                                                                                                                              1








                                                                                                                                              1





                                                                                                                                              $begingroup$


                                                                                                                                              Stax, 12 bytes



                                                                                                                                              ìZΣFτëWº═φ‼R


                                                                                                                                              Run and debug it






                                                                                                                                              share|improve this answer











                                                                                                                                              $endgroup$




                                                                                                                                              Stax, 12 bytes



                                                                                                                                              ìZΣFτëWº═φ‼R


                                                                                                                                              Run and debug it







                                                                                                                                              share|improve this answer














                                                                                                                                              share|improve this answer



                                                                                                                                              share|improve this answer








                                                                                                                                              edited May 24 at 6:16

























                                                                                                                                              answered May 24 at 5:35









                                                                                                                                              recursiverecursive

                                                                                                                                              7,61315 silver badges30 bronze badges




                                                                                                                                              7,61315 silver badges30 bronze badges


























                                                                                                                                                  1












                                                                                                                                                  $begingroup$


                                                                                                                                                  Jelly, 21 bytes



                                                                                                                                                  Ẉm2Ä’x2Ż⁶xⱮṛ;⁷ɗ;ⱮY¥ƭ"


                                                                                                                                                  Try it online!



                                                                                                                                                  A full program taking the input as a list of strings and implicitly outputting to stdout the word ladder.






                                                                                                                                                  share|improve this answer









                                                                                                                                                  $endgroup$




















                                                                                                                                                    1












                                                                                                                                                    $begingroup$


                                                                                                                                                    Jelly, 21 bytes



                                                                                                                                                    Ẉm2Ä’x2Ż⁶xⱮṛ;⁷ɗ;ⱮY¥ƭ"


                                                                                                                                                    Try it online!



                                                                                                                                                    A full program taking the input as a list of strings and implicitly outputting to stdout the word ladder.






                                                                                                                                                    share|improve this answer









                                                                                                                                                    $endgroup$


















                                                                                                                                                      1












                                                                                                                                                      1








                                                                                                                                                      1





                                                                                                                                                      $begingroup$


                                                                                                                                                      Jelly, 21 bytes



                                                                                                                                                      Ẉm2Ä’x2Ż⁶xⱮṛ;⁷ɗ;ⱮY¥ƭ"


                                                                                                                                                      Try it online!



                                                                                                                                                      A full program taking the input as a list of strings and implicitly outputting to stdout the word ladder.






                                                                                                                                                      share|improve this answer









                                                                                                                                                      $endgroup$




                                                                                                                                                      Jelly, 21 bytes



                                                                                                                                                      Ẉm2Ä’x2Ż⁶xⱮṛ;⁷ɗ;ⱮY¥ƭ"


                                                                                                                                                      Try it online!



                                                                                                                                                      A full program taking the input as a list of strings and implicitly outputting to stdout the word ladder.







                                                                                                                                                      share|improve this answer












                                                                                                                                                      share|improve this answer



                                                                                                                                                      share|improve this answer










                                                                                                                                                      answered May 24 at 14:28









                                                                                                                                                      Nick KennedyNick Kennedy

                                                                                                                                                      5,6991 gold badge9 silver badges15 bronze badges




                                                                                                                                                      5,6991 gold badge9 silver badges15 bronze badges


























                                                                                                                                                          1












                                                                                                                                                          $begingroup$


                                                                                                                                                          C (gcc), 93 87 bytes



                                                                                                                                                          Thanks to gastropner for the suggestions.



                                                                                                                                                          This version takes an array of strings terminated by a NULL pointer.





                                                                                                                                                          c,d;f(s,t)char**s,*t;{for(c=d=0;t=*s++;d=!d)for(;*t;c+=!d)printf("n%*c"+!d,d*c,*t++);}


                                                                                                                                                          Try it online!






                                                                                                                                                          share|improve this answer











                                                                                                                                                          $endgroup$















                                                                                                                                                          • $begingroup$
                                                                                                                                                            87 bytes
                                                                                                                                                            $endgroup$
                                                                                                                                                            – gastropner
                                                                                                                                                            May 24 at 11:09
















                                                                                                                                                          1












                                                                                                                                                          $begingroup$


                                                                                                                                                          C (gcc), 93 87 bytes



                                                                                                                                                          Thanks to gastropner for the suggestions.



                                                                                                                                                          This version takes an array of strings terminated by a NULL pointer.





                                                                                                                                                          c,d;f(s,t)char**s,*t;{for(c=d=0;t=*s++;d=!d)for(;*t;c+=!d)printf("n%*c"+!d,d*c,*t++);}


                                                                                                                                                          Try it online!






                                                                                                                                                          share|improve this answer











                                                                                                                                                          $endgroup$















                                                                                                                                                          • $begingroup$
                                                                                                                                                            87 bytes
                                                                                                                                                            $endgroup$
                                                                                                                                                            – gastropner
                                                                                                                                                            May 24 at 11:09














                                                                                                                                                          1












                                                                                                                                                          1








                                                                                                                                                          1





                                                                                                                                                          $begingroup$


                                                                                                                                                          C (gcc), 93 87 bytes



                                                                                                                                                          Thanks to gastropner for the suggestions.



                                                                                                                                                          This version takes an array of strings terminated by a NULL pointer.





                                                                                                                                                          c,d;f(s,t)char**s,*t;{for(c=d=0;t=*s++;d=!d)for(;*t;c+=!d)printf("n%*c"+!d,d*c,*t++);}


                                                                                                                                                          Try it online!






                                                                                                                                                          share|improve this answer











                                                                                                                                                          $endgroup$




                                                                                                                                                          C (gcc), 93 87 bytes



                                                                                                                                                          Thanks to gastropner for the suggestions.



                                                                                                                                                          This version takes an array of strings terminated by a NULL pointer.





                                                                                                                                                          c,d;f(s,t)char**s,*t;{for(c=d=0;t=*s++;d=!d)for(;*t;c+=!d)printf("n%*c"+!d,d*c,*t++);}


                                                                                                                                                          Try it online!







                                                                                                                                                          share|improve this answer














                                                                                                                                                          share|improve this answer



                                                                                                                                                          share|improve this answer








                                                                                                                                                          edited May 24 at 17:56

























                                                                                                                                                          answered May 24 at 5:45









                                                                                                                                                          ErikFErikF

                                                                                                                                                          1,5992 silver badges7 bronze badges




                                                                                                                                                          1,5992 silver badges7 bronze badges















                                                                                                                                                          • $begingroup$
                                                                                                                                                            87 bytes
                                                                                                                                                            $endgroup$
                                                                                                                                                            – gastropner
                                                                                                                                                            May 24 at 11:09


















                                                                                                                                                          • $begingroup$
                                                                                                                                                            87 bytes
                                                                                                                                                            $endgroup$
                                                                                                                                                            – gastropner
                                                                                                                                                            May 24 at 11:09
















                                                                                                                                                          $begingroup$
                                                                                                                                                          87 bytes
                                                                                                                                                          $endgroup$
                                                                                                                                                          – gastropner
                                                                                                                                                          May 24 at 11:09




                                                                                                                                                          $begingroup$
                                                                                                                                                          87 bytes
                                                                                                                                                          $endgroup$
                                                                                                                                                          – gastropner
                                                                                                                                                          May 24 at 11:09











                                                                                                                                                          1












                                                                                                                                                          $begingroup$


                                                                                                                                                          Brain-Flak, 152 bytes



                                                                                                                                                          <>([()])<>{<>({}<>{()<({}<>)><>}<>)<>{}{<>({}<((()()()()()){})>)({<({}[()]<((((()()()()){}){}){})>)>()}{})<>(({}<>({}))[({}[{}])])<>}{}}<>{}{({}<>)<>}<>


                                                                                                                                                          Try it online!



                                                                                                                                                          I suspect this can be shorter by combining the two loops for odd and even words.






                                                                                                                                                          share|improve this answer









                                                                                                                                                          $endgroup$











                                                                                                                                                          • 1




                                                                                                                                                            $begingroup$
                                                                                                                                                            Thank you for this!
                                                                                                                                                            $endgroup$
                                                                                                                                                            – Galen Ivanov
                                                                                                                                                            May 25 at 6:23
















                                                                                                                                                          1












                                                                                                                                                          $begingroup$


                                                                                                                                                          Brain-Flak, 152 bytes



                                                                                                                                                          <>([()])<>{<>({}<>{()<({}<>)><>}<>)<>{}{<>({}<((()()()()()){})>)({<({}[()]<((((()()()()){}){}){})>)>()}{})<>(({}<>({}))[({}[{}])])<>}{}}<>{}{({}<>)<>}<>


                                                                                                                                                          Try it online!



                                                                                                                                                          I suspect this can be shorter by combining the two loops for odd and even words.






                                                                                                                                                          share|improve this answer









                                                                                                                                                          $endgroup$











                                                                                                                                                          • 1




                                                                                                                                                            $begingroup$
                                                                                                                                                            Thank you for this!
                                                                                                                                                            $endgroup$
                                                                                                                                                            – Galen Ivanov
                                                                                                                                                            May 25 at 6:23














                                                                                                                                                          1












                                                                                                                                                          1








                                                                                                                                                          1





                                                                                                                                                          $begingroup$


                                                                                                                                                          Brain-Flak, 152 bytes



                                                                                                                                                          <>([()])<>{<>({}<>{()<({}<>)><>}<>)<>{}{<>({}<((()()()()()){})>)({<({}[()]<((((()()()()){}){}){})>)>()}{})<>(({}<>({}))[({}[{}])])<>}{}}<>{}{({}<>)<>}<>


                                                                                                                                                          Try it online!



                                                                                                                                                          I suspect this can be shorter by combining the two loops for odd and even words.






                                                                                                                                                          share|improve this answer









                                                                                                                                                          $endgroup$




                                                                                                                                                          Brain-Flak, 152 bytes



                                                                                                                                                          <>([()])<>{<>({}<>{()<({}<>)><>}<>)<>{}{<>({}<((()()()()()){})>)({<({}[()]<((((()()()()){}){}){})>)>()}{})<>(({}<>({}))[({}[{}])])<>}{}}<>{}{({}<>)<>}<>


                                                                                                                                                          Try it online!



                                                                                                                                                          I suspect this can be shorter by combining the two loops for odd and even words.







                                                                                                                                                          share|improve this answer












                                                                                                                                                          share|improve this answer



                                                                                                                                                          share|improve this answer










                                                                                                                                                          answered May 25 at 2:15









                                                                                                                                                          Jo KingJo King

                                                                                                                                                          30.5k3 gold badges71 silver badges138 bronze badges




                                                                                                                                                          30.5k3 gold badges71 silver badges138 bronze badges











                                                                                                                                                          • 1




                                                                                                                                                            $begingroup$
                                                                                                                                                            Thank you for this!
                                                                                                                                                            $endgroup$
                                                                                                                                                            – Galen Ivanov
                                                                                                                                                            May 25 at 6:23














                                                                                                                                                          • 1




                                                                                                                                                            $begingroup$
                                                                                                                                                            Thank you for this!
                                                                                                                                                            $endgroup$
                                                                                                                                                            – Galen Ivanov
                                                                                                                                                            May 25 at 6:23








                                                                                                                                                          1




                                                                                                                                                          1




                                                                                                                                                          $begingroup$
                                                                                                                                                          Thank you for this!
                                                                                                                                                          $endgroup$
                                                                                                                                                          – Galen Ivanov
                                                                                                                                                          May 25 at 6:23




                                                                                                                                                          $begingroup$
                                                                                                                                                          Thank you for this!
                                                                                                                                                          $endgroup$
                                                                                                                                                          – Galen Ivanov
                                                                                                                                                          May 25 at 6:23











                                                                                                                                                          1












                                                                                                                                                          $begingroup$

                                                                                                                                                          J, 35 33 bytes



                                                                                                                                                          3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y'


                                                                                                                                                          This is a verb that takes the input as a single string with the words separated by spaces. For example, you could call it like this:



                                                                                                                                                          3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y' 'programming puzzles and code golf'


                                                                                                                                                          The output is a matrix of letters and spaces, which the interpreter outputs with newlines as required. Each line will be padded with spaces so they have the exact same length.



                                                                                                                                                          There's one slight problem with the code: it won't work if the input has more than 98 words. If you want to allow a longer input, replace the _98 in the code by _998 to allow up to 998 words, etc.





                                                                                                                                                          Let me explain how this works through some examples.



                                                                                                                                                          Suppose we have a matrix of letters and spaces that we imagine is a partial output for some words, starting with a horizontal word.



                                                                                                                                                             [m=: 3 3$'vwx  y  z'
                                                                                                                                                          vwx
                                                                                                                                                          y
                                                                                                                                                          z


                                                                                                                                                          How could we prepend a new word before this, vertically? It's not hard: just turn the new word to a single-column matrix of letters with the verb ,., then append the output to that single-column matrix. (The verb ,. is convenient because it behaves as an identity function if you apply it to a matrix, which we use for golfing.)



                                                                                                                                                             (,.'cat') , m
                                                                                                                                                          c
                                                                                                                                                          a
                                                                                                                                                          t
                                                                                                                                                          vwx
                                                                                                                                                          y
                                                                                                                                                          z


                                                                                                                                                          Now we can't just iterate this way of prepending a word as is, because then we'd only get vertical words. But if we transpose the output matrix between each step, then every other word will be horizontal.



                                                                                                                                                             (,.'dog') , |: (,.'cat') , m
                                                                                                                                                          d
                                                                                                                                                          o
                                                                                                                                                          g
                                                                                                                                                          catv
                                                                                                                                                          w
                                                                                                                                                          xyz


                                                                                                                                                          So our first attempt for a solution is to put each word into a single-column matrix, then fold these by appending and transposing between them.



                                                                                                                                                             > (,|:)&.>/ ,.&.>;: 'car house dog children'
                                                                                                                                                          c
                                                                                                                                                          a
                                                                                                                                                          r
                                                                                                                                                          housed
                                                                                                                                                          o
                                                                                                                                                          g
                                                                                                                                                          children


                                                                                                                                                          But there's a big problem with this. This puts the first letter of the next word before turning a right angle, but the specification requires turning before putting the first letter, so the output should be something like this instead:



                                                                                                                                                          c             
                                                                                                                                                          a
                                                                                                                                                          rhouse
                                                                                                                                                          d
                                                                                                                                                          o
                                                                                                                                                          gchildren


                                                                                                                                                          The way we achieve this is to reverse the entire input string, as in



                                                                                                                                                          nerdlihc god esuoh rac


                                                                                                                                                          then use the above procedure to build the zig-zag but turning only after the first letter of each word:



                                                                                                                                                          n     
                                                                                                                                                          e
                                                                                                                                                          r
                                                                                                                                                          d
                                                                                                                                                          l
                                                                                                                                                          i
                                                                                                                                                          h
                                                                                                                                                          c
                                                                                                                                                          gode
                                                                                                                                                          s
                                                                                                                                                          u
                                                                                                                                                          o
                                                                                                                                                          h
                                                                                                                                                          rac


                                                                                                                                                          Then flip the output:



                                                                                                                                                             [;.0> (,|:)&.>/ ,.&.>;:|. 'car house dog children'
                                                                                                                                                          car
                                                                                                                                                          h
                                                                                                                                                          o
                                                                                                                                                          u
                                                                                                                                                          s
                                                                                                                                                          edog
                                                                                                                                                          c
                                                                                                                                                          h
                                                                                                                                                          i
                                                                                                                                                          l
                                                                                                                                                          d
                                                                                                                                                          r
                                                                                                                                                          e
                                                                                                                                                          n


                                                                                                                                                          But now we have yet another problem. If the input has an odd number of words, then the output will have the first word vertical, whereas the specification says that the first word must be horizontal. To fix this, my solution pads the list of words to exactly 98 words, appending empty words, since that doesn't change the output.






                                                                                                                                                          share|improve this answer











                                                                                                                                                          $endgroup$




















                                                                                                                                                            1












                                                                                                                                                            $begingroup$

                                                                                                                                                            J, 35 33 bytes



                                                                                                                                                            3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y'


                                                                                                                                                            This is a verb that takes the input as a single string with the words separated by spaces. For example, you could call it like this:



                                                                                                                                                            3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y' 'programming puzzles and code golf'


                                                                                                                                                            The output is a matrix of letters and spaces, which the interpreter outputs with newlines as required. Each line will be padded with spaces so they have the exact same length.



                                                                                                                                                            There's one slight problem with the code: it won't work if the input has more than 98 words. If you want to allow a longer input, replace the _98 in the code by _998 to allow up to 998 words, etc.





                                                                                                                                                            Let me explain how this works through some examples.



                                                                                                                                                            Suppose we have a matrix of letters and spaces that we imagine is a partial output for some words, starting with a horizontal word.



                                                                                                                                                               [m=: 3 3$'vwx  y  z'
                                                                                                                                                            vwx
                                                                                                                                                            y
                                                                                                                                                            z


                                                                                                                                                            How could we prepend a new word before this, vertically? It's not hard: just turn the new word to a single-column matrix of letters with the verb ,., then append the output to that single-column matrix. (The verb ,. is convenient because it behaves as an identity function if you apply it to a matrix, which we use for golfing.)



                                                                                                                                                               (,.'cat') , m
                                                                                                                                                            c
                                                                                                                                                            a
                                                                                                                                                            t
                                                                                                                                                            vwx
                                                                                                                                                            y
                                                                                                                                                            z


                                                                                                                                                            Now we can't just iterate this way of prepending a word as is, because then we'd only get vertical words. But if we transpose the output matrix between each step, then every other word will be horizontal.



                                                                                                                                                               (,.'dog') , |: (,.'cat') , m
                                                                                                                                                            d
                                                                                                                                                            o
                                                                                                                                                            g
                                                                                                                                                            catv
                                                                                                                                                            w
                                                                                                                                                            xyz


                                                                                                                                                            So our first attempt for a solution is to put each word into a single-column matrix, then fold these by appending and transposing between them.



                                                                                                                                                               > (,|:)&.>/ ,.&.>;: 'car house dog children'
                                                                                                                                                            c
                                                                                                                                                            a
                                                                                                                                                            r
                                                                                                                                                            housed
                                                                                                                                                            o
                                                                                                                                                            g
                                                                                                                                                            children


                                                                                                                                                            But there's a big problem with this. This puts the first letter of the next word before turning a right angle, but the specification requires turning before putting the first letter, so the output should be something like this instead:



                                                                                                                                                            c             
                                                                                                                                                            a
                                                                                                                                                            rhouse
                                                                                                                                                            d
                                                                                                                                                            o
                                                                                                                                                            gchildren


                                                                                                                                                            The way we achieve this is to reverse the entire input string, as in



                                                                                                                                                            nerdlihc god esuoh rac


                                                                                                                                                            then use the above procedure to build the zig-zag but turning only after the first letter of each word:



                                                                                                                                                            n     
                                                                                                                                                            e
                                                                                                                                                            r
                                                                                                                                                            d
                                                                                                                                                            l
                                                                                                                                                            i
                                                                                                                                                            h
                                                                                                                                                            c
                                                                                                                                                            gode
                                                                                                                                                            s
                                                                                                                                                            u
                                                                                                                                                            o
                                                                                                                                                            h
                                                                                                                                                            rac


                                                                                                                                                            Then flip the output:



                                                                                                                                                               [;.0> (,|:)&.>/ ,.&.>;:|. 'car house dog children'
                                                                                                                                                            car
                                                                                                                                                            h
                                                                                                                                                            o
                                                                                                                                                            u
                                                                                                                                                            s
                                                                                                                                                            edog
                                                                                                                                                            c
                                                                                                                                                            h
                                                                                                                                                            i
                                                                                                                                                            l
                                                                                                                                                            d
                                                                                                                                                            r
                                                                                                                                                            e
                                                                                                                                                            n


                                                                                                                                                            But now we have yet another problem. If the input has an odd number of words, then the output will have the first word vertical, whereas the specification says that the first word must be horizontal. To fix this, my solution pads the list of words to exactly 98 words, appending empty words, since that doesn't change the output.






                                                                                                                                                            share|improve this answer











                                                                                                                                                            $endgroup$


















                                                                                                                                                              1












                                                                                                                                                              1








                                                                                                                                                              1





                                                                                                                                                              $begingroup$

                                                                                                                                                              J, 35 33 bytes



                                                                                                                                                              3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y'


                                                                                                                                                              This is a verb that takes the input as a single string with the words separated by spaces. For example, you could call it like this:



                                                                                                                                                              3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y' 'programming puzzles and code golf'


                                                                                                                                                              The output is a matrix of letters and spaces, which the interpreter outputs with newlines as required. Each line will be padded with spaces so they have the exact same length.



                                                                                                                                                              There's one slight problem with the code: it won't work if the input has more than 98 words. If you want to allow a longer input, replace the _98 in the code by _998 to allow up to 998 words, etc.





                                                                                                                                                              Let me explain how this works through some examples.



                                                                                                                                                              Suppose we have a matrix of letters and spaces that we imagine is a partial output for some words, starting with a horizontal word.



                                                                                                                                                                 [m=: 3 3$'vwx  y  z'
                                                                                                                                                              vwx
                                                                                                                                                              y
                                                                                                                                                              z


                                                                                                                                                              How could we prepend a new word before this, vertically? It's not hard: just turn the new word to a single-column matrix of letters with the verb ,., then append the output to that single-column matrix. (The verb ,. is convenient because it behaves as an identity function if you apply it to a matrix, which we use for golfing.)



                                                                                                                                                                 (,.'cat') , m
                                                                                                                                                              c
                                                                                                                                                              a
                                                                                                                                                              t
                                                                                                                                                              vwx
                                                                                                                                                              y
                                                                                                                                                              z


                                                                                                                                                              Now we can't just iterate this way of prepending a word as is, because then we'd only get vertical words. But if we transpose the output matrix between each step, then every other word will be horizontal.



                                                                                                                                                                 (,.'dog') , |: (,.'cat') , m
                                                                                                                                                              d
                                                                                                                                                              o
                                                                                                                                                              g
                                                                                                                                                              catv
                                                                                                                                                              w
                                                                                                                                                              xyz


                                                                                                                                                              So our first attempt for a solution is to put each word into a single-column matrix, then fold these by appending and transposing between them.



                                                                                                                                                                 > (,|:)&.>/ ,.&.>;: 'car house dog children'
                                                                                                                                                              c
                                                                                                                                                              a
                                                                                                                                                              r
                                                                                                                                                              housed
                                                                                                                                                              o
                                                                                                                                                              g
                                                                                                                                                              children


                                                                                                                                                              But there's a big problem with this. This puts the first letter of the next word before turning a right angle, but the specification requires turning before putting the first letter, so the output should be something like this instead:



                                                                                                                                                              c             
                                                                                                                                                              a
                                                                                                                                                              rhouse
                                                                                                                                                              d
                                                                                                                                                              o
                                                                                                                                                              gchildren


                                                                                                                                                              The way we achieve this is to reverse the entire input string, as in



                                                                                                                                                              nerdlihc god esuoh rac


                                                                                                                                                              then use the above procedure to build the zig-zag but turning only after the first letter of each word:



                                                                                                                                                              n     
                                                                                                                                                              e
                                                                                                                                                              r
                                                                                                                                                              d
                                                                                                                                                              l
                                                                                                                                                              i
                                                                                                                                                              h
                                                                                                                                                              c
                                                                                                                                                              gode
                                                                                                                                                              s
                                                                                                                                                              u
                                                                                                                                                              o
                                                                                                                                                              h
                                                                                                                                                              rac


                                                                                                                                                              Then flip the output:



                                                                                                                                                                 [;.0> (,|:)&.>/ ,.&.>;:|. 'car house dog children'
                                                                                                                                                              car
                                                                                                                                                              h
                                                                                                                                                              o
                                                                                                                                                              u
                                                                                                                                                              s
                                                                                                                                                              edog
                                                                                                                                                              c
                                                                                                                                                              h
                                                                                                                                                              i
                                                                                                                                                              l
                                                                                                                                                              d
                                                                                                                                                              r
                                                                                                                                                              e
                                                                                                                                                              n


                                                                                                                                                              But now we have yet another problem. If the input has an odd number of words, then the output will have the first word vertical, whereas the specification says that the first word must be horizontal. To fix this, my solution pads the list of words to exactly 98 words, appending empty words, since that doesn't change the output.






                                                                                                                                                              share|improve this answer











                                                                                                                                                              $endgroup$



                                                                                                                                                              J, 35 33 bytes



                                                                                                                                                              3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y'


                                                                                                                                                              This is a verb that takes the input as a single string with the words separated by spaces. For example, you could call it like this:



                                                                                                                                                              3 :'[;.0>(,|:)&:,.&.>/_98{.;:|.y' 'programming puzzles and code golf'


                                                                                                                                                              The output is a matrix of letters and spaces, which the interpreter outputs with newlines as required. Each line will be padded with spaces so they have the exact same length.



                                                                                                                                                              There's one slight problem with the code: it won't work if the input has more than 98 words. If you want to allow a longer input, replace the _98 in the code by _998 to allow up to 998 words, etc.





                                                                                                                                                              Let me explain how this works through some examples.



                                                                                                                                                              Suppose we have a matrix of letters and spaces that we imagine is a partial output for some words, starting with a horizontal word.



                                                                                                                                                                 [m=: 3 3$'vwx  y  z'
                                                                                                                                                              vwx
                                                                                                                                                              y
                                                                                                                                                              z


                                                                                                                                                              How could we prepend a new word before this, vertically? It's not hard: just turn the new word to a single-column matrix of letters with the verb ,., then append the output to that single-column matrix. (The verb ,. is convenient because it behaves as an identity function if you apply it to a matrix, which we use for golfing.)



                                                                                                                                                                 (,.'cat') , m
                                                                                                                                                              c
                                                                                                                                                              a
                                                                                                                                                              t
                                                                                                                                                              vwx
                                                                                                                                                              y
                                                                                                                                                              z


                                                                                                                                                              Now we can't just iterate this way of prepending a word as is, because then we'd only get vertical words. But if we transpose the output matrix between each step, then every other word will be horizontal.



                                                                                                                                                                 (,.'dog') , |: (,.'cat') , m
                                                                                                                                                              d
                                                                                                                                                              o
                                                                                                                                                              g
                                                                                                                                                              catv
                                                                                                                                                              w
                                                                                                                                                              xyz


                                                                                                                                                              So our first attempt for a solution is to put each word into a single-column matrix, then fold these by appending and transposing between them.



                                                                                                                                                                 > (,|:)&.>/ ,.&.>;: 'car house dog children'
                                                                                                                                                              c
                                                                                                                                                              a
                                                                                                                                                              r
                                                                                                                                                              housed
                                                                                                                                                              o
                                                                                                                                                              g
                                                                                                                                                              children


                                                                                                                                                              But there's a big problem with this. This puts the first letter of the next word before turning a right angle, but the specification requires turning before putting the first letter, so the output should be something like this instead:



                                                                                                                                                              c             
                                                                                                                                                              a
                                                                                                                                                              rhouse
                                                                                                                                                              d
                                                                                                                                                              o
                                                                                                                                                              gchildren


                                                                                                                                                              The way we achieve this is to reverse the entire input string, as in



                                                                                                                                                              nerdlihc god esuoh rac


                                                                                                                                                              then use the above procedure to build the zig-zag but turning only after the first letter of each word:



                                                                                                                                                              n     
                                                                                                                                                              e
                                                                                                                                                              r
                                                                                                                                                              d
                                                                                                                                                              l
                                                                                                                                                              i
                                                                                                                                                              h
                                                                                                                                                              c
                                                                                                                                                              gode
                                                                                                                                                              s
                                                                                                                                                              u
                                                                                                                                                              o
                                                                                                                                                              h
                                                                                                                                                              rac


                                                                                                                                                              Then flip the output:



                                                                                                                                                                 [;.0> (,|:)&.>/ ,.&.>;:|. 'car house dog children'
                                                                                                                                                              car
                                                                                                                                                              h
                                                                                                                                                              o
                                                                                                                                                              u
                                                                                                                                                              s
                                                                                                                                                              edog
                                                                                                                                                              c
                                                                                                                                                              h
                                                                                                                                                              i
                                                                                                                                                              l
                                                                                                                                                              d
                                                                                                                                                              r
                                                                                                                                                              e
                                                                                                                                                              n


                                                                                                                                                              But now we have yet another problem. If the input has an odd number of words, then the output will have the first word vertical, whereas the specification says that the first word must be horizontal. To fix this, my solution pads the list of words to exactly 98 words, appending empty words, since that doesn't change the output.







                                                                                                                                                              share|improve this answer














                                                                                                                                                              share|improve this answer



                                                                                                                                                              share|improve this answer








                                                                                                                                                              edited May 25 at 7:44

























                                                                                                                                                              answered May 24 at 21:47









                                                                                                                                                              b_jonasb_jonas

                                                                                                                                                              3412 silver badges10 bronze badges




                                                                                                                                                              3412 silver badges10 bronze badges

























                                                                                                                                                                  1 2
                                                                                                                                                                  next

















                                                                                                                                                                  draft saved

                                                                                                                                                                  draft discarded




















































                                                                                                                                                                  If this is an answer to a challenge…




                                                                                                                                                                  • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                                                                                                                                  • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                                                                                                                                    Explanations of your answer make it more interesting to read and are very much encouraged.


                                                                                                                                                                  • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.



                                                                                                                                                                  More generally…




                                                                                                                                                                  • …Please make sure to answer the question and provide sufficient detail.


                                                                                                                                                                  • …Avoid asking for help, clarification or responding to other answers (use comments instead).





                                                                                                                                                                  draft saved


                                                                                                                                                                  draft discarded














                                                                                                                                                                  StackExchange.ready(
                                                                                                                                                                  function () {
                                                                                                                                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f186005%2fconstruct-a-word-ladder%23new-answer', 'question_page');
                                                                                                                                                                  }
                                                                                                                                                                  );

                                                                                                                                                                  Post as a guest















                                                                                                                                                                  Required, but never shown





















































                                                                                                                                                                  Required, but never shown














                                                                                                                                                                  Required, but never shown












                                                                                                                                                                  Required, but never shown







                                                                                                                                                                  Required, but never shown

































                                                                                                                                                                  Required, but never shown














                                                                                                                                                                  Required, but never shown












                                                                                                                                                                  Required, but never shown







                                                                                                                                                                  Required, but never shown







                                                                                                                                                                  Popular posts from this blog

                                                                                                                                                                  Bruad Bilen | Luke uk diar | NawigatsjuunCommonskategorii: BruadCommonskategorii: RunstükenWikiquote: Bruad

                                                                                                                                                                  What is the offset in a seaplane's hull?

                                                                                                                                                                  Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029