text:
La La Land... no wait, Moo Moo Moonlight
This challenge is a tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight!

Write a function/program that takes a string containing only letters [A-Za-z], the four symbols that are common in every day sentences  .,'? and spaces, and outputs the string in the style of La La Land.
To be more specific, take the letters up to, and including, the first vowel group, and print/output it twice adding a space each time, then print/output the whole string. y is a vowel in this challenge. Punctuation and capitalization should be kept.
You may assume that all strings contain at least one vowel, and that all strings start with a letter.
Test cases:
Land
La La Land

Moonlight
Moo Moo Moonlight

quEueIng
quEueI quEueI quEueIng

This isn't a single word.
Thi Thi This isn't a single word.

It's fun to play golf
I I It's fun to play golf

Ooo
Ooo Ooo Ooo

I'm okay
I I I'm okay

Hmm, no. There will be at least one vowel, but it can be anywhere.
Hmm, no Hmm, no Hmm, no. There will be at least one vowel, but it can be anywhere.

Why is y a vowel?
Why Why Why is y a vowel?

This is code-golf so the shortest code in each language wins. Explanations are encouraged, also in mainstream languages.

Test case for case insensitivity: MOONLIGHT. And just for fun: Why did the chicken cross the road?

Challenge sponsored by: National Stuttering Association

Or Prof. Quirrell

6th test case bought to you by Louis Prima and the Jungle Book. Joined just to add this (bad) pun.

Sed 30 bytes
s/[^aeiouy]*[aeiouy]\+/& & &/i

Could you use * instead of \+?

05AB1E, 23 19 18 bytes
Saved 1 byte thanks to Okx.
Dlð«žOsSåJTk>£D¹ðý

Try it online!
or as a Test suite
Explanation
 Dl                  # create a lowercase copy of implicit input
   ð«                # append a space
     žO              # push the vowels
       s             # swap lowercase input to the top of the stack
        S            # split into a list of chars
         å           # check each char for membership in the vowel-string
                     # (creates a list with 1 at the index of vowels and 0 for non-vowels)
          J          # join to string
           Tk        # find the index of 10
             >       # increment
              £      # take that many items from input
               D     # duplicate this string
                ¹    # push input
                 ðý  # join the strings by space

Jelly, 24 22 20 19 14 bytes
-5 bytes by utilising a trick from Emigna's brilliant answer (look for 10 in the isVowel list)
;⁶e€Øyw⁵ḣ@;⁶Ȯ;

Try it online! (not quite sure how to make a test suite for this full program)

15 byte alternative:
;⁶e€Øyw⁵ḣ@;⁶ẋ2;

Here is full test suite.
How?
;⁶e€Øyw⁵ḣ@;⁶Ȯ; - Main link: string s
 ⁶             - space character
;              - concatenate to s (for all vowel edge case)
    Øy         - vowels + y yield
  e€           - exists in? for €ach (gives a list of isVowel identifiers)
       ⁵       - 10
      w        - index of first sublist (with implicit decimalisation of 10 to [1,0])
        ḣ@     - head with reversed @rguments (start of word up to & including vowel group)
           ⁶   - space character
          ;    - concatenate (start of word up to & including vowel group plus a space)
            Ȯ  - print and yield (hence a full program...
               -     ...the alternative ẋ2 repeats instead in order to return the result)
             ; - join with the input, s
               - implicit print (of the second repetition and input string)

Python, 61 bytes
import re;lambda x:re.sub('(.*?[aeiouy]+)',r'\1 \1 \1',x,1,2)

Here comes the first non-regex-based language (using regex).
Saved 1 byte thanks to Neil.

JavaScript (ES6), 40 46
Edit 5+1 bytes saved thx @Arnauld
Overly long compared to other using the same trick (as usual)
x=>x.replace(/.*?[aeiouy]+/i,'$& $& $&')

let f=
x=>x.replace(/.*?[aeiouy]+/i,'$& $& $&')

test=`Land
La La Land

Moonlight
Moo Moo Moonlight

queueing
queuei queuei queueing

This isn't a single word.
Thi Thi This isn't a single word.

It's fun to play golf
I I It's fun to play golf

Ooo
Ooo Ooo Ooo

I'm okay
I I I'm okay

Hmm, no. There will be at least one vowel, but it can be anywhere.
Hmm, no Hmm, no Hmm, no. There will be at least one vowel, but it can be anywhere.`
test.split(`\n\n`).forEach(z=>{
  var [i,k]=z.split(`\n`),x=f(i);
  console.log(k==x ? 'OK':'KO',i+'\n'+x);
})

@Arnauld no, but I could use '$& $& $&' - I always forget the special dollar chars. Thank you. Unfortunately now it's really a port of Martin's retina answer.

The ^ is required in Retina which -- I think -- looks for all matches by default. But do we really need it here?

@Arnauld you're right again

-2: x=>(y=/.*?[aeiouy]+/i.exec(x)+' ')+y+x

@ETHproductions in fact. Thanks for noticing.

@nderscore welcome back. Good twist but you should post it yourself

@edc65 if you say so... it feels like an iteration of this solution though!

Retina, 24 bytes
i`^.*?[aeiouy]+
$& $& $&

Try it online!

Batch, 180 bytes
@echo off
set/ps=
set v=aeiouy
set g=c
set t=
:l
call set w=%%v:%s:~,1%=%%
if %v%==%w% goto %g%
set g=o
:c
set t=%t%%s:~,1%
set s=%s:~1%
goto l
:o
echo %t% %t% %t%%s%

Implements a state machine. g keeps track of whether we've ever seen a vowel, so if the current letter isn't a vowel we know whether to output or continue with the next letter.

PowerShell, 46 47 41 39 38 bytes
$args-replace"^.*?[aeiouy]+",(,'$&'*3)

Try it online!
Thanks to Maarten Bamelis for the bugfix
Saved 6 bytes thanks to Rynant
Saved 2 3 bytes thanks to Joey

Ruby, 31 32 30 Bytes
->s{(s[/.*?[aeiouy]+/i]+' ')*2+s}

Two bytes saved thanks to G B and Cyoce.

Javascript (ES6), 38 bytes
x=>(y=/.*?[aeiouy]+/i.exec(x)+' ')+y+x

f=
x=>(y=/.*?[aeiouy]+/i.exec(x)+' ')+y+x
<!-- snippet demo: -->
<input list=l oninput=console.log(f(this.value))>
<datalist id=l><option value=Land>
<option value=Moonlight>
<option value=queueing>
<option value="This isn't a single word.">
<option value="It's fun to play golf">
<option value=Ooo>
<option value="I'm okay.">
<option value="Hmm, no. There will be at least one vowel, but it can be anywhere.">
<option value="Why is y a vowel?">

Perl, 25 + 1 (-p flag)
s/.*?[aeiouy]+/$& $& $&/i

PHP, 55 54 bytes
Note: encoded version uses IBM-850 encoding.
echo preg_filter("/^(.*?[aeiouy]+)/i","$1 $1 $0",$argn);
echo preg_filter(~ðíÎÐı└ñ×ÜûÉèåóÈÍðû,~█╬▀█╬▀█¤,$argn);     # Encoded

Run like this:
echo "This isn't a single word." | php -nR 'echo preg_filter(~ðíÎÐı└ñ×ÜûÉèåóÈÍðû,~█╬▀█╬▀█¤,$argn);'

Explanation
Just a regex replace with non-eager matching any character at the start of the string, followed by any amount of vowels (use i option for case insensitivity). That capture group is then printed twice, followed by the entire string.
Tweaks

Saved a byte by using -R to make $argn available (Thx Titus)

Perl 6, 30 bytes
{S:i/.*?<[aeiouy]>+/{$/xx 3}/}

Try it online!

Interesting that this is the same length as {S:i/.*?<[aeiouy]>+/$/ $/ $//}

C, 202 196 195 193 190 180
i,j,k,m,n;f(char*a){if((a[i/12]-"AEIOUY"[i++%6])%32==0)k=n=24-(i%12);else if(k&&!n--){m=j=(i-13)/12;for(i=0;i<j*2;)printf("%c%c",a[i%j],(i==j-1)*32),i++;printf(" %s", a);}m?:f(a);}
Try it online!

Thing left to golf:
•Collapse two printf into one.
•Printing my space char can be changed into %*c logic I'm sure.
•I'm using conditionals which can be removed somehow
•j=(i-13)/12 can likely be shortened.
•[A-Y] conditional checks if ==0 which is usually un-necessary, though I'm currently stuck on that one (tried switching if-else and ditching the ==0 altogether but that requires adding more {brackets} and increase byte size)

Tricks I've used to golf this down:
•Combined a double for loop string search by using modulo for x-axis and integer-division for y-axis (input string vs vowel string). (X-axis is looped twice before iterating once on y-axis; the first time with [A-Z] and the second time with [a-z] using character value 32 differential.
•Bypassed having to use "[A-Y] and [a-y]" by just taking the distance between character sets and modulo 32. That way if the distance is 0 (A-A) or if the distance is 32 (a-A)
•Re-using integer variables that are no longer in use as boolean variables.
•Recursively calling a function with the same string to process through it and avoid a second for-loop.
•Set BOOL values to the logic of setting another variable. (e.g. bool = i=5;) to knock out both with one stone.
•Ternary empty-true exploit abuse. (GCC)

Readable Format:
i,j,k,m,n;
f(char*a){
    if((a[i/12]-"AEIOUY"[i++%6])%32==0)
        k=n=24-(i%12);
    else
        if(k&&!n--){
            m=j=(i-13)/12;
            i=0;
            for(;i<j*2;)
               printf("%c%c",a[i%j],(i==j-1)?32:0),i++;
            printf(" %s", a);
        }
    m?:f(a);
}

Knocked off 10 bytes thanks to Keyu Gan (in comments)

Note to self: j=(i-13)/12 can likely be shortened.

Am I missing something, or could you start with i=j=k=m=n=0;?

@RichardIrons the variables have to be declared first.

You may use i,j,k,m,n; for initialization.

@KeyuGan undefined behavior, not guaranteed to always be 0. (as far as I know?)

@AlbertRenshaw See https://stackoverflow.com/questions/6212921/is-un-initialized-integer-always-default-to-0-in-c

R, 49bytes
sub("(.*?[aeiouy]+)","\\1 \\1 \\1",scan(,""),T,T)
Regex based replace, match everything until not a vowel, capture and replace it by itself 3 times.
scan wait for a double type input, to tell it to use character type we have to give it two arguments, first is the default , emtpy string for stdin, and for the second the R evaluation allow to use only c as it's not ambiguous for character in this context.
T stands for TRUE and save some char as 4th and 5th parameter to sub to tell it to ignore case and use PCRE (the greedyness is not the same with R regex syntax)
4 bytes saved courtesy of Sumner18 along with the Tio link to running code

Python 3, 75 68 bytes
lambda s:(s[:[x in"aAeEiIoOuUyY"for x in s][1:].index(0)+1]+" ")*2+s

Try it online!
Explanation:
Works by generating a boolean value for every character in the input string based on whether or not it is a vowel, and finding the lowest index of 0, the first non-vowel (excluding the first character). It returns the substring to this index twice,separated by spaces, and the original string.

MATL, 33 bytes
'(^.*?[yY%s]+)'13Y2YD'$1 $1 $1'YX

Try it at MATL Online
Explanation
                % Implicitly grab input as a string
'(^.*?[yY%s]+)' % Push this string literal (regex pattern)
13Y2            % Push the string literal 'AEIUOaeiuo'
YD              % Replace the '%s' in the string with 'AEIUOaeiuo'
'$1 $1 $1'     % Push the string literal to use for replacement which repeats
                % the first match 3 times
YX              % Perform regular expression matching and replacement
                % Implicitly display the result

'(^.*?[yY%s]+)'13Y2YD'$1 '8:)YX saves 2 bytes

'(^.*?[%s]+)'19Y2YD'$1 '8:)YX saves another 2

@B.Mehta 19Y2 didn't exist when this answer was submitted unfortunately

Yeah, slightly expected that reply... I'll keep my comment so others can learn about inbuilt literal 'aeiouy' too.

@B.Mehta No worries. With MATL Online (matl.suever.net) you can select a specific version using the drop-down on the top right

V, 21, 20 bytes
é /ã[aeiouy]«“.
3ä|<

Try it online!
Explanation:
é               " Insert a space
  /             " Jump forward too...
   ã[aeiouy]«. "   The first non-vowel after a vowel
3ä              " Make three copies of
  |             " Everything from the cursor to the first character
   <            " Delete the space we inserted

Hexdump:
00000000: e920 2fe3 5b61 6569 6f75 795d ab93 2e0a  . /.[aeiouy]....
00000010: 33e4 7c3c                                3.|<

Alternate version (21 bytes):
Íã¨ƒ[aeiouy]«©/± ± &

Try it online!
This uses ridiculous regex compression, and it still manages to get it's butt kicked by the other golfing languages. For reference, this is about two/thirds the length of the regular "uncompressed" version, namely:
:%s/\v\c(.{-}[aeiou]).*/\1 \1 &

Explanation:
Í                               " Replace on every line:
 ã                              "   Case-insensitive
  ¨              ©              "   Capture-group 1
   <131>                        "   Any character, any number of times (non-greedy)
        [aeiouy]«               "   A vowel, repeated once or more
                  <129>         "   Followed by anything
                       /        " Replaced with:
                        ± ±     "   Capture group one twice, with spaces between
                            &   "   The whole matched pattern

Here is a hexdump:
00000000: cde3 a883 5b61 6569 6f75 795d aba9 812f  ....[aeiouy].../
00000010: b120 b120 26                             . . &

+1 This has got to be the most impressive V regex submission I ever saw

Try it online!

Clojure, 192 188 181 bytes
(fn[p](let[[f] p v #(#{\a \e \i \o \u \y}(Character/toLowerCase %))[q r](split-with(if(v f)v #(not(v %)))p)[w _](split-with v r)as #(apply str %)](str(as(repeat 2(str(as q)(as w) \ )))p)))

-4 bytes by inlining first-sp-pred (whoops).
-7 bytes by removing some missed spaces
This was far more challenging than I thought it would be going in! I'm manually parsing the string...since I still haven't gotten around to learning regex :/
See pre-golfed code for breakdown:
(defn repeat-prefix-cons [phrase]
  (let [[first-letter] phrase ; Get first letter

        ; Function that checks if a lowercased character is a part of the vowel set
        vowel? #(#{\a \e \i \o \u \y} (Character/toLowerCase %))

        ; cons(onant)? Negation of above
        cons? #(not (vowel? %))

        ; Decide how to split it depending on if the first character is a vowel
        first-sp-pred (if (vowel? first-letter) vowel? cons?)

        ; Split off the first chunk of cons/vowels
        [pre1 r] (split-with first-sp-pred phrase)

        ; Split off the rest of the vowels
        [pre2 r2] (split-with vowel? r)

        ; Shortcut function that turns a list into a string (Basically (join "" some-list-of-strings) )
        as #(apply str %)]

    (str ; ... then concat the prefix in front of the original phrase, and return
      (as ; ...then turn it back into a string since "repeat" returns a list... ^
        (repeat 2 ; ... then repeat it twice (shame Clojure doesn't have string multiplication)... ^
                (str (as pre1) (as pre2) \ ))) ; Concat the 2 prefix parts together with an space at the end... ^
      phrase)))

PHP, 69 65 53 bytes
<?=preg_filter("#.*?[aeiouy]+#i","$0 $0 $0",$argn,1);

requires PHP 5.3 or later. Run as pipe with -F or try some versions online.
Saved 4 bytes (and fixed the code) with regex stolen from @aross;
10 more with preg_filter instead of preg_match and -F
and another two with an improved regex.
75 81 bytes for a non-regex version:
for(;$c=$argn[$i++];)($k+=$k^!trim($c,aeiouyAEIOUY))>1?:$w.=$c;echo"$w $w $argn";

requires PHP 5 or later; replace ?: with ?1: for older PHP. Run with -nR
Breakdown
for(;$c=$argn[$i++];)       // loop $c through input characters
    ($k+=$k^!                   // 2. !$k and vowel or $k and not vowel: increment $k
        trim($c,aeiouyAEIOUY)   // 1. strip vowels -> vowel=false, non-vowel=true
    )>1                         // 3. if $k>1
    ?                           // do nothing
    :$w.=$c;                    // else append $c to $w
echo"$w $w $argn";          // output

Doesn't appear to work. Out put for This isn't a single word: T T This isn't a single word.

@aross seems it's checking just lowercase values? I may be wrong I don't know PHP that well

@AlbertRenshaw The regex version uses the i modifier that renders the regex case insensitive. The other one version did only check lowercase. Fixed.

Python 3, 101 96 bytes
s=input()
v=i=0
for c in s:
 w=c in'aAeEiIoOuUyY'
 if v*~-w:break
 v=w;i+=1
print(s[:i],s[:i],s)

Try it online!
a non-regex solution

Commented:
s=input()
a='aAeEiIoOuUyY'
v=i=0
for c in s:          # for each character in the string
 w=c in a            # w = True if the character is a vowel, else false
                     # true is equivalent to 1  and false to zero
                     # v*(w-1) evaluates only to true (-1 in this case) if v=1 (last character was a vowel) and w=0 (current character is not a vowel)
 if v*(w-1):break    # if so, break the loop
 v=w;i+=1            # increase the counter and set v to w
print(s[:i],s[:i],s)

Why do you need a? Replace w=c in a with w=c in'aAeEiIoOuUyY'

Ohm, 19 bytes (CP437)
≡┬üC▓αy_ε;TF«u├DQüj

Explanation:
≡┬üC▓αy_ε;TF«u├DQüj     Main wire, arguments: s

≡                       Triplicate input
 ┬üC                    Push input, all lowercase with concatenated space character
    ▓    ;              Map string into an array with...
     αy_ε                 Boolean: is element a vowel?
          TF«u          Find first occurrence of [true, false]
              ├D        Slice input up to that index and duplicate it
                Q       Reverse stack
                 üj     Join on spaces, implicitly print

I'm curious to know which features you implemented...?

@StewieGriffin Stack reversal (Q), subarray searching (u), string/array slicing (├), and vowel constants (αv and αy).

C, 123 bytes
#define v(x)while(x strchr("AEIOUY",*s&95))++s;
a;f(s,t)char*s,*t;{t=s;v(!)v()a=*s;*s=0;printf("%s %s ",t,t);*s=a;puts(t);}

Call as:
main(){char s[] = "queueing"; f(s);}

This is nice! You knocked my C solution out of the park lol.

Java 8, 147 140 bytes
Golfed:
import java.util.regex.*;s->{Matcher m=Pattern.compile("([^aeiouy]*[aeiouy]+)",2).matcher(s);m.find();return m.group()+" "+m.group()+" "+s;}

Ungolfed:
import java.util.regex.*;

public class LaLaLandNoWaitMooMooMoonlight {

  public static void main(String[] args) {
    for (String[] strings : new String[][] { { "Land", "La La Land" }, { "Moonlight", "Moo Moo Moonlight" },
        { "queueing", "queuei queuei queueing" }, { "This isn't a single word.", "Thi Thi This isn't a single word." },
        { "It's fun to play golf", "I I It's fun to play golf" }, { "Ooo", "Ooo Ooo Ooo" },
        { "I'm okay", "I I I'm okay" }, { "Hmm, no. There will be at least one vowel, but it can be anywhere.",
            "Hmm, no Hmm, no Hmm, no. There will be at least one vowel, but it can be anywhere." } }) {
      final String input = strings[0];
      final String expected = strings[1];
      final String actual = f(s -> {
        java.util.regex.Matcher m = java.util.regex.Pattern.compile("([^aeiouy]*[aeiouy]+)", 2).matcher(s);
        m.find();
        return m.group() + " " + m.group() + " " + s;
      } , input);
      System.out.println("Input:    " + input);
      System.out.println("Expected: " + expected);
      System.out.println("Actual:   " + actual);
      System.out.println();
    }

  }

  private static String f(java.util.function.Function<String, String> function, String input) {
    return function.apply(input);
  }
}

Note: the literal 2 in the code is the value of java.util.regex.Pattern.CASE_INSENSITIVE.

I think you can use import java.util.regex.*; to save some bytes.

@RomanGräf you are correct. I had the packages spelled out because in an earlier version of the code (did not work) it was shorter not to use imports. I did not reevaluate after fixing the code.

MATLAB / Octave, 58 51 bytes
7 Bytes saved thanks to @HughNolan
@(x)regexprep(x,'(^.*?[aeiouyAEIOUY]+)','$1 $1 $1')

Creates an anonymous function named ans which can be called by passing a string to it: ans('Land')
Online Demo
For MATLAB compatibility, $0 should be used in place of $1 in the above function.

Was thinking about this and then saw you had it done already.
Save a few bytes:
@(x)regexprep(x,'^.*?[aeiouyAEIOUY]+','$0 $0 $0 '); - also Matlab seems to use $0 rather than $1 strangely

@HughNolan Great point, thanks!

Python 3, 130 102 bytes
w=input();a='';v=0
for i in w:
	if i in 'aeiouyAEIOUY': v=1
	elif v:
		break
	a+=i
a+=' ';print(a*2+w)

Try it online!
Uses no function of any kind and no external libraries! (Unless print and input count as functions, which they do).
Works by seeing if it gets out of the consonants in the start of the title into the 'vowel zone'. If it is in the 'vowel zone' and detects a consonant, then it prints the title.
Saved 28 bytes thanks to  @LliwTelracs

Pyke, 22 bytes
l1~V\y+L{$0R+f2<ssDQdJ

Try it online!
This is 4 bytes longer than it should really be had I implemented a shorter way of getting vowels including y.

Retina, 24 bytes
i1`.*?[aeiouy]+
$0 $0 $0

Try it online

Quite similar to this

Yeah, I know. But I made the answer independently. Even so, it's been decided that duplicate answers are allowed, if the work is not plagiarized.

APL (Dyalog), 28 bytes
'(?i)^.*?[aeiouy]+'⎕R'& & &' or 29 chars: '^.*?[aeiouy]+'⎕R'& & &'⍠1
Simply a ((?i) or ⍠1) case-insensitive PCRE Replace of
^ the beginning
.*? zero or more characters (lazy)
[aeiouy]+ one or more vowels
with
& & & the entire match thrice with spaces inbetween

Version without RegEx, 43 bytes
⊢(↑,' ',↑,' ',⊢)⍨1⍳⍨1 0⍷'aeiouy'∊⍨' ',⍨819⌶
819⌶ lowercase
' ',⍨ append a space
'aeiouy'∊⍨ which letters are vowels
1 0⍷ vowels that are followed by a non-vowel
1⍳⍨ index of first one
⊢(…)⍨ apply the following tacit function with the string as right argument, and the above index as left argument
 ↑ that many characters taken from the string
 , followed by
 ↑ that many characters taken from the string
 , followed by
 ⊢ the string

C (gcc), 111 110 bytes
*d="AEIOUYaeiouy";b;f(char*a){b=strcspn(a,d);write(printf(" "),a,write(1,a,b+strspn(a+b,d)));printf(" %s",a);}

Try it online!
This just uses library functions strspn() and strcspn() and exploits the order in which gcc evaluates function parameters. Slightly less golfed
*d="AEIOUYaeiouy";b;
f(char*a){
  b=strcspn(a,d);
  write(printf(" "),a,write(1,a,b+strspn(a+b,d)));
  printf(" %s",a);
}

Thanks to @gastropner for -1.

Wow!!  Nice work!

105 bytes

Pyth - 24 bytes
jd[Ke:Q"^.*?[aeiou]+"1KQ

Test Suite.

I think you maybe forgot y?

C, 150 146 bytes
f(char*s){char*v="aeiouyAEIOUY",*p=strpbrk(s,v);int i=strspn(p,v),f=i+(p-s),d=0,j=2;while(j--)while(d<f)putchar(s[d++]);d=0,putchar(' ');puts(s);}

Ungolfed:
#include <stdio.h>
#include <string.h>

int main(void)
{
    char *s = "Land";  // change this

    char *p = strpbrk(s, "aeiouyAEIOUY");
    int count = strspn(p, "aeiouyAEIOUY");

    int idx = count + (p - s);

    int i, j = 2;

    while (j--)
    {
        while (i < idx)
            putchar(s[i++]);

        i = 0;
        putchar(' ');
    }

    puts(s);
}

How it works:

strpbrk finds the first vowel and returns a pointer p.
strspn finds how many vowels there are in a row in p and returns an integer count.
The index idx of the last vowel equals count (# of vowels) + p - s (index of first vowel).
Print the first idx characters in s, twice.

Python 3, 102 99 bytes
def l(s,v=0):
 for l in range(len(s)):
  if s[l]in"aeiouyAEIOUY":v=1
  elif v:return(s[:l]+" ")*2+s

Running on IDLE, so the Print/output part stands
>>> l("Land")
'La La Land'

Managed to shave off a space or two, and replace .lower() with simply adding uppercase vowels to the check.

Japt v2.0a0, 17 bytes
r/^.*?\y+/@[XXX]¸

Try it | Check all test cases

Explanation
                      :Implicit input of string
r/^.*?\y+/            :RegEx replace
                      :  ^ is required to save the extra bytes disabling the g flag
                      :  \y is the class for [AEIOUYaeiouy]
          @[XXX]      :An array containing three copies of the match
                ¸     :Joined to a string with spaces
                      :Implicit output of result

Jelly, 13 bytes
e€ØyIi-⁸ḣ;⁶Ȯ;

Try it online!
Full program.

Julia 0.6, 45 bytes
s->(match(r"^.*?[aeiouy]+"i,s).match*" ")^2*s

Try it online!
A pretty straightforward regex-based solution (for now at least). * is a concatenation operator when applied to strings, and ^ is a self-concatenation operator - "Moo "^2 == "Moo "*"Moo " == "Moo Moo ".

Java 8, 49 bytes
Lambda from String to String.
s->s.replaceAll("(?i)^(.*?[aeiouy]+)","$1 $1 $1")

Try It Online
The same regular expression approach many are using. (?i) turns on case insensitivity, the capture group is substituted for each $1 in the replacement string, and .*? is lazy so that it doesn't match vowels.

Vyxal r, 16 bytes
k∩c)M¯uḟ₌iẎ+:"JṄ

Try it online!
Explanation:
   )              # Lambda from the beginning of the line
k∩                #   Does "aeiouyAEIOUY"
  c               #   Contain the lambdas argument
    M             # Map that lambda over the input string returning a list of 1s and 0s (1 if a vowel and 0 if not)
     ¯            # Differences between each
      u           # Negative 1
       ḟ          # In the list of the differences, find the first index of that
                  # (this will be the length of the string to prepend twice (let's call that s), minus 1. Let's call that number l)
        ₌         # Apply the next two elements to the top of the stack
         i        #   Index; get the lth character from the input (0-indexed)
          Ẏ       #   Get the first l characters from the input
           +      # Add (r flag flips argument order).
                  # Now we have s, but found in a way that if l is -1 (i.e. -1 isn't in the deltas) s isn't just an empty string
            :     # Duplicate
             "    # Pair (resulting in [s, s])
              J   # Prepend (not append because of r flag) that to the input
               Ṅ  # Join by spaces

Thunno 2 J, 16 bytes
ð+k.s€ƇJTȮ⁺ɱð+ḌƤ

Try it online!
Explanation
ð+k.s€ƇJTȮ⁺ɱð+ḌƤ  # Implicit input
ð+                # Append a space to the input string
  k.s€Ƈ           # Check if each character is in the string "AEIOUYaeiouy"
       JTȮ⁺       # Find the first one-based index of [1, 0]
           ɱ      # Take this many characters from the start of the input
            ð+    # Append a space to this string
              ḌƤ  # Double it and append the input string
                  # Implicit output

SNOBOL4 (CSNOBOL4), 70 bytes
	T =INPUT
	T (ARB SPAN('AEIOUYaeiouy')) . X
	OUTPUT =X ' ' X ' ' T
END

Try it online!

Node.JS, 64 bytes
console.log(process.argv[2].replace(/.*?[aeiouy]+/i,"$& $& $&"))

just use a lambda function, it's shorter

C# (Visual C# Interactive Compiler), 79 75 bytes
Since it hasn't been posted yet...
f=>{var v=new Regex(".*?[aeiouyAEIOUY]+").Match(f).Value+" ";return v+v+f;}

Try it online!


text:
Print the Oscars Best Picture Winner
This challenge is in tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight!

Your challenge is to print the text La La Land pause one second, then change the text to show
La La Land MoonlightThe original text (La La Land) must have a strikethrough. This can be achieved either by clearing the screen, drawing on top of the original text, or by any other clever solutions.
This is a code-golf so lowest bytes wins. Standard code-golf rules apply.

Oh wow! My challenge was so well received it was posted on Twitter

I wonder if any languages can use the fact the La La La(nd) pattern

Python (137 Bytes)
from turtle import *;import time;write("La La Land");time.sleep(1);clearscreen();write("\u0336".join("La La Land ")+" Moonlight");done()

You don't need the space after the import. I would also suggest saving "La La Land" as a variable.

Vim, 37 bytes
3iLa <esc>snd<esc>gs:s/./&<C-v>u336/g
A Moonlight

A fairly straightforward solution.
Here is an animation of it running:

But there's no sleep :(

@Cruncher Yes there is! gs sleeps for one second.

Interesting, how do you typically run this? Because I typed this into vim and it works, but it loses the luster of the second delay (in my slow typing I didn't even notice the delay as I was copying from here)

Nevermind, I figured it out with macros. Very cool!

HTML, 153 148 bytes
Using CSS animation. Tested on Firefox and Chrome only.

<s>La La Land</s> <b>Moonlight<style>@keyframes l{0%{text-decoration:none}}@keyframes m{0%{opacity:0}}b,s{animation:m 0s 1s both}s{animation-name:l}

You can put one of the @keyframes declarations last and remove the two closing curly braces.

@darrylyeo: Firefox refuses to apply a rule if any of the } is missing, so unfortunately this cannot be done.

HTML + JavaScript, 18 + 59 = 77 bytes

setTimeout('O.innerHTML="<s>La La Land</s> Moonlight"',1e3)
<p id=O>La La Land

Sadly, there doesn't seem to be an efficient way to reuse O.innerHTML...

Would setTimeout('a=O.innerHTML;a=a.strike()+" Moonlight"',1e3) work?

@KritixiLithos I don't think so; modifying a there wouldn't modify O.innerHTML.

Octave, 81 66 bytes
15 bytes saved thanks to @Stewie
text(0,.5,'La La Land');pause(1);text(0,.5,'---------- Moonlight')

Online Demo Here.
While the demo shows two separate plots, when run in the desktop version of MATLAB, it shows the first plot, waits 1 second, and then adds the second string to the same plot.
Since Octave doesn't have support for strike through text, I have instead opted to display the text within an axes object in a figure and display a "strikethrough" by displaying '--------' on top of the initial text (initial idea by @Stewie). Previously, I had actually plotted a line object to strike through 'La La Land'

Nice approach... :) You can save 15 bytes like this: text(0,.5,'La La Land');pause(1);text(0,.5,'---------- Moonlight').

@StewieGriffin Thanks! Updated

Does Octave not let you do '-'*8+ in place of the dashes?

@QPaysTaxes Unfortunately it doesn't.

Darn. One more question: Why not draw it at (0, 0) or (1, 0)? Seems like either of those would save you a byte (no .)

@QPaysTaxes This is because the default axes limits are [0, 1] for both x and y and adding text doesn't automatically change them so it's shorter to plot it in the middle of the y axis rather than modifying the axes limits

Ah, that makes sense. Thanks!

So close... text(0,.5,k='La La Land');pause(1);text(0,.5,[~k+45,' Moonlight']) is the same length. [~(1:9)+45,' Moonlight'] is longer :(

Jelly, 31 bytes
“XSøjĠḌ⁻Ça»Œts⁵µṀȮ⁸œS“Æɓ9m“ɓm”ż

Tested with xterm and LANG=en_US. Doesn't work on TIO for several reasons.
Hexdump
00000000: 58 53 1d 6a c4 ad 8b 0e 61 fb 13 74 73 85 09 c8  XS.j....a..ts...
00000010: ca 88 1e 53 fe 0d 9b 39 6d fe 9b 6d ff f9        ...S...9m..m..

Verification

Background
This answer makes use of control characters and ANSI escape sequences.

0d (<CR>) is used to return to the beginning of the liner after printing La La Land.
9b 39 6d (<CSI> 9 m) is used to activate strike-through text before printing La La Land for the second time.
9b 6d (<CSI> m) is used to reset foreground and background to default mode, thus deactivating strike-through, before printing Moonlight.

How it works
“XSøjĠḌ⁻Ça»Œts⁵µṀȮ⁸œS“Æɓ9m“ɓm”ż Main link. No arguments.

“XSøjĠḌ⁻Ça»                     Index into Jelly's inbuilt dictionary to yield
                                "LA LA Land moonlight".
           Œt                   Convert to title case, yielding the string
                                "La La Land Moonlight".
             s⁵                 Split into chunks of length 10, yielding
                                A =: ["La La Land", " Moonlight"].
               µ                Begin a new chain with argument A.
                Ṁ               Take the maximum, yielding "La La Land".
                 Ȯ              Output; print "La La Land".
                  ⁸œS           Sleep for bool("La La Land") seconds and yield A.
                     “Æɓ9m“ɓm”ż Zip ["\r\x9b9m", "\x9bm"] with A, yielding
                                [["\r\x9b9m","La La Land"],["\x9bm"," Moonlight"]].
                                (implicit) Flatten and print.

Bash, 70, 69 66 bytes
-4 pts thanks to Riley
echo La La Land;sleep 1;echo -e "\r\e[9mLa La Land\e[0m Moonlight"
Credits to Sylvain Pineau's answer on AskUbuntu for the strikethrough

I think you can save a few bytes by using \r in the second echo instead of clear. Also, you don't need the space before the second echo.

This doesn't print the space after the striked out text.

Also, I think clear; should go first. And you have an unnecessary space in ; echo.

Shorter solution that adds the space after the striked text and does in-line modification of the printed text using ANSI code \e[A, so no clear is needed. For more info on that see me. s="La La Land";echo $s;sleep 1;echo -e "\e[A\e[9m$s\e[0m Moonlight"

Or echo -n La La Land;sleep 1;echo -e "\r\e[9mLa La Land\e[0mMoonlight"

@DigitalTrauma not as short, but very nice as well. Similar to what Riley was saying.

@DigitalTrauma why the -n

QBasic, 61 bytes
SCREEN 9
?"La La Land";
SLEEP 1
LINE(0,7)-(80,7)
?" Moonlight

Using graphics mode, draw an actual line through the text. Here's what it looks like in QB64:

The code should be pretty self-explanatory, but here's an ungolfed version:
SCREEN 9             ' One of several graphics modes
PRINT "La La Land";  ' The semicolon suppresses the trailing newline
SLEEP 1
LINE (0,7)-(80,7)
PRINT " Moonlight"

MATL, 46 bytes
'La La Land'tDlY.ttv45HY(`t@Y)' Moonlight'hXxDT

Since MATL doesn't have support for control codes or text formatting, this solution simply alternates between 'La La Land' and '-----------' as fast as possible to simulate strikethrough text.

Explanation
'La La Land'   % Push the string literal to the stack
tD             % Duplicate this string and display
tv             % Stack a version of this string on top of another
45HY(          % Replace the second one with '----------'
`              % Do...while loop
  t            % Duplicate the 2D character array
  @Y)          % Grab the row corresponding to the loop index (modular indexing)
  ' Moonlight' % Push the string literal to the stack
  h            % Horizontally concatenate the two
  Xx           % Clear the display
  D            % Display the string
  T            % Push a literal TRUE to the stack to make it an infinite loop

Creative! I like it

+1 for creativity, but not sure if it meets the rules.

Bash + pv, 50 bytes
printf ♪La\ La\ Land›%b 9m\\0 m\ Moonlight|pv -0L1

This builds on @DigitalTrauma's Bash answer.
♪ represents a carriage return (0x0d), › a CSI byte (0x9b).
Hexdump
0000000: 70 72 69 6e 74 66 20 0d 4c 61 5c 20 4c 61 5c 20  printf .La\ La\
0000010: 4c 61 6e 64 9b 25 62 20 39 6d 5c 5c 30 20 6d 5c  Land.%b 9m\\0 m\
0000020: 20 4d 6f 6f 6e 6c 69 67 68 74 7c 70 76 20 2d 30   Moonlight|pv -0
0000030: 4c 31                                            L1

Verification

How it works
printf repeats its format string as many times as needed to exhaust its other arguments. Since there is one occurrence of %b and two arguments (9m\\0 and m\ Moonlight), it will produce the following byte stream.
\rLa La Land\x9b9m\0\rLa La Land\x9bm Moonlight

This does the following.

\r brings the cursor to the start of the line.
La La Land is printed verbatim.
\x9b9m activates strike-through text.
\0 sets an end-of-line marker for pv -0.
\rLa La Land does the same as before.
\x9bm reset foreground and background to default mode, deactivating strike-through.
Moonlight is printed verbatim.

Finally, pv -0L1 prints one null-terminated line per second, introducing the desired delay.

Is it a coincidence that ♪ helped your golfing, or did you specifically want to use it with La La Land? I like it!

A carriage return is the shortest way to go back to the start of the line. The fact that it is stylized as ♪ sometimes is just a happy coincidence.

The use of pv instead of sleep like everyone else is beautiful.

@IQAndreas The idea to use pv is what I took from the linked Bash answer, so I can't really take credit for that.

Java 7, 207 206 171 139 bytes
void c()throws Exception{System.out.print("La La Land");Thread.sleep(1000);System.out.print("\rL̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight");}

I'm kinda cheating with this first answer, because I use strike-through unicode.
Explanation:
void c() throws Exception{         // Method (throws is necessary due to Thread.sleep)
  System.out.print("La La Land");  //  Show initial text
  Thread.sleep(1000);              //  Wait 1 second
  System.out.print("\r             //  Move 'cursor' to the start of the line so we can overwrite the current text
    L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight");        //  and print new text
}                                  // End of method

Java 7 (with AWT), 444 429 341 bytes
Crossed out 444 is still regular 444 ;(
import java.awt.*;import java.text.*;void m(){new Frame(){public void paint(Graphics g){g.drawString("La La Land",9,50);try{Thread.sleep(1000);}catch(Exception e){}AttributedString s=new AttributedString("La La Land Moonlight");s.addAttribute(java.awt.font.TextAttribute.STRIKETHROUGH,1>0,0,10);g.drawString(s.getIterator(),9,50);}}.show();}

Since Java console doesn't have any markup like strike-through, you'll have to use Java AWT. And well, if you thought Java Console was already verbose, then this is even worse (I know, I know, most of you couldn't even imagined Java 7 being any worse..)
Explanation:
import java.awt.*;                                         // import used for Frame and Graphics
import java.text.*;                                        // Import used for all AttributedStrings
void m(){                                                  // method
  new Frame(){                                             //  Frame
    public void paint(Graphics g){                         //   Overridden paint method
      g.drawString("La La Land", 9, 50);                   //    Show the initial text
      try{
        Thread.sleep(1000);                                //    Wait 1 second
      }catch(Exception e){}                                //    Thread.sleep requires a try-catch..
      AttributedString s
          = new AttributedString("La La Land Moonlight");  //    Object to add markup to text
      s.addAttribute(
        java.awt.font.TextAttribute.STRIKETHROUGH,         //    Strike-through attribute
        1>0,//true                                         //    Mandatory parameter before we can specify the length
        0, 10);                                            //    From length 0 to 10 (length of "La La Land")
      g.drawString(s.getIterator(), 9, 50);                //    Show this new text with strike-through part
    }                                                      //   End of paint method
  }.show();                                                //  Show Frame
}                                                          // End of method

Output gif:

I think you can remove the space in String[] a and use 1e3 instead of 1000

@KritixiLithos That space should indeed have been gone.. probably slipped by during golfing. As for 1e3, that's a double, and Thread.sleep expects a long. 1000 is shorter than (long)1e3. :)

You mean Swing, not Spring, don't you? I nearly had a heart-attack! Spring in a codegolf... Also, to save bytes, you can use AWT instead of Swing.

@OlivierGrégoire Ah, typo, I indeed meant Swing.. And thanks, AWT is shorter, no need for Swing (or Spring :P) at all.

You can write a function rather than a complete program unless the question specifies otherwise. Imports still count, however.

@Snowman I know. I made the one with AWT first, and that is a program because the class extends Frame. Because of that I decided to also make the 'cheating unicode' Console one a full program as well. It's not like Java is winning anything anyway if I'd make it a function instead of full program. :) But I'm indeed aware of function vs program ruling, and in all my other answers I use functions (unless otherwise specified by the OPs).

@KevinCruijssen I like golfing non-golf languages: the way I look at it, there are really two competitions. Java can certainly compete with C#, for example, and there is value for squeezing as many bytes out of the program as possible.

I made the AWT version a (Java 7) function with anonymous inner class. I removed the first AttributedString nonsense and golfed more for a total of 306 bytes. If you go Java 8, it's still 302 bytes. void m(){new Frame(){public void paint(Graphics g){g.drawString("La La Land",99,99);try{Thread.sleep(1000);}catch(Exception e){}AttributedString s=new AttributedString("La La Land Moonlight");s.addAttribute(java.awt.font.TextAttribute.STRIKETHROUGH,1>0,0,10);g.drawString(s.getIterator(),99,99);}}.show();}

And... I forgot the imports... import java.awt.*;import java.text.*; +37 bytes for them. Total = 343 bytes.

HTML + JavaScript, 10 + 63 = 73 bytes

setTimeout("document.write('<s>La La Land</s> Moonlight')",1e3)
La La Land

In what browser does this work?

@Titus I think all of them, but I've confirmed it working in Chrome + Firefox so far

Pyth - 47 bytes
Does the strikethrough thing now.

K"La La Land".d_1"\033c"+j"\u0336"K" Moonlight

It doesn't work; you need a " in front for +1.

@EriktheOutgolfer >_< don't know how that happened.

What's an <exmpty line>? I would suggest <pre> tags.

C 87 86 bytes
f(){char*s="La La Land";puts(s);printf("\e[9m%s\e[0m",s);sleep(1);puts(" Moonlight");}

Ungolfed version:
void f()
{
  char *s="La La Land";
  puts(s);
  printf("\e[9m%s\e[0m",s);
  sleep(1);
  puts(" Moonlight");

}

You don't need the space between char and *.

You also need to call f() in the ungolfed version, no?

@kennytm Thnaks for saving 1 byte.Updated.

@RodrigoHahn By default a code-golf answer can be a function or program, so no we don't need to call f().

GNU sed + sleep, 63 58 bytes
Edit: saved 5 bytes, based on Digital Trauma's comments
Waiting between two print statements can't be done using sed alone, and as such I call sleep 1. It is possible to do a system call from sed, using the e command, which is a GNU extension.
s:$:La La Land:p
esleep 1
s:.:&̶:g
s:.*:\c[[A& Moonlight:

To create strike-through text (line 3), a "combining long stroke overlay", U+0336, is appended to each character. After that, I move the cursor up 1 line, effectively replacing the old text when printing something new, using the so called ANSI Escape Sequences. These are interpreted by the terminal as special formatting commands. You can find more information about them here.

Explanation:
s:$:La La Land:p         # add "La La Land" to pattern space and print it
esleep 1                 # run system command 'sleep 1'
s:.:&̶:g                  # append U+0336 after each character (strike-through)
s:.*:\c[[A& Moonlight:   # '\c[[A' is '(escape)[A', ANSI code to move the cursor
                         #up 1 line. Then append ' Moonlight' and print on exit.

@DigitalTrauma Completely forgot about the \c, nice find! As for that special unicode, it's first time I hear about it, but it works indeed. When it is printed by this page, it is combined with the command s separator :, so a bit strange to see that at first.

PHP (86 75 69 Bytes)
La La Land<?=sleep(1)?:"\rL̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight";

Uses UTF-8 character U+0336 for the strikethrough.
Edit: Saved 17 bytes with the suggestions @Titus commented

sleep always returns 0; so you can just do sleep(1)?:" ̶L̶a̶ ̶L̶a̶ ̶L̶a̶n̶d̶ Moonlight" (-3 bytes). \r instead of \033[10D saves 6 bytes and including it in the final string saves another 4.

Oh, wow, each of those I should've been able to see, I guess it comes with practice. Thanks a lot! if you wanna make your own answer to get the rep, as its 11 bytes of improvement, I can delete my answer and upvote yours :)

No need to delete a valid answer. I don´t post my own when golfing others´ answers - unless the OP doesn´t react. Here are three more bytes: The leading blank is not required, neither is the strikethrough on the last blank. Using UTF-8 as charset is not cheating; but you could mention "uses UTF-8 character U+0336 for the strikethrough".

Oh and La La Land<?= instead of <?="La La Land", saves another 3 bytes.

HTML + JavaScript, 100 bytes
La La Land<script>setTimeout(function(){document.write("<s>La La Land</s> Moonlight")},1e3)</script>

setTimeout(function(){document.write("<s>La La Land</s> Moonlight")},1e3);
La La Land

How come document.write overwrites the existing text?

if your document is fully loaded then you are using document.write(like attaching with a event or with timeout) will delete all existing HTML.  refer = https://www.w3schools.com/jsref/met_doc_write.asp

Python 3, 90 bytes
Use Unicode (U+0336) to strike-through, because the macOS terminal doesn't support that \e[9m command.
import time
s='La La Land '
print(s,end='\r')
time.sleep(1)
print('̶'.join(s),'Moonlight')

Arduino, 332 331 bytes
Not competing, just for the fun.
#include<LiquidCrystal.h>
LiquidCrystal lcd(7,8,9,10,11,12);String a="La La Land";String b="-- -- ----";void setup(){lcd.begin(16,2);}void loop(){lcd.home();lcd.print(a);delay(1000);lcd.clear();lcd.print(b);lcd.setCursor(0,2);lcd.print("Moonlight");while(1){delay(150);lcd.home();lcd.print(a);delay(150);lcd.home();lcd.print(b);}}

Bill of Materials:

1 x Arduino Uno
1 x LCD 16 x 2
1 x 10K Potentiometer
1 x 180 ohm Resistor

Welcome to the site.  I don't know how similar Arduino is to C but I am pretty sure you can remove the space in your #include

By my calculations, the hardware costs 30 bytes (2 for the resistor, 3 for the potentiometer, 1 for its setting, 10 (up for change) for the LCD, and 14 for the wires (1 byte per wire)). However, this is only a suggestion. Also, TIO says the code is only 331 bytes. Is there a trailing newline?

@WheatWizard that's correct. fixed it!

Good point @CalculatorFeline, but in that case, we should also count the hardware costs of all the other answers. Possibly my setup is the cheapest one. :D

... D8 It's all over D8

Python3, 99 bytes
import time
l='La La Land'
s='\u0336'
print(l,end="\r")
time.sleep(1)
print(s.join(l)+' Moonlight')

If you set l = 'La La Land  couldn't you avoid the +s for -2 chars? .

@walpen I have to use it twice, that's why I stored it in s

SmileBASIC, 45 bytes
One less byte thanks to 12Me21's magic period trick.
As far as I'm aware SB doesn't have strikethrough characters, so I used GLINE instead. Obviously assumes a clear display, use ACLS if you need to.
?"La La Land
WAIT 60GLINE.,4,79,4?" Moonlight

Bash + pv, 62
l="La La Land"
printf "$l\0\r\e[9m$l\e[0m Moonlight"|pv -0qlL1

Swift, 392 bytes
Swift+UIKit is really not ideal for golfing! Run this in a XCode playground and the result will be shown in the preview pane.
import UIKit
import PlaygroundSupport
let l=UILabel(frame:CGRect(x:0,y:0,width:200,height:20))
l.textColor=UIColor.red
let m="La La Land"
let n=" Moonlight"
l.text=m
DispatchQueue.main.asyncAfter(deadline:.now()+1){
let a=NSMutableAttributedString(string:m+n)
a.addAttribute("NSStrikethrough",value:1,range:NSRange(location:0,length:10))
l.attributedText=a
}
PlaygroundPage.current.liveView=l

Is the l.textColor=UIColor.red necessary?

seems to default to black text on black background otherwise

AHK, 102 bytes
s=La La Land
Send,%s%
Sleep,1000
Send,^a{Del}
Loop,Parse,s
Send,%A_LoopField%{U+0336}
Send,` Moonlight

I cheated a bit to get strikethrough text by using the combining long stroke overlay unicode character. This may create an odd appearance depending on your setup. Notepad gives a good appearance.

AutoHotkey is clearly not the most efficient language for this but it was a fun challenge. Be careful where you run it because it doesn't create it's own display and wipes all the text of whatever window is active.

PHP, not competing (64 bytes)
<?=$s="\rLa La Land",sleep(1)?:wordwrap($s,1,--,1)," Moonlight";

uses UTF-8: -- stands for U+0336 - but I am pretty certain that it does not work standing alone.
If it does not, try ~"1I" or ~I1 instead of -- (+3 or +1 bytes).
No time to store it to a file or figure out how to set my console to UTF-8; so I couldn´t test either of these; but whoever can: please let me know wether this is complete BS or not.

Jelly, 41 bytes
“ñ[“m‘Ọj
“¡ṭḊßȥṡoẋ»¹13Ọ;9Ç¤;;0Ç¤;“"dE»œS1

Doesn't work on online interpreter.

Why not? Can compatibility be added cheaply?

@CalculatorFeline No, Dennis must implement control codes for it to work, and it's not his priority currently.

Can you give a screenshot/animated gif of the output?

@ʰᵈˑ I might do, although there is no guarantee. In the meantime, you can download the interpreter and test it yourself :)

TI-BASIC, 57 53 bytes
:" LA
:Text(3,4,Ans+Ans+Ans+"ND
:Pause "",1
:Line(-9,8,-2,8
:Text(3,41,"MOONLIGHT

Note that this uses the TI-84+ CE ability with the newest OS to pause for 1 second. This will return a synthax error on the TI-84+. For testing, you can omit the 1 second pause by removing that line. Also remember to press Zoom, 6 first so that you are on default window settings, otherwise the line command won't work.

SpecBAS - 58 bytes
1  ?"La La Land ";
2 WAIT 1e3
3 DRAW 0,4;80,0
4  ?"Moonlight"

Each character is 8x8 pixels, so draws a line from 0,4 to the relative position 80,4 (80 added to first coordinate and 0 to second so it stays on same line).

OIL, 76 bytes
↩⎋[9m
La La Land
⎋[0m Moonlight
4
1
10
20
4
14
10
9
20
6
5
4
0
4
1
4
2
89999

Replace the ⎋ with an escape character and ↩ with a carriage return. OIL lacks any kind of sleep command, so I emulate it using a loop that counts down from 89999 to 1. It takes about one second on my computer, but it may not on yours.
The first 3 lines are ignored by the interpreter, it then prints (4) the second line (line 1; "La La Land"). The following structure is the loop that decrements the large number at the end until it's equal to 1. In the end, I just print the first 3 lines.

Haskell 170 158 153 149 bytes
import System.Posix.Unistd
import System.IO
l="La La Land"
p=putStr
main=p l>>hFlush stdout>>usleep(10^6)>>p(('\b'<$l)++(l>>=(:"\822"))++"moonlight")

Lots of imports required for the flush and the delay. There's probably other golfing techniques I could implement. Works by appending \822 (the strikethrough modifier) to each character in l, then printing this followed by "moonlight".
Wow my first use of <$.

Powershell, 63 bytes
Works only in PowerShell ISE. Non-competing, since strikethrough is shifted by one char and I can't fix it.
'La La Land',('̶'*10+' Moonlight')|%{sleep 1;Write-Host $_ -N}

HTML + JS 6 + jQuery, 153 bytes
Longer than this answer due to the script tag but I anyway wanted to do it.

setTimeout('$("*").html`<s>La La Land</s> Moonlight`',1e3)
<script src=http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js></script>La La Land

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Minesweeper Wars
We've had problems to generate minesweeper games.
We've had problems to solve these minesweeper games.
Now...
It's time to battle other people on a minesweeper game!
Your program must be run in Java. Essentially, each player can do an action every turn.

You may move to any space touching yours including corners. The board does not wrap around.
You may place a mine in the spot you currently occupy, and then to any space touching yours including corners.
You may place a mine on any space adjacent to yours including corners.
You may defuse a mine on any space adjacent to yours including corners. This turn is wasted if you defuse an empty spot. (This turn does nothing if you try to defuse a spot with someone on it, but that doesn't need to be explicitly stated because there won't be a living bot on a mine...)
You may do nothing.

You must make your bot in a class that extends the class MineBot. MineBot looks like this:
public abstract class MineBot {
    private int x, y;

    public abstract int changeMines(int[][] field);

    public abstract int[] proceed(int[][] field);

    public final int getX() {
        return x;
    }

    public final void setX(int x) {
        this.x = x;
    }

    public final  int getY() {
        return y;
    }

    public final void setY(int y) {
        this.y = y;
    }
}

(You must keep the final methods as they are for your submission to be valid)
MineBot#changeMines(int[][]) is asked first. The result is a single int, representing whether or not you would like to perform an action involving a mine. This could be placing a mine, or defusing a mine. 0 means no, 1 means defuse, and 2 means place a mine. (2 or anything not 0 or 1)
Then, MineBot#proceed(int[][]) is executed. The following things happen in the following ordering:

First, bots that are defusing mines make their move. All spots that were targeted by defusers are now safe to move onto.
Next, bots that are placing mines make their move. Bots may not place a bomb on a spot that was just defused.
Finally, all other bots move. Spaces do not have a limit on bot count, so all bots that try to move are guaranteed to move.

Then, after the configurations have been updated, all bots occupying a spot with a mine on it will be eliminated (including those who stayed put and got a mine placed under them), and it will keep iterating.
On each iteration, the number of points increases. When a bot is eliminated, the number of points on the current iteration becomes its score.
During each test run, all n bots will be placed on an n+10 by n+10 board. On each run, the score for each bot will be recorded. The total score is the sum over n test runs. The winner will be constantly updated, so after there are at least 3 submissions or it has passed March 14th (Pi Day), I will accept an answer, but this can change at any time!
Input/Output Format
Input
The array given is an int[][]. The rightmost four bits (k & 15) represent how many mines are adjacent to that square (including corners). The fifth bit from the right ((k & 16) >> 4) is 1 if there is a bot there and 0 if there are none. Remember, the board doesn't wrap around.
Output
By "output" I actually mean what the functions return. Again, your bot's code will have two functions: int changeMines(int[][]), and int[] proceed(int[][]). Here's a detailed explanation for both of these:
int changeMines(int[][]) returns a single integer representing what type of move you want to perform next. Namely, return 0 if you want to move your location or idle, 1 if you want to defuse a mine, and 2 if you want to place a mine.
int[] proceed(int[][]) returns an array of length 1 or 2, depending on whether or not you want to stay idle. Let's say that the return value of this method is named int[] i. Then, i[0] represents what type of move you want to make according to the list at the top of the question. i[1] represents which on which space you want to perform the action, where applicable. This is not checked when you remain idle because it does not apply. Follow this table:
1: top-left
2: top
3: top-right
4: right
5: bottom-right
6: bottom
7: bottom-left
8: left

(You can only act within a 3x3 square centered on yourself.)
The game code can be found at my GitHub repo here. After downloading the code, it should be a valid eclipse project (run with Eclipse Neon.2). The source code is in /tree/master/MinesweeperKOTH/src. Change the source code in src/game/Game.java so that String[] botnames contains the name of all of the bots. I will be updating this every so often to save you some typing. Bots go in /src/programmed_bots, and must extend bot.MineBot. Your bot must not throw any exceptions, or it will die with score 0 (no invalid arguments will be given to your bot).
Rules

No using reflection of any sort!
No using Runtime to invoke processes on the system!
No reading the source file of anything using your bot!
You may read other people's programs, obviously. You may also specifically target a specific AI, but please do so in a respectful manner, also leading to my next point...
You may not attempt to invoke an instance of another bot and run its AI
Standard Loopholes Apply

Happy KOTH-ing!
Note: This question now exists on the sandbox to get more suggestions.

This conversation has been moved to chat.

@hyperneutrino I am not sure that your mine neighbour algorithm is working as intended. e.g. For a simple 3 mine in an L shape, your algorthim yields the following rows: 1,1,1,0 - 1,2,1,1 - 1,2,2,1 - 1,1,1,1 I would expect the following rows: 1,1,1,0 - 2,2,3,1 - 2,2,1,1 - 1,2,2,1 . Currently, your algorithm allows for trivial mine location logic in the fact no number > 2 is possible and the presence of 2 will mean that cell contains a mine.

@hyperneutrino your starting positions for bot algorithm causes index out of bounds exception when more than one bot is present

I'm voting this to be closed because there are too many flaws, and I now realize that the game's concept isn't very good; it's too easy to take advantage of the ever increasing number of flaws. (VTC as Unclear)

I suggest instead of having global view, have a view of the map for each bot's surrounding areas. This should allow for more interesting AI behaviour

@Moogie Thanks for the suggestion, I'll keep this sort of thing in mind for future KoTH challenges; however, I've decided to have this question closed (and it's been closed now), because it's too unclear. But thank you regardless!

TestBot
This submission is to help you determine what a valid submission might look like!
import bot.MineBot;

public class TestBot extends MineBot {
    public int changeMines(int[][] field) {
        return 2;
    }

    public int[] proceed(int[][] field) {
        return new int[] { 2, (int) (Math.random() * 8) };
    }
}

This bot just does a random-walk, placing mines as it goes. Usually backs onto its own track and commits suicide.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Pick a random number between 0 and n using a constant source of randomness
Task
Given a positive integer n less than 2^30 specified as input in any way you choose, your code should output a random integer between 0 and n, inclusive.  The number you generate should be chosen uniformly at random. That is each value from 0 to n must occur with equal probability (see Rules and Caveats).
Rules and Caveats
Your code can assume that any random number generator built into your language or standard library that claims to be uniformly random is in fact uniform. That is you don't have to worry about the quality of the random source you are using. However,

You do have to establish that if the random source you are using is uniform then your code correctly outputs a uniform random integer from 0 to n.
Any arguments when calling a built in or library random function must be constant. That is they must be completely independent of the input value.
Your code may terminate with probability 1 rather than being guaranteed to terminate.

Notes

randInt(0,n) is not valid as it takes the input as an argument to a builtin or library function.
rand()%n will not give a uniform random number in general.  As an example given by betseg, if intmax == 15 and n = 10, then you will be much more likely to get 0-5 than 6-10.
floor(randomfloat()*(n+1)) will also not give a uniform random number in general due to the finite number of different possible floating point values between 0 and 1.

How are you going to confirm that the output is uniformly random?  It may be that a given language / library will output uniformly random numbers, but manipulation could result in non-uniform output. (e.g. rng() provides 0-100, if n = 75, and function is rng()%75, then 0-25 will be more common...)

@Baldrickk By the wisdom of crowds :) We can only read the code and think about it.

The sad conclusion of asking the simplest possible probability-theory question: randomness and probability are very poorly understood. :( (And reading rules is hard, apparently.)

This comes to mind: Random Number

Why did you accept the x86 answer when there are three shorter ones?

May I point out that python defines random.uniform() as a + (b-a) * self.random(), So is floor(randomfloat()*(n+1)) valid???

x86 machines with rdrand instruction, 10 bytes
BITS 64

_try_again:

 rdrand eax
jnc _try_again

 cmp eax, edi
ja _try_again

 ret

machine code
0FC7F0 73FB 39F8 77F7 C3

The input is in the register rdi and the output in rax.
This respects the SYS V AMD64 ABI so the code effectively implement a C function
unsigned int foo(unsigned int max);

with 32-bit ints.
The instruction rdrand is described by Intel

RDRAND returns random numbers that are supplied by a cryptographically secure, deterministic random bit generator DRBG. The DRBG is designed to meet the NIST SP 800-90A standard.

Dealing with CSRNG it is implicit that the distribution is uniform, anyway, quoting the NIST SP 800-90A:

A random number is an instance of an unbiased random variable,
  that is, the output produced by a uniformly distributed random process.

The procedure generates a random number and if it is non-strictly greater than the input it is returned.
Otherwise, the process is reiterated.
Since eax is 32-bit, rdrand returns a number between 0 and 232-1, so for every n in [0, 232-1] the number of expected iterations is 232/(n+1) which is defined for all n in [0, 230).

Brilliantly low level. Thank you.

What's the jnc for?

@l4m2 rdrand sets the CF iif the data returned is valid. Data may be invalid because too many requests drained the entropy pool. See the manual entry for rdrand and this.

Jelly, 7 6 bytes
⁴!!X%‘

Thanks to @JonathanAllan for golfing off 1 byte!
Cannot be run on TIO because (16!)! is a huge number.
How it works
⁴!!X%‘  Main link. Argument: n

⁴       Set the return value to 16.
 !!     Compute (16!)!.
   X    Pseudo-randomly choose an integer between 1 and (16!)!.
        Since (16!)! is evenly divisible by any k ≤ 2**30, it is evenly divisible
        by n+1.
    %‘  Take the result modulo n+1.

This is a fixed version of my deleted answer, same idea. Although I did have an unnecessary exponentiation.

Sorry, I didn't look at it before posting.

Oh it doesn't matter, I wasn't planning fixing it anyway. I'm too uncomfortable with Jelly to really play around with it.

"Sir I don't know why you're mad. The algorithm is constant time. That's a good thing, right? Why is security and HR outside the door?"

@JonathanAllan Ugh, double factorial notation is weird... Thanks for the edit.

Agreed. Bit of a difference between an 8 digit number and a 417 quintillion digit number :p

Mathematica, 29 bytes
Based on Dennis's Jelly answer.
RandomInteger[2*^9!-1]~Mod~#&

I wouldn't recommend actually running this. 2e9! is a pretty big number...
It turns out to be shortest to generate a huge number that is divisible by all possible inputs and the map the result to the required range with a simple modulo.
Rejection Sampling, 34 bytes
My old approach that led to somewhat more interesting code:
13!//.x_/;x>#:>RandomInteger[13!]&

Basic rejection sampling. We initialise the output to 13! (which is larger than the maximum input 230) and then repeatedly replace it with a random integer between 0 and 13! as long as the value is bigger than the input.

Do you mean "smaller than or equal to the input" ?

@Lembik No. We want to regenerate the value as long as it doesn't fall into the desired range.

Oh I see.  For some reason I thought we were repeatedly sampling from the desired range. Thanks.

Remind me to add a time limit next time :)

Brachylog, 9 bytes
≥.∧13ḟṙ|↰

Try it online!
This uses 13! like in Martin Ender's answer (13ḟ is one byte less than 2^₃₀).
ṙ is implemented using random_between/3, which, when digging its source, uses random_float/0 which is linked to random/1 which uses the Mersenne Twister algorithm which is uniform for our purposes.
Explanation
≥.           Input ≥ Output
  ∧          And
   13ḟṙ      Output = rand(0, 13!)
       |     Else
        ↰    Call recursively with the same input

Prolog (SWI), 38 bytes
X*Y:-Z is 2^31,random(0,Z,Y),Y=<X;X*Y.

Works by rejection sampling.
Generate a random number between 0 and 2^31-1 = 2147483647 until one less than or equal to the input has been found.
I feel as if I should be able to use a cut instead of the else, but I can't see how.

You could avoid the else using repeat, but it ends up being 3 bytes longer… I'm not sure if there is a shorter way of having infinite choice points than repeat.

@Fatalize: Yeah I tried repeat as well. I had a memory of using something like ,!. to force a backtrack, but either I'm remembering it wrong or it's not applicable to this solution.

Labyrinth, 63 bytes
 ?
 #00}__""*_
 ;    #"  _
{-{=  } "><)
!{ : ;"({ +
@  }}:  >`#

(Thanks to @MartinEnder for help with some heavy golfing here.)
Labyrinth is a 2D language, and its only source of randomness is in a situation like the following:
   x
  "<)
 " "
 " "

Assume the instruction pointer is on the x and moving downwards. It next lands on the <, which if the top of stack is 0 (which is always the case in the actual program above) shifts the current row left by 1:
   "
 "<)
 " "
 " "

The instruction pointer is now on the < moving downwards. At a junction, Labyrinth turns based on the top of stack - negative is turn left, positive is turn right and zero is move forward. If the top of stack is still zero at this point, we can't move forward or backward since there's no path, so Labyrinth will randomise between turning left or turning right with equal probability.
Essentially what the program above does is use the randomness feature to generate 100-bit numbers (100 specified by #00 here) and continue looping until it generates a number <= n.
For testing, it'll probably help to use #0" instead for 10-bit numbers, with the " being a no-op path. Try it online!
Rough explanation:
 ?            <--- ? is input and starting point
 #0"}__""*_   <--- * here: first run is *0, after that is *2 to double
 ;    #"  _
{-{=  } "><)  <--- Randomness section, +0 or +1 depending on path.
!{ : ;"({ +        After <, the >s reset the row for the next inner loop.
@  }}:  >`#

 ^    ^
 |    |
 |    The " junction in this column checks whether the
 |    100-bit number has been generated, and if not then
 |    continue by turning right into }.
 |
 Minus sign junction here checks whether the generated number <= n.
 If so, head into the output area (! is output as num, @ is terminate).
 Otherwise, head up and do the outer loop all over again.

Python, 61 bytes
from random import*
lambda n,x=2.**30:int(randrange(x)*-~n/x)

Edit:
Updated to avoid forbidden form
Edit2:
Saved 2 bytes, thanks @JonathanAllan
Edit3:
Paid 2 bytes for a fully functional solution - thanks again @JonathanAllan
Edit4:
Removed f=, saving 2 bytes
Edit5:
Saved 1 more byte thanks to @JonathanAllan
Edit6:
Saved 2 more bytes thanks to @JonathanAllan
By now, git blame would point at me for the bad things, and JonathanAllan for the stuff that helps.
Edit7:
When it rains, it pours - another 2 bytes
Edit8:
And another 2 bytes

This wont ever output n, but you can save two bytes when you fix that by using from random import* and dropping the r..

Thanks for that - I guess I could spend those two bytes you saved me on making it possible to output n too (e.g. (1+n*1.0)/2**30)

Yes, you can use the "tadpole operator" to avoid the otherwise necessary parentheses, so ...*(-~n*1.0/2**30)) rather than ...*((n+1)*1.0/2**30))

Also you do not need to count the f= since you are not using recursion (unnamed functions are fine)

Really? Sweet! Do you have some long-standing grudge against the number 70? Thanks a lot for your help

Oooh, one more - you can remove the 0 from 1.0 :D

...you can just use randrange(2**30).

In fact randrange seems to accept a float, so lambda n,x=2.**30:int(randrange(x)*-~n/x) saves another two [edit...] four!

Jonathan, really my deepest thanks

^ another two in there with parentheses removal. Just goes to show your multiplication was the way to go!

Oh, unfortunately this actually has a bias to 0 due to the way it buckets, imperceivable as is, to see it change 2**30 to something small like 10. (e.g. this)

Bugger - related to the fact things are being rounded down when run through int(), I guess. And I have to thank you for taking it that deep....  Back to the drawing board/source of caffeine.

@NoOneIsHere thanks for your edits - and fixing the actual code.

Python 2, 61 bytes
from random import*
lambda n:map(randrange,range(1,2**31))[n]

Pseudo-randomly chooses integers between 0 and k for all values of k between 0 and 231 - 2, then takes the integer corresponding to k = n.

MATL, 12 bytes
Thanks to @AdmBorkBork and to @Suever for telling me how to disable TIO cache.
`30WYrqG>}2M

Try it online!.
This uses a rejection method: generate a random integer from 0 to 2^30-1, and repeat while it exceeds the input n. This is guaranteed to terminate with probability 1, but the average number of iterations is 2^30/n, and so it takes very long for n significantly smaller than 2^30.
`         % Do...while
  30W     %   Push 2^30
  Yr      %   Random integer from 1 to 2^30
  q       %   Subtract 1
  G>      %   Does it exceed the input? If so: next iteration. Else: exit
}         % Finally (execute right before exiting the loop)
  2M      %   Push the last generated integer
          % End (implicit). Display (implicit)

Bash (+coreutils), 44 bytes
/dev/urandom based solution
od -w4 -vtu4</d*/ur*|awk '($0=$2)<='$1|sed q

Will read unsigned 32 bit integers from /dev/urandom, and filter them out with awk until it finds one within a given range, then sed q will abort the pipe.

Hooray for bash :)

Batch, 64 bytes
@set/ar=%random%*32768+%random%
@if %r% gtr %1 %0 %1
@echo %r%

%random% only gives 15 bits of randomness, so I have to combine two random numbers. Loops until the random value lies within the desired range, so slow for low n; 98 bytes for a faster version:
@set/a"n=%1+1,m=~(3<<30)/n*n,r=%random%*32768+%random%
@if %r% geq %m% %0 %1
@cmd/cset/a%r%%%%n%

The code may be slow but your answer was fast!

@Lembik I had the answer ready to go in your deleted question...

Won't this echo the desired number first, and then all other numbers which turned to be larger than n?

@EriktheOutgolfer No; unless you use call, invoking a batch script terminates the current script.

PowerShell, 35 bytes
for(;($a=Random 1gb)-gt"$args"){}$a

Try it online!
Another rejection sampling method. This is an infinite for loop, setting the value of $a to be a Random integer between 0 and 1gb (= 1073741824 = 2^30), and keeps looping so long as that integer is -greaterthan the input $args. Once the loop is complete, we just put $a on the pipeline and output is implicit.
Note: This will take a long time if the input is a small number.

Haskell, 70 bytes
import System.Random
g n=head.filter(<=n).randomRs(0,2^30)<$>getStdGen

Not a very efficient algorithm but it works. It generates an infinite list of integers (or floats if needed, because of Haskell's type system) bounded by [0,2^30] and takes the first one less than or equal to n. For small n this can take a long time. The random numbers should be uniformly distributed, as specified in the documentation for randomR so all numbers in the interval [0,2^30] should have the same probability (1/(2^30+1)) therefore all the numbers in [0,n] have the same probability.
Alternate Version:
import System.Random
g n=head.filter(<=n).map abs.randoms<$>getStdGen

This version is terrible but it saves a whole byte. randoms uses an arbitrary range defined by the type to generate an infinite list of numbers. This may include negatives so we need to map it with abs to force them positive (or zero). This is extremely slow for any values of n that aren't absurdly large. EDIT: I realized later that this version isn't uniformly distributed because the probability of getting 0 is worse than the other numbers due to the use of abs. To produce some number m the generator could produce m or -m but in the case of 0 only 0 itself will work, therefore its probability is half of the other numbers.

Hooray for Haskell (too)!

Jelly, 9 bytes
⁴!Ẋ’>Ðḟ⁸Ṫ

Try it online! - code above wont run on TIO since a range of size 16! must be built first (not to mention the fact that they then need to be shuffled and then filtered!), so this is the same thing on a much smaller scale, repeated 30 times for an input of 3 with a bound of 10.
How?
⁴!Ẋ’>Ðḟ⁸Ṫ - Main link: n
⁴         - 16
 !        - factorial: 20922789888000
  Ẋ       - shuffle random: builds a list of the integers 1 through to 16! inclusive and
          - returns a random permutation via Python's random.shuffle (pretty resource hungry)
   ’      - decrement (vectorises - a whole pass of this huge list!)
     Ðḟ   - filter out if: (yep, yet another pass of this huge list!)
    >     -     greater than
       ⁸  -     left argument, n
        Ṫ - tail: return the rightmost remaining entry.

Note: it would be over a thousand time more efficient for the same byte-count if ȷ⁵ would do what one would naively expect and return ten to the ten, but that is not the case since the ⁵ is not evaluated as a literal ten to be used by the number literal ȷ... but rather two separate literals are parsed, ȷ with it's default exponent of three yielding one thousand, and ⁵ yielding ten.

Huh, thats 9 characters, but 22 bytes

@KristofferSall-Storgaard Each character is one of the 256 bytes in Jelly's code page, I forgot to make the word bytes a link like I usually do.

year, I looked it up and found out the same

JavaScript (ES6), 55 54 bytes
f=(n,m=1)=>m>n?(x=Math.random()*m|0)>n?f(n):x:f(n,m*2)

Generates integers in the range [0 ... 2k - 1], where k is the smallest integer such that 2k is greater than n. Repeats until the result falls into [0 ... n].
Why?
This is based on the following assumptions:

Internally, the pseudo-random integer values generated by the JS engine to feed Math.random() are uniform over any interval [0 ... 2k-1] (with k < 32).

Once multiplied by an exact power of 2, the IEEE 754 float values returned by Math.random() are still uniform over such intervals.

If anyone can confirm or refute these hypotheses, please let me know in the comments.
Demo
Generates 1 million values in [0 ... 2] and displays the outcome statistics.

f=(n,m=1)=>m>n?(x=Math.random()*m|0)>n?f(n):x:f(n,m*2)

for(i = 0, stat = []; i < 1000000; i++) {
  r = f(2);
  stat[r] = (stat[r] || 0) + 1;
}
console.log(stat.join` `)

Math.floor(Math.random()*(n+1)) produces a no less uniformly distributed  results for me, so it would be nice to see if there is any realistic N < 2^30, which will produce any distribution anomalies at all.

@zeppelin you'd need way too many trial runs to pinpoint any anomalies since a random float in that range will have one of 2^53 values which will be distributed as evenly as possible over the 2^30 outcomes. So even for large numbers in the range, the error will be something like 1 in 2^23 which means you'd need a ridiculous number of trials. You'll probably want a few more orders of magnitude than the number of initial samples (2^53). Nevertheless, it can't be perfectly uniform if the multiplier doesn't evenly divide the number of samples which is why Arnauld uses a power of two.

JDK 9 on jshell, 75 59 bytes
n->(new Random()).ints(0,1<<30).dropWhile(x->x>n).findAny()

Usage
((IntFunction)(n->(new Random()).ints(0,1<<30).dropWhile(x->x>n).findAny())).apply(<n>)

-16 bytes: Thanks Jakob!
Assumes that we consider jshell to be a valid runtime environment.
jshell itself, as a runtime environment, doesn't require explicit imports for core libraries and doesn't require semicolons.
Returns an OptionalInt. Rules don't specify that return type must be a primitive and I'm considering an OptionalInt to be a valid representation of the result.

Thanks to @kevin-cruijssen for the inspiration. My first code golf!

Whether or not boxed output is accepted is different from whether an Optional is accepted. I would confirm with the poster if I were you. Also, no need to count the whole assignment; just the lambda expression is sufficient.

You can save 4 bytes by removing parentheses around lambda parameter n and new Random().

Python 2, 72 69 bytes
-3 bytes thanks to xnor (override the id built-in as a variable)
from random import*
n=input()
while id>n:id=randrange(2**30)
print id

Try it online!
randrange(2**30) produces a pseudo-uniformly distributed number (Mersenne Twister 219937-1) from the range [0,230). Since n is guaranteed to be below 230 this can simply be called repeatedly until it is not greater than the input. It will take a long expected time for very low values of n, but usually works within the a  minute even for inputs as low as 50.

You can initialize r='' as "infinity". Or, better yet, don't initialize r and instead use id everywhere for r.

Java 8, 84 83 80 71 62 bytes
n->{int r;for(;(r=(int)(Math.random()*(1<<30)))>n;);return r;}

-1 byte thanks to @OliverGrégoire.
-3 bytes thanks to @Jakob.
-9 bytes converting Java 7 to Java 8.
-9 bytes by changing java.util.Random().nextInt(1<<30) to (int)(Math.random()*(1<<30)).
Explanation:
Try it here.
n->{        // Method with integer parameter and integer return-type
  int r;    //  Result-integer
  for(;(r=(int)(Math.random()*(1<<30)))>n;);
            //  Loop as long as the random integer is larger than the input
            //  (the random integer is in the range of 0 - 1,073,741,824 (2^30))
  return r; //  Return the random integer that is within specified range
}           // End method

NOTE: May obviously take very long for small inputs.
Example output:
407594936

@Aaron I questioned this as well but see the second bullet point: "Any arguments when calling a built in or library random function must be constant. That is they must be completely independent of the input value." This is the reason max int is used.

2^30 = 1073741824. You preferred to use -1>>>1 (= 2147483647). But this exists: 1<<30 which is exactly equals to 2^30; and is 1 byte shorter.

How about int c(int n){int r;for(;(r=new java.util.Random().nextInt(1<<30))>n;);return r;}?

@Jakob Thanks. I even shortened it by 18 more bytes by using Java 8 instead of 7, and using Math.random() instead of java.util.Random().nextInt.

PHP, 30 bytes
    while($argn<$n=rand());echo$n;

Run with echo <N> | php -Rn '<code>'.
picks a random number between 0 and getrandmax() (2**31-1 on my 64 bit machine);
repeats while that is larger than the input.
This may take a while ... my AMD C-50 (1 GHz) needed between 0.3 and 130 seconds for N=15.
A faster way for average N (46 bytes):
for(;++$i<$x=1+$argn;)$n+=rand()%$x;echo$n%$x;

or
for(;++$i<$x=1+$argn;$n%=$x)$n+=rand();echo$n;

takes N+1 random integers, sums them up and takes the modulo with N+1.
The C-50 needs approx. 8 seconds for 1 million runs.
An invalid solution for 19 bytes:
echo rand(0,$argn);

Python 3, 51 bytes
Here is a python solution with an unorthodox random source.
print(list(set(map(str,range(int(input())+1))))[0])

Try it online!
So to break this down.
int(input())+1

Gets the input number, and adds 1 to it.
set(range(...))

Creates the set {0, 1, 2, 3, 4, ... n} for all possible results.
print(list(...)[0])

Takes the set, converts it to list, and grabs the first item.
This works because in Python 3, the order of set() is established by PYTHONHASHSEED (can't be obtained but is established on script execution).
Admittedly, I am guessing that this is a uniform distribution, as the hash() value is randomly assigned and I am looking at randomly picking the value with a specific hash(), rather then just returning the hash(input()) itself.
If anyone knows whether this is a uniform distribution, or how I could test that, please comment.

Python 2, 89 bytes
l=range(2**31)
import random
random.shuffle(l)
n=input()
print filter(lambda x:x<=n,l)[0]

Explanation
L=range(2**31)      # Create a list from 0 to 2^31 exclusive. Call it <L>.
import random       # Import the module <random>.
random.shuffle(L)   # Use 'shuffle' function from <random> module,
                    # to shuffle the list <L>.
n=input()           # Take the input -> <n>.

print
    filter(         # Create a new sequence,
    lambda x:x<=n   # where each element is less than or equal to <n>.
    ,L)             # from the list <L>.
    [0]             # Take the first element.

This is very inefficient, as it creates 2^31 integers, shuffles and filters them.
I see no point in sharing a TIO link, where it's creating such large lists, so here is a TIO link for n = 100.
Try it online!

Perl 6, 29 bytes
{first 0..$_,^2**30 .roll(*)}

Inspired by Martin Ender's Mathematica solution.
Generates a lazy infinite sequence of random integers between 0 and 2^30-1, and takes the first one that is between 0 and the input.
Try it online!

05AB1E, 11 bytes
žIÝ.rDI›_Ï¤

Try it online!
Explanation
žIÝ          # push the inclusive range [0 ... 2^31]
   .r        # get a random permutation (pythons random.shuffle)
     D       # duplicate this list
      I      # push input
       ›_Ï   # keep only elements from the list not greater than input
          ¤  # take the last one

As the list [0 ... 2147483648] is too large for TIO, the link uses 1.000.000 instead.
Alternate (on average) much faster 11 byte solution
[žIÝ.RD¹›_#

Try it online
Explanation
[             # start loop
 žIÝ          # push the inclusive range [0 ... 2^31]
    .R        # pick a random integer (pythons random.chiose)
      D       # duplicate
       ¹      # push input
        ›_#   # break if random number is not greater than input
              # implicitly output top of stack (the random number)

žJL.R% for 6 unless I'm missing something huge. Push 2^32, list from 0 to 2^32, random pick. Modulo input. Will absolutely screw the efficiency that you have.

@carusocomputing.You'd need an I in there for 7 bytes to get the arguments for modulus in the right order (and maybe Ý instead of L), but otherwise that's certainly a shorter solution. I saw Dennis doing that in his Jelly answer, but as this was my first idea I kept this. As that approach is different from this you could post it as a separate answer.

DI‹Ï would avoid the loop.

Also, as-is, this is not guaranteed to terminate; if I'm not mistaken, an input of 0 would almost always result in a near-infinite loop, making it hard to terminate. Though the solution does allow for the possibility to terminate in all scenarios it isn't guaranteed due to randomness.

@carusocomputing: For very small input the second version would on average take a very long time to finish yes, but given enough time it would.

@carusocomputing the challenge says "Your code may terminate with probability 1 rather than being guaranteed to terminate." This submission satisfy that rule.

R, 37 bytes
which.min(sample(2^30)[0:scan()+1])-1

Takes n from stdin. First it generates a random sample of all the integers in the range, then selects the first n+1 values, finds the index of the minimum, and then subtracts one, to generate a number between 0 and n, inclusive. It won't run on TIO because it can't allocate an array of size 2^30 to sample from.
I'm fairly confident this is uniformly random.
Try it online!

rank(sample(2^10)[0:scan()+1])[1]-1...?

Python 3, 51 bytes
lambda n:randrange(1<<31)*n>>31;from random import*

Attempt this online! Includes a test suite.
Here is a proof that this is fair: https://arxiv.org/abs/1805.10941. It's also much faster than a typical modulo reduction because it's just a multiplication and a shift. (although this isn't as noticeable in Python...)
Uses an interesting approach, is O(1), and is the shortest Python answer yet!

This is cool! I think it needs to be a bit more complicated to implement the fully unbiased algorithm from the paper (algorithm 5). This version gets a very a slight bias from the fact that 2^32 doesn't evenly divide n (unless n is a power of 2), so while all the buckets it creates round to the same size, they can't possibly be exactly the same size. Like imagine creating a table of the output of this function for n=3 given every possible output of randrange. It can't contain an equal number of 0s, 1s, and 2s because the number of rows isn't a multiple of 3.

Fun fact: This Attempt This Online! link is the only one on all of Code Golf, that was encoded with a v0 schema :). That version of ATO links was only live for two days, so it's probably the only one anywhere. (https://github.com/attempt-this-online/attempt-this-online/commit/820c0743c39644e14b3c94725c4b53c32bc19ac7)

SmileBASIC, 38 bytes
INPUT N@L
R=RND(1<<30)ON N<=R GOTO@L?R

Generates random numbers until it gets one that is smaller than the input.

Golang, 84 78 71 bytes
import."math/rand"
func R(n int)int{q:=n+1;for;q>=n;q=Int(){};return q}

Simple rejection sampling.
Note: since the math/rand seed is a constant 1, the caller must seed unless a constant result is desired.
Test: https://play.golang.org/p/FBB4LKXo1r
No longer practically testable on a 64-bit system, since it's returning 64-bit randomness and using rejection testing.
package main

import "fmt"
import "time"

/* solution here *//* end solution */

func main() {
    Seed(time.Now().Unix())
    fmt.Println(R(1073741823))
}

if you use import."math/rand" then Int31 is available in the global namespace and you can save 4 bytes, also intis guaranteed to be at least 32 bits, saving you another 6 bytes

Use := syntax for another 3 bytes

Using int instead of int32 doesn't save any bytes since we need to cast the result of Int31() - 3int + () = 11 bytes versus 2int32 = 10 bytes.

No need to cast, there is an Int() function in the rand package, also, you can remove the space after import

C#, 57 bytes
n=>{int x=n+1;while(x>n)x=new Random().Next();return x;};

Anonymous function which returns an integer between 0 and n inclusive.
The smaller the input number, the longer the time to return a random value.
Full program:
using System;

class RandomNumber
{
    static void Main()
    {
        Func<int, int> f =
        n=>{int x=n+1;while(x>n)x=new Random().Next();return x;};

        // example
        Console.WriteLine(f(100000));
    }
}

"Any arguments when calling a built in or library random function must be constant. That is they must be completely independent of the input value." The argument to Next is not static.

Ruby, 23 15 23 32 29 bytes
->n{1while n<q=rand(2**30);q}

How it works:

1while [...]; executes the statement at least once: 1 before while acts as a nop
Get a random number in the range 0..2^30-1 (lower than 2^30, as specified)
Repeat if the number is higher than the input parameter (Could take some time when n is small)

Go, 63 61 bytes
import."math/rand"
var n=0;func R(){q:=n;for;q<n+1;n=Int(){}}

Use it like this:
func main() {
    n = 5000
    R()
    print(n)
}

Test it live at the go playground

Per our defaults, taking input from predefined variables and writing the output to predefined variables are not allowed. You could use pointers to global variables though

Ohm, 26 bytes
IΩ
D31º#╬D0[>?D-+∞;,

Explanation:
IΩ                 ■Main wire
IΩ                 ■Call wire below

D31º#╬D0[>?D-+∞;,  ■"Real main" wire
D                  ■Duplicate input
 31º#╬D            ■Push random_int in [0..2^31] twice
       0[          ■Push input again
         >?    ;   ■If(random_int > input){
           D-+     ■  remove the random_int
              ∞    ■  recursion
               ;   ■}
                ,  ■Print random_int

Is there an interpreter for this language? And what about Code-page?

@ATaco: Interpreter, Code-page: CP-437

Braingolf, 16 bytes
Uv2.# ,-^r[R>v]R

Try it online!
Takes longer than 60 seconds on TIO, but will terminate in a finite amount of time
Explanation
Uv2.# ,-^r[R>v]R  Implicit input from commandline args
U                 Pop top of stack and push range 0...n
 v                Switch to stack 2
  2.              Push two 2s
    #<space>      Push 32 (codepoint of space)
      ,           Swap top 2 items on stack
       -          Subtract top of stack from 2nd to top
        ^         Raise 2nd to top of stack to top of stack
                  This whole bit makes 2^30 on the 2nd stack
         r        Pops top of stack and pushes a random integer <= to popped item
                  This uses Python3's randrange, between 0 and the popped item
          [...]   While loop runs X times where X is the previously generated random number
           R>     Move top of stack1 to bottom of stack1
             v    Switch back to stack2 for loop counting
               R  Switch back to stack1 for implicit output
                  Implicit output of top of stack

So in short, this generates range [0...n], then generates a random number less than or equal (<=) to 2^30, it then rotates the range that number of times, and outputs the top of the stack at the end.

CBL(not COBOL), 4 5 bytes
CBL is a 2d array-based language that I am working on. It has no interpreter (yet), but I plan to make one soon. The code that I have created may not be up to date with the current progress on the language, but I will try. I will also explain the code.
CBL has gone through some major changes recently. This is the updated version.
’0’ſr
A breakdown of this is as follows:
'0'ſr

'0'   «--numeric literal 0
   ſ  «--previous value (not the 0. it is the value from the previous link
    r «--random function takes the first two as input

This should solve the problem with rule no.2
As long as the interpreter uses uniform randomness (which it will), this should count. If you have any questions or suggestions, leave a comment.

Welcome to Code Golf! This looks like a really neat language. I have a bounty for +100 for interesting new languages, so when you finish the interpreter let me know!

@RedwolfPrograms I may not get started on the interpreter until late June.

From your explanation, it seems as if the r function is using two arguments, 0 and , (the input), to pick a random number in that range.  If so, this unfortunately contravenes rule 2 of the challenge.

MMIX, 36 bytes (9 instrs)
Obvious rejection sampling method (Java version).
Assumes TRAP 82,78,71 gets a randomly generated uint64_t from the OS.
(jxd)
00000000: 36010000 f7010000 00524e47 1e02ff00  6¢¡¡ẋ¢¡¡¡RNGœ£”¡
00000010: fe020006 26ffff02 32ffff01 45fffffb  “£¡©&””£2””¢E””»
00000020: f8030000                             ẏ¤¡¡

Disassembly:
rndr    NEGU $1,0,$0        // y = 2^64 - n
        PUT  rD,0
0H      TRAP 82,78,71       // loop: tmp = sysrand()
        DIVU $2,$255,$0
        GET  $2,rR          // z = tmp % n
        SUBU $255,$255,$2   // tmp -= z
        CMPU $255,$255,$1
        BP   $255,0B        // if(tmp > y) goto loop
        POP  3,0            // return n

Bonus: version from https://arxiv.org/pdf/1805.10941.pdf (except that we always calculate the remainder):
00000000: f7010001 e3010000 1e010100 fe010006  ẋ¢¡¢ẉ¢¡¡œ¢¢¡“¢¡©
00000010: 00524e47 1aff00ff 32ffff01 41fffffd  ¡RNGȷ”¡”2””¢A””’
00000020: fe000003 f8010000                    “¡¡¤ẏ¢¡¡

rndr    PUT  rD,1
        SET  $1,0
        DIVU $1,$1,$0
        GET  $1,rR          // r = 2^64 % n
0H      TRAP 82,78,71       // loop: tmp = sysrand()
        MULU $255,$0,$255   // rH:tmp = tmp * n
        CMPU $255,$255,$1
        BN   $255,0B        // if(tmp < r) goto loop
        GET  $0,rH
        POP  1,0            // return rH

Bash + coreutils, 20 bytes
Golfed
seq 0 $1|shuf|sed 1q

shuf - generate random permutations

Shuf will use the following code: to generate permutations:
permutation = randperm_new (randint_source, head_lines, n_lines);

which ends up in randint_genmax
/* Consume random data from *S to generate a random number in the range
0 .. GENMAX.  */

randint
randint_genmax (struct randint_source *s, randint genmax)
{
      ...

      randread (source, buf, i);

      /* Increase RANDMAX by appending random bytes to RANDNUM and
         UCHAR_MAX to RANDMAX until RANDMAX is no less than
         GENMAX.  This may lose up to CHAR_BIT bits of information
         if shift_right (RANDINT_MAX) < GENMAX, but it is not
         worth the programming hassle of saving these bits since
         GENMAX is rarely that large in practice.  */
      ...
}

which, in turn, will read  a few bytes of the random data from the low-level source of randomness:
/* Consume random data from *S to generate a random buffer BUF of size
   SIZE.  */

void
randread (struct randread_source *s, void *buf, size_t size)
{
  if (s->source)
    readsource (s, buf, size);
  else
    readisaac (&s->buf.isaac, buf, size);
}

i.e. at the low-level, there is no direct dependency between the shuf input value and the data read from the source of randomness (aside from computing the required byte buffer capacity).

Isn't this giving the input as an argument to your random number generator?

Even if this is not valid, please submit another bash answer!

@MartinEnder well, not directly, it just uses the input to define the upper limit for the generated integer range and jot will arrange for all the values in the range to appear in the output with an equal probability (that's probably borderline, but still).

If I dig deep enough into any random number generator I'm sure I'll find a call into a lower-level RNG that doesn't directly use the original argument. The point of the challenge is to obtain an arbitrary-size uniform distribution from a fixed -size distribution, which you're still not doing.

Thunno 2 +, 5 bytes
ƓwwɼŒ

Try it online!
Port of Dennis's Jelly answer. Just like that answer, this won't finish for a very long time since \$(16!)!\$ is so big.
Explanation
ƓwwɼŒ  # Implicit input
       # Increment implicitly
Ɠ      # Push 16 to the stack
 ww    # Take the factorial twice
   ɼ   # Random item from [1..that]
    Œ  # Modulo by (input + 1)
       # Implicit output

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/