[Question]
  [
# String Stairs
**Disclaimer:** This is the first challenge I propose. Any and all feedback is welcome. If this is a duplicate, please point it out.
[Here](https://codegolf.meta.stackexchange.com/a/13976/74163)'s a link to the sandbox post.
# Goal
The goal of this challenge is to, given a string and an integer, print the string into blocks of that integer's size. If a word has more characters than the size of a block, print it into a descending "stair" pattern.
# Rules
* The "stair pattern" mentioned above means that, for every block of a same word, that block must begin exactly where the block above it ends. Check the test cases (or ask) if you have any questions.
* If a word is broken in multiple blocks, the following word must be printed with an adequate number of spaces, that is, it must be separated from the preceding word's lowermost block by exactly one whitespace. Check the test cases (or ask) for clarification.
* You can assume the input string will consist only of printable ASCII characters. Also, it will not have multiple whitespaces in a row.
* You can also assume that the integer will always be in the range [1, +∞).
* Trailing whitespace or newlines are allowed.
* You can use [any reasonable method](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods) for I/O.
* [Standard Loopholes](https://codegolf.meta.stackexchange.com/q/1061/73111) apply.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code (in bytes, per language) wins. After a week (or so), I'll accept the overall shortest answer.
# Test Cases
```
(String, Integer) => (Output)
"This is a large string", 3 => Thi is a lar  str
                                 s        ge   ing
"This is an even larger string!", 2 => Th  is an ev  la   st
                                        is        en  rg   ri
                                                       er   ng
                                                             !
"Ooooh dear, what a big string you have!", 3 
=> Ooo  dea  wha a big str   you hav
     oh   r,   t         ing       e!
"Staphylococcus saprophyticus", 4 => Stap        sapr
                                        hylo        ophy
                                           cocc        ticu
                                              us          s
"I hope you find this challenge interesting", 2
=> I ho  yo fi  th  ch    in
      pe  u  nd  is  al    te
                      le    re
                       ng    st
                        e     in
                               g
"Well, this test case looks kinda pointless now doesn't it?", 15
=> Well, this test case looks kinda pointless now doesn't it?
"This one looks a lot more interesting!", 1 => T o l a l m i
                                               h n o   o o n
                                               i e o   t r t
                                               s   k     e e
                                                   s       r
                                                           e
                                                           s
                                                           t
                                                           i
                                                           n
                                                           g
                                                           !
"Keep in mind, people: 'Punctuation! Does! Matter!'", 2
=> Ke  in mi  pe   'P      Do  Ma
    ep     nd  op   un      es  tt
            ,   le   ct      !   er
                 :    ua          !'
                       ti
                        on
                         !
```
  
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 22 bytes
```
Ｆ⪪θ «↑⸿⸿ＦＬι«Ｍ¬﹪κＩη↙§ικ
```
[Try it online!](https://tio.run/##LY2xDoIwFEVn@IoXptcEFkecjC4kYEyMGwuBQhuaPiwP1Bi@vYK6npxzb60qV1NlvG/JAV4HoxnvMUQQCQHvMLg4bRnT27Cy0pUuEvsw@Lq5tB0r1D8vKGiWeCbGgprJEPYxHKuRUQkhYkhP9LC5bHnL/6MHzmwjn6jjXmx4CRfvM1A0SHjRBK22DbDSI9SqMma9k7B20smRte3CnU9mn4zmAw "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  θ                      First input
 ⪪                      Split on spaces
Ｆ   «                   Loop over each word
     ↑⸿⸿                Move the cursor to the top row and two columns right*
          ι             Current word
         Ｌ              Length
        Ｆ  «            Loop over implicit range
               κ        Current index
                 η      Second input
                Ｉ       Cast to integer
              ﹪         Modulo
             ¬          Logical not
            Ｍ     ↙     Move that many characters down and left
                    ι   Current word
                     κ  Current index
                   §    Index into word and implicitly print
```
\*More precisely, "move to the start of the next line twice, but as if the canvas was rotated." Edit: In between this challenge being set and this answer being accepted, Charcoal actually acquired a means of splitting a string into pairs of characters, reducing the code 16 bytes:  
`Ｆ⪪θ «↑⸿⸿Ｆ⪪ιＩη«κ↙` [Try it online!](https://tio.run/##TcuxCsIwFEDROfmKR6YE6uJYR10EBUHcuoT42gRDXkxiRaTfHlt0cL2ca6xOhrSvtacE8hy9K/LegAChFLw5OyUXimwvcW5d6pJQG87@rGtgq3ORVn39b7gtjB1pRNnu6BkO2JclTXyqdQ@WIsKLHtC7cIViXQZjtfcYBoT5x4S5uDDwdV2N/gM "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  θ                 First input
 ⪪                  Split on spaces
Ｆ   «               Loop over each word
     ↑⸿⸿            Move the cursor to the top row and two columns right
          ι         Current wordＩη
            η       Second input
           Ｉ        Cast to integer
         ⪪          Split into substrings of that length
        Ｆ    «      Loop over each substring
              κ     Print the substring
               ↙    Move the cursor down and left
```
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), ~~28~~ ~~27~~ 26 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
ā,θ{0Eā;{ēb÷eb‰⁴bH*+I;Iž}┼
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=JXUwMTAxJTJDJXUwM0I4JTdCMEUldTAxMDElM0IlN0IldTAxMTNiJUY3ZWIldTIwMzAldTIwNzRiSCorSSUzQkkldTAxN0UlN0QldTI1M0M_,inputs=SSUyMGhvcGUlMjB5b3UlMjBmaW5kJTIwdGhpcyUyMGNoYWxsZW5nZSUyMGludGVyZXN0aW5nJTBBMg__)
I did implement [`‰`](https://github.com/dzaima/SOGL/blob/811fe102f36968272be17f8fe3d6baaf7e4d527e/P5ParserV0_12/data/charDefs.txt#L489-L493) while making this, but the documentation for it existed before.
Explanation:
```
ā                            push an empty array - the main canvas
 ,                           push the first input
  θ{                         for each word (pushing the word each time)
    0E                         set the variable E to 0
      ā;                       below the current word place an empty array - current word canvas
        {               }      for each character of the word
         ēb÷                     push (E++ // B) - note that E is incremented after being used
            eb‰                  push E positive modulo B - like regular modulo but in the 0 output case it gives B
               ⁴                 duplicate the item below ToS
                bH               push B-1
                  *              multiply [(E++ // B) and B-1]
                   +             add [that multiplication to E‰B] - current letters X position
                    I            increase the X position to have one leading space row
                     ;           swap top 2 items - current X position and (E++ // B)
                      I          increase to create current letters Y position
                       ž         in those positions insert the current letter in the current words canvas
                         ┼     append to main canvas current word canvas horizontally
```
[Answer]
# Javascript ES6 , 187 183 174 166 163 148 145 143 141 140 138 bytes
* for readability added some bytes in the code and removed them in the bytes count
* instead of s="",j=0 i did j=s=""
* instead of for(i in s) - regular for loop - removed 1 byte
* using already generated values in the indexers of the arrays - removed 8 bytes
* using already with value i= s.length (from the first loop) in the eval - instead of the real array length - causes trailing space which are allowed
* using map of S instead of eval - reduces by 3 bytes
* using fill instead on initializing empty array- so there is not need for the loop in the map result
* could replace || with | - reduced by 2 bytes
* thanks to @Justin Mariner - replace occurrences ==" " with <"!" reduces 2 bytes
* moved the conditions from the a[I] to the other statement to reduces one " u<"!" " - reduces 2 bytes
* instead of (I+=2,j=0) - j=!(I+=2) - reduced 1 byte
* "for of" instead of for
```
F=(s,n)=>{R=[I=j=i=0]
for(u of s)
a=R[z=u<"!"?j=!(I+=2):(j%n&&I++,j++/n|0)]=R[z]||[...s].fill` `,a[I]=u
return R.map(x=>x.join``).join`
`}
console.log(F("This is a large string", 3));
console.log(F("This is an even larger string!", 2));
console.log(F("Ooooh dear, what a big string you have!", 3));
console.log(F("Staphylococcus saprophyticus", 4));
console.log(F("I hope you find this challenge interesting", 2));
console.log(F("Well, this test case looks kinda pointless now doesn't it?", 15));
console.log(F("This one looks a lot more interesting!", 1))
console.log(F("Keep in mind, people: 'Punctuation! Does! Matter!'", 2));
```
[Answer]
## C#, 200 bytes
```
int x=-2,y=0;Regex.Split(i,@"\s+").ToList().ForEach(w =>{y=0;Regex.Matches(w,".{0,"+s+"}").Cast<Match>().ToList().ForEach(c=>{x+=(y==0?2:s-1);Console.SetCursorPosition(x,y);Console.Write(c);y++;});});
```
Where the string is specified by **i** and the size is specified by **s**.
E.g.
```
string i = "Staphylococcus saprophyticus";
int s = 2;    
int x=-2,y=0;Regex.Split(i,@"\s+").ToList().ForEach(w =>{y=0;Regex.Matches(w,".{0,"+s+"}").Cast<Match>().ToList().ForEach(c=>{x+=(y==0?2:s-1);Console.SetCursorPosition(x,y);Console.Write(c);y++;});});
```
Basically, the first part **Regex.Split** uses white spaces to split the sentence into words, and the **Regex.Matches** splits each word into chunks specified by **s**. The chunk is written to Cursor position (x,y) where Y is set to 0 for every new word, and x is incremented by 2 for the first chunk of a word and subsequently (s-1) for each chunk.
x starts off it's life at -2 to ensure it's first use is set to 0.
I'm not knowledgable enough in C# trivia to be able to to make it smaller, but suspect it probably can be.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~203~~ 199 bytes
```
s,l=input()
S=s.split()
x=[]
for w in S:L=len(w);W=[i/l*~-l*' '+w[i:i+l]for i in range(0,L,l)];x+=[[c.ljust(L/l*~-l+L%l)for c in W+['']*len(s)]]
for l in zip(*x):
 L=' '.join(l)
 if L.strip():print L
```
[Try it online!](https://tio.run/##JY2xasMwFEV3f8VzoEiyVSe0m4O2blWhkCGD8GBcpX3hVRKSjN0O/XU3ItuFe8694Sd/efe0bUmSQhfmzEV1UqlLgbDkVZmhuvgIC6CDU68VWccXcTwrg3tq/h6pYcDaxWCPLQ0FxYLG0X1afpBakhiOa6uMmTq6zilzffda/UCi8FPhz61hbGjKehLD/ZNK8YuBN6voK9Dq9tRdPTpOogK8gO5Sjrde9CGiy6C3bfdqbSjeN7oPCcH6QLYH9j67Kc9jRu9qePE21fA25mxjzXYSnv8B "Python 2 – Try It Online")
[Answer]
## Perl 5, 59 bytes
**55 bytes code + 4 for `-ai`.**
```
$-=s/.{$^I}\K(?=.)/\x1b[1B\x1b[1D/g,print$_,"\x1b[1A"x$-,$"for@F
```
**Note: the `\x1b`s are literal `ESC` chars, but escaped here for easy copy and paste.**
This script utilises ANSI escape sequences and requires input via the `-i` flag which is non-standard. If either of these are not acceptable, please let me know and I'll updated.
### Example runs
```
perl -ai3 string-stairs.pl <<< 'This is a large string' 2>/dev/null
Thi is a lar  str   
  s        ge   ing
perl -ai2 string-stairs.pl <<< 'This is an even larger string!' 2>/dev/null
Th  is an ev  la   st   
 is        en  rg   ri
                er   ng
                      !
perl -ai3 string-stairs.pl <<< 'Ooooh dear, what a big string you have!' 2>/dev/null
Ooo  dea  wha a big str   you hav  
  oh   r,   t         ing       e!
perl -ai4 string-stairs.pl <<< 'Staphylococcus saprophyticus' 2>/dev/null
Stap        sapr       
   hylo        ophy
      cocc        ticu
         us          s
perl -ai2 string-stairs.pl <<< 'I hope you find this challenge interesting' 2>/dev/null
I ho  yo fi  th  ch    in     
   pe  u  nd  is  al    te
                   le    re
                    ng    st
                     e     in
                            g
perl -ai15 string-stairs.pl <<< "Well, this test case looks kinda pointless now doesn't it?" 2>/dev/null
Well, this test case looks kinda pointless now doesn't it? 
perl -ai1 string-stairs.pl <<< 'This one looks a lot more interesting!' 2>/dev/null
T o l a l m i 
h n o   o o n
i e o   t r t
s   k     e e
    s       r
            e
            s
            t
            i
            n
            g
            !
perl -ai2 string-stairs.pl <<< "Keep in mind, people: 'Punctuation! Does! Matter!'" 2>/dev/null
Ke  in mi  pe   'P       Do   Ma    
 ep     nd  op   un       es   tt
         ,   le   ct       !    er
              :    ua            !'
                    ti
                     on
                      !
```
]