[Question]
  [
*Inspired by [this](https://chat.stackexchange.com/transcript/message/49893872#49893872) chat mini-challenge.*
Given a string as input (ASCII printable characters only), output the string with the letters "raining" down. Each letter must be a random number of lines downward (random between `0` and the length of the string, each having non-zero probability), and only one character per column. All possible outputs must again have a non-zero probability of occurring.
That's maybe a little confusing, so here's an example (taken from that CMC):
```
Hello World
          d
H
       o
  llo
         l
      W
 e
        r
```
Note how the `H` is one space down, the `d` is zero down, and the `llo` all happen to line up. The `r` is the farthest down, at `9`, but is still less than the string length away from the top. This is just one example, there are dozens of other possibilities for input `Hello World`.
Other examples could be:
```
test
t
 e
  s
   t
PP&CG
  & G
 P
P  C
```
---
* Input and output can be given by [any convenient method](http://meta.codegolf.stackexchange.com/q/2447/42963).
* The input is guaranteed non-empty (i.e., you'll never receive `""` as input).
* You can print it to STDOUT or return it as a function result.
* Either a full program or a function are acceptable.
* Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately (e.g., feel free to pad as a rectangle).
* [Standard loopholes](http://meta.codegolf.stackexchange.com/q/1061/42963) are forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so all usual golfing rules apply, and the shortest code (in bytes) wins.
  
[Answer]
# [R](https://www.r-project.org/), 104 bytes
```
function(s){m=matrix(" ",l<-nchar(s),l)
m[cbind(1:l,sample(l,l,T))]=el(strsplit(s,""))
write(m,1,l,,"")}
```
[Try it online!](https://tio.run/##FcqxCsIwEIDhvU8RbpA7uA5dpZ0cXDu4SYcYEwzcxZJELIjPHuv6f39uwYy9aeGVXI3PhIU@OqmtOW4IBljGPrmHzTuwUKdXd4vpjsNRuFhdxaOw8IVombxgqbmsEisWBiDq3jlWj8rD/vzLtwWEeT4dzkDtBw "R – Try It Online")
Input as a string; writes to stdout.
[Answer]
# JavaScript (ES6), 72 bytes
Takes input as a list of characters. Returns a matrix of characters.
```
a=>a.map((_,y)=>a.map((c,x)=>Math.random()<.5|!a[y+1]?(a[x]=' ',c):' '))
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1i5RLzexQEMjXqdSE85J1qkAcnwTSzL0ihLzUvJzNTRt9ExrFBOjK7UNY@01EqMrYm3VFdR1kjWtgJSm5v/k/Lzi/JxUvZz8dI00jWg9PT11j9ScnHyF8PyinBT1WE1NLixKSlKLS3DJBQSoObuDJP8DAA "JavaScript (Node.js) – Try It Online")
[Answer]
# Pyth - 9 bytes
Outputs list of lines.
```
.tm+*;OlQ
 .t                       Transpose, padding with spaces
  m      (Q implicit)     Map over input
   +    (d implicit)      Concatenate to loop var
    *                     String repeat
     ;                    This refers to the var replaced by loop var, which is d=" "
     O                    Random number less than
      lQ                  Length of input
```
[Try it online](http://pyth.herokuapp.com/?code=.tm%2B%2a%3BOlQ&test_suite=1&test_suite_input=%22Hello+World%22%0A%22PP%26CG%22%0A%22test%22&debug=0).
[Answer]
# [J](http://jsoftware.com/), ~~30~~ 19 bytes
```
|:@,.]{.~"+_2-#?@##
```
[Try it online!](https://tio.run/##y/qvpKegnqZga6WgrqCjYKBgBcS6egrOQT5u/2usHHT0Yqv16pS04410le0dlJX/a3JZKloZKtjoaeubKVoZKKirc5Ukg7WXpBaXqFure6Tm5OQrhOcX5aQAeQEBas7u6lwaqckZ@Q4axgYq6rrqmkrx1mB@GoRS17VThwppqunZKZQk/wcA "J – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 8 bytes
*-1 byte from @Shaggy*
```
y_iUÊö ç
```
---
```
y_iUÊö ç        Full Program. Implicit input U
y_              transpose and map each row in U (Call it X)
  i             Insert at the beginning of X:
       ç        " " repeated ↓ many times
   UÊö          random integer in [0, length of U] 
                implicit transpose back and output
```
[Try it online!](https://tio.run/##y0osKPn/vzI@M/Rw1@FtCoeX//@v5JGak5OvEJ5flJOiBAA "Japt – Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 16 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Anonymous tacit prefix function
```
⍉∘↑⊢↑¨⍨∘-∘?≢⍴1+≢
```
`≢` length of string
`1+` one added to that
`≢⍴` "length" copies of that
`∘?` random integers in range 1…those, and then…
`∘-` negate, and then…
`⊢↑¨⍨` take than many elements from each character, padding on the left with spaces
`∘↑` mix list of strings into matrix, padding with spaces on the right
`⍉` transpose
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1Fv56OOGY/aJj7qWgQkD6141LsCKKALxPaPOhc96t1iqA2k/6c9apvwqLfvUd9UT/9HXc2H1huD9PRNDQ5yBpIhHp7B/9PUFTxSc3LyFcLzi3JS1Ll0dXW50hTUS1KLS@CcgAA1Z3d1AA "APL (Dyalog Unicode) – Try It Online")
[Answer]
# Julia, 69 bytes
```
f(s)=(n=length(s);z=fill(' ',n,n);for i=1:n z[rand(1:n),i]=s[i]end;z)
```
This defines a function `f` that accepts a `String` or `Vector{Char}` and returns a `Matrix{Char}`.
Ungolfed:
```
function f(s)
    n = length(s)
    z = fill(' ', n, n)  # an n×n matrix of spaces
    for i = 1:n
        # set a random entry in the ith column to the ith character in s
        z[rand(1:n),i] = s[i] 
    end
    z
end
```
Example:
```
julia> f("test")
4×4 Array{Char,2}:
 't'  ' '  ' '  ' '
 ' '  ' '  ' '  ' '
 ' '  'e'  ' '  't'
 ' '  ' '  's'  ' '
```
This could surely be better; my golfing skills are pretty rusty.
[Try it online!](https://tio.run/##TU4xCsMwDNzzCpGhscFL1gRPHdoxW4fgIRC7VRBysVMw/nzqJBQqENLp7jgtH8KpTdvmRJRasCbLz/VVQJ@1QyLRQKNYseydD4C67RjyGCaeRVmlQqPjiMby3Ge57ZoIGsb6bok8PHyguVZQrzau@xyGy/VWmwpKvQPySlyyDpiKz/3AEVYObRcxW5EUtCfxb1w8skgjqs7Iky1vVKW3Lw "Julia 1.0 – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 8 bytes
```
yÈùUÊö Ä
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=ecj5Vcr2IMQ&input=IkhlbGxvIFdvcmxkIg)
```
yÈùUÊö Ä     :Implicit input of string U
y            :Transpose
 È           :Pass each column through the following function and transpose back
  ù          :  Left pad with spaces to length
   UÊ        :    Length of U
     ö       :    Random number in the range [0,UÊ)
       Ä     :    Plus 1
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
³LŻX⁶x;)z⁶
```
[Try it online!](https://tio.run/##y0rNyan8///QZp@juyMeNW6rsNasAlL/D7dH/v/vAZTMVwjPL8pJUQQA "Jelly – Try It Online")
```
      )    | For each input character
³L         | Length of original input
  Ż        | 0..length
   X       | Random number from that list
    ⁶x     | That number of spaces
       ;   | Concatenate to the character
        z⁶ | Finally transpose with space as filler
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~59~~ ~~57~~ 55 bytes
```
->a{a.map{|c|s=[' ']*z=a.size;s[rand z]=c;s}.transpose}
```
[Try it online!](https://tio.run/##Fcw9DkAwGADQqzQGf4kegNTsBoamw6cqSGnTrwbF2YvxLc8dwxknFqsWLqAb2OuWNzKekUyUgQHFJagGuYN9JEEw2eBD/Se0BtUT7eGRTDzplNaG9MbpMaFyBofi3/K0Xs2yF/EF "Ruby – Try It Online")
Inputs 1D, outputs 2D array of characters.
[Answer]
# [PHP](https://php.net/), 88 bytes
```
for($o='';$i<$l=strlen($argn);$o[$i+$l*rand(0,$l)]=$argn[$i++]);echo chunk_split($o,$l);
```
[Try it online!](https://tio.run/##TY49C8IwEIb3/IobDpNqheKaFgcRHQS7OUgpoY2mGJqQxEn87TW1im539348Z5Ud8rVVlhAM0gcPBZwJAN1LrQ2cjNMtTcfDqE5TWc42O0oqTsjFOCkaxT5Z4QGFu/YJPKJRNspMewrlvqy3xwMfYoKhKSjl2OWoCx@clj2bYhzNGbsF6rkTfcuyFHVSFW9tvC@qhL9LG3Xvb7W3uguxbHTxAQC7@HzGv@QP8sf@ChFZO2mlCIwuabrKkj/Pc3gB "PHP – Try It Online")
Or **94 bytes** using PHP's [cryptographic random integers](https://www.php.net/manual/en/function.random-int.php) function.
```
for($o='';$i<$l=strlen($argn);$o[$i+$l*random_int(0,$l)]=$argn[$i++]);echo chunk_split($o,$l);
```
[Try it online!](https://tio.run/##TY8xb8IwEIV3/4obTtghqRSxmqgDQjAgNRsDiiIrmNrC2JbtTlV/e@oQEGx39753784rP64/vfKEYJIxRWjgRADoXhrj4OiCOdNqGkzqXLXtYrOjpOOEXFyQYlDs4RURUIRvW8BvBuWg3NxX0O7bfvt14GN2MHQNpRz1Gk0TUzDSstnG0Z1Ql2iWQdizu/XaJlZXaIquuROTWnYFv68e1I@99tEbnfLKieIjAOr8Qs2f@Y/g1wVPIQf3QXopEqMftFrVxRvzN/4D "PHP – Try It Online")
Input from `STDIN`, output to `STDOUT`. Run as:
```
$ echo Hello World|php -nF rain.php
   l  W    
  l        
 e      r d
H      o   
         l 
    o 
```
-1 byte (empty string instead of space) and +1 byte (err on side of rules) thx to @ASCII-only!
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~10~~ 9 bytes
```
↑Ｅθ◧ι⊕‽Ｌθ
```
[Try it online!](https://tio.run/##HcFRCoAgDADQ/07h5wK7QF2gwCCC6HvoSmHNEun6C3rPRyw@I6suJUmFfrutmfGGx5oFg6OjQrJmEl/oIqkUYEUJ@QJHctYIT/sbVEdizmbPhUOj3csf "Charcoal – Try It Online") Link is to verbose version of code. Edit: Saved 1 byte thanks to @ASCII-only. Explanation:
```
  θ         Input string
 Ｅ          Map over characters
        θ   Input string
       Ｌ    Length
      ‽     Random value
     ⊕      Incremented
    ι       Current character
   ◧        Padded to length
↑           Print rotated
```
As ASCII-only points out, you can move the letters randomly up instead of down for the same effect (except that there might be extra white space at the bottom rather than the top). Printing an array of characters upwards is equivalent to printing a string normally, so the padding then just offsets each character vertically by a random amount.
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/wiki/Commands), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
εIgÝΩú}ζ»
```
Input as a string or list of characters (either is fine).
[Try it online.](https://tio.run/##ASQA2/8wNWFiMWX//861SWfDnc6pw7p9zrbCu///SGVsbG8gV29ybGQ)
**Much slower 9-bytes alternative:**
```
gDÝsãΩúζ»
```
Input as a list of characters.
[Try it online.](https://tio.run/##MzBNTDJM/f8/3eXw3OLDi8@tPLzr3LZDu///j1byUNJRSgXiHCjOV4oFAA)
Both use the legacy version of 05AB1E, since the new version requires an explicit `€S` before the `ζ`..
**Explanation:**
```
ε       # Map each character in the (implicit) input to:
 Ig     #  Take the length of the input
   Ý    #  Create a list in the range [0, input-length]
    Ω   #  Pop and push a random integer from this list
     ú  #  Pad the current character with that many leading spaces
}ζ      # After the map: zip/transpose; swapping rows/columns (with space as default filler)
  »     # Then join all strings by newlines (and it output implicitly as result)
g          # Get the length of the (implicit) input-list
 D         # Duplicate this length
  Ý        # Create a list in the range [0, input-length]
   sã      # Take the cartesian product of this list that many times
     Ω     # Pop and push a random list from this list of lists of integers
      ú    # Pad the characters in the (implicit) input-list with that many spaces
       ζ   # Zip/transpose; swapping rows/columns (with space as default filler)
        »  # Then join all strings by newlines (and it output implicitly as result)
```
[Answer]
# [Perl 5](https://www.perl.org/) `-F`, ~~50~~ 49 bytes
*-1 by @DomHastings*
```
map$;[rand@F][$i++]=$_,@F;say map$_||' ',@$_ for@
```
[Try it online!](https://tio.run/##K0gtyjH9/z83sUDFOrooMS/FwS02WiVTWzvWViVex8HNujixUgEkG19To66gruOgEq@Qll/k8P@/R2pOTr5CeH5RTsq//IKSzPy84v@6vqZ6BoYG/3XdAA "Perl 5 – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~108~~ ~~102~~ 98 bytes
-4 bytes thanks to mazzy
```
$a=1..($z=($y=$args|% t*y).count)|%{random $z}
1..$z|%{-join($y|%{" $_"[$a[$i++%$z]-eq+$r]});$r++}
```
[Try it online!](https://tio.run/##DYvdCoMgAEbvfQqRr8hJQvuH4ZNEDNlqNVpu1hhZPrvz7nA4521@tR3buu8DGrUEaFVImcGpDLOCto9xTei0mbm8me8w8TVZrB7u5kXhPIktXFT503RDPCIyiisroUt0QiRwVV5/BGzl@QVWCB88ISkayortbp8ejqczC38 "PowerShell – Try It Online")
Basically iterates `1..length` of the string twice, once to get random line locations for each character, and a second time to actually build each line using those indices. Figuring out how to do it in one sweep is where the big byte savings are.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~131~~ 125 bytes
-6 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)
```
f(char*s){int l=strlen(s),R[l],i=l,j;for(srand(&l);i--;)R[i]=rand()%l;for(;++i<l*l;printf("\n%c"+!!j,i/l^R[j=i%l]?32:s[j]));}
```
[Try it online!](https://tio.run/##dY2xDoIwGIRneQoggfQHGhPdrMTBQUfC4oCYkAJa8ltIWyfCs1dg1vHuvrvj9Mm5tS3hr0pFGkYhjYupNgobSTQkeYFlIlJMOtb2imhVyZqECExQyiAvRJmuFgS4AiyOxREjZIOap1ri32XA/djzukRs8ZEXXSoCLE/73UEXXQnAJrt8vishCTijs5k71waxd2@9wtoH5g4fo5chSuksV8I02vyJsiw8X35kk/0C "C (gcc) – Try It Online")
[Answer]
# AWK, ~~120~~ 118 bytes
```
{while(i++<NF)r[i]=int(rand()*NF)+1;for(;l++<NF;j=k=0){while(k++<NF)if(r[k]==l){printf"%*c",k-j,$k;j=k}print FS}}
```
[Try it online!](https://tio.run/##SyzP/v/fydXd06/aLdhWSam2ujwjMydVI1Nb28bPTbMoOjPWNjOvRKMoMS9FQ1MLKKRtaJ2WX6RhnQNWYZ1lm21roAnVlQ3RlZmmURSdHWtrm6NZXVAE1J6mpKqVrKSTrZulo5IN0lILFlZwC66t/f/fIzUnJ18hPL8oJ@U/AA "AWK – Try It Online")
I've included the 5 bytes in the score for the necessary `-F ''` switch, but I had to use the `BEGIN{FS=""}` directive for the TIO link since it doesn't process the command-line switch properly.
[Answer]
# SmileBASIC 3, 62 bytes
```
LINPUT T$L=LEN(T$)CLS
FOR I=0TO L-1LOCATE,RND(L+1)?T$[I];
NEXT
```
[Answer]
# [Red](http://www.red-lang.org), 84 bytes
```
func[s][foreach n random collect[repeat n length? s[keep n]][print pad/left s/:n n]]
```
[Try it online!](https://tio.run/##XcqxDsIgFEbhnae4MrgZ9i4ODjo2roSBwI81Xi8EMH18rOnmGU@@ijjuiNap6iXmt2lAJMmrShON9JFgm7MpV/iwkNCuKGRmhG4rCnzfPkMefTlTsy@gkDhnS31Kp@KjYaROzUzy@yORvoE505orx4NWO9Snv7Ta5DwfL1c9vg "Red – Try It Online")
[Answer]
# Python - 92 bytes
```
import random
lambda s:map(None,*[(random.randrange(len(s))*' '+c).ljust(len(s))for c in s])
```
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 20 bytes
**Solution:**
```
+c$(-1-c?c:#x)$++x:
```
[Try it online!](https://tio.run/##y9bNz/7/XztZRUPXUDfZPtlKuUJTRVu7wkrJIzUnJ18hPL8oJ0WJ6/9/AA "K (oK) – Try It Online")
**Explanation:**
```
+c$(-1-c?c:#x)$++x: / the solution
                 x: / store input as x
                +   / flip (enlist)
               +    / flip again (break into chars)
              $     / pad (each) character
   (         )      / do this together
           #x       / length of x
         c:         / save as c
      -c?           / choose (?) c times from c
    -1              / subtract from -1
 c$                 / pad to length of x
+                   / flip
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~140~~ 131 bytes
```
from random import*
def f(s):
	e=range(len(s))
	p=[choice(e)for t in s]
	for r in e:print(''.join((r-p[i]and' 'or s[i]for i in e)))
```
[Try it online!](https://tio.run/##VY3BCsIwEETPzVcsuSQr6MVboV9Se5B2YyPpbtgGxK@PqZ48DW/mweR3WYWvtQaVDfTOS4u4ZdFyMgsFCH7H3nQ0tO1BPhG3Ak2Xh3FeJc7kCYMoFIgM@2S6A/QA6rNGLt65y1Mie6/nPMapXThwTdobHHL8yohYf75dKSWBl2habmzRhL/KYv0A "Python 3 – Try It Online")
[Answer]
# Python 3, 208 bytes
```
import random as r;x=input();R=range(len(x));c=[r.choice(R) for i in R];y=[' '*c[i]+x[i]+' '*(len(x)-c[i]) for i in R];R=range(len(y));print('\n'.join([''.join(r) for r in [[y[i][j] for i in R] for j in R]]))
```
Creates a list of random choices, then makes a list of columns with blank space everywhere except at the index specified by each random choice. The columns are transposed into rows and printed out with newlines between them.
[Try it online!](https://tio.run/##VYxBDsIgEEWvMq4Ajd24JFyiW2TRYLXT2IFMMSmnx2K7qJvJm5//X8xpCHQrBacYOAF39AgTdDOwXgxS/CSpdGvW/NXLd09yUUp7Y7nxQ0Dfy1bBMzAgIEHrdDZWgDh7i@6y1FO/fXit6X/9aM6rOTJSkuJOohkDkrRiB952XHfW5lVkR3dU/Xjc2ClVCndI@fQF) 
]