65
\$\begingroup\$

Challenge description

On some channels on a popular streaming site twitch.tv a common message people tend to spam in chats to bait people into spamming "LUL" is

One more LUL and I'm out

LUL is a popular emote used to express that something funny happened on stream.

Soon dank memes showed their potential and a parody of the copy-pasta ensued:

One more "One more LUL and I'm out" and I'm out

Which is the same message nested in itself. Given a non-negative integer N, output the LUL-pasta nested N times in itself following the pattern below.

Standard rules apply, the shortest code in bytes wins.

Sample input / output

0: One more LUL and I'm out
1: One more "One more LUL and I'm out" and I'm out
2: One more "One more "One more LUL and I'm out" and I'm out" and I'm out
...
7: One more "One more "One more "One more "One more "One more "One more "One more LUL and I'm out" and I'm out" and I'm out" and I'm out" and I'm out" and I'm out" and I'm out" and I'm out

Notes

  • Leading/trailing newlines are allowed
  • Capitalization must be preserved
  • Your code may be a full program or a function
  • Instead of printing, you may return a string or its equivalent in your language of choice
  • You may index from 1 instead of 0
\$\endgroup\$
11
  • 6
    \$\begingroup\$ can I add " in the start and end too? \$\endgroup\$
    – Rod
    Jan 19, 2017 at 11:44
  • 8
    \$\begingroup\$ @Rod: No, you cannot. \$\endgroup\$
    – shooqie
    Jan 19, 2017 at 12:07
  • 30
    \$\begingroup\$ The title of this challenge is very awkward for Dutch speakers... \$\endgroup\$
    – user34409
    Jan 19, 2017 at 14:12
  • 6
    \$\begingroup\$ @Pakk But it's true. I see a LUL, and I'm outta here... \$\endgroup\$
    – steenbergh
    Jan 19, 2017 at 14:20
  • 8
    \$\begingroup\$ This can be extended to YOLO: You Only YOLO once --> YOYOLOO. You Only YOYOLOO Once --> YOYOYOLOOO, etc. \$\endgroup\$
    – DJMcMayhem
    Jan 19, 2017 at 16:07

66 Answers 66

1
\$\begingroup\$

Cheddar, 71 bytes

i->('One more "'*i).slice(0,-1)+'LUL '+('and I\'m out" '*i).slice(0,-2)

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Maybe try recursion with _ f -> syntax which may save some bytes \$\endgroup\$
    – Downgoat
    Feb 14, 2017 at 18:13
  • \$\begingroup\$ Uhh, I'm not really familiar with how that syntax works, and I can't find it or any examples in the docs. \$\endgroup\$
    – Pavel
    Feb 14, 2017 at 18:19
1
\$\begingroup\$

Jelly, 39 bytes

First Jelly submission! Can probably slice off a few by encoding the strings, but I couldn't get it working with the spaces yet.

“"One more ”;;“ and I'm out"”
“LUL”Ç¡ḊṖ

A 0-indexed version needs an additional Ç after the Ç¡.

Try it online!

Explanation will follow soon!

\$\endgroup\$
1
\$\begingroup\$

Common Lisp, 90 89 108 105 103 bytes

(set's"One more LUL and I'm out")(dotimes(n(read)(princ s))(set's(format()"One more ~a and I'm out"s)))

Other solution (91 bytes)

Using Winny's solution in Racket (my is not exact copy)

(defun l(n)(if(< n 0)'LUL(format()"One more ~:[~a~;\"~a\"~] and I'm out"(> n 0)(l(1- n)))))

usage:

(format t"~a"(l 2))

Ideas for improvement are welcomed.

\$\endgroup\$
1
\$\begingroup\$

Haskell - 73 bytes

n!s=[1..n]>>s
f n=init(n!"One more \"")++" LUL"++tail(n!"\" and I'm out")

I wonder if there something I could use besides init and tail to save a few bytes.

Try it here!

\$\endgroup\$
1
  • \$\begingroup\$ There is an extra space in " LUL" which should be removed. \$\endgroup\$
    – Laikoni
    Jun 14, 2017 at 5:35
1
\$\begingroup\$

Perl 5, 55 + 1 (-p) = 56 bytes

$_='"One more 'x++$_.LUL.' and I\'m out"'x$_;s/^.|.$//g

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ Nice approach! Couldn't come up with an alternative, but a little rearrangement can save you 6 bytes (plus dropping the +1 for -p): Try it online! \$\endgroup\$ Jun 18, 2020 at 19:40
1
\$\begingroup\$

PHP, 69 66 bytes

Note: uses IBM-850 encoding

for($o=LUL;~$argn--;$d=~¦)$o="One more $d$o$d and I'm out";echo$o;

Run like this:

echo 2 | php -nR 'for($o=LUL;~$argn--;$d=~¦)$o="One more $d$o$d and I'"'"'m out";echo$o;';echo
> One more "One more "One more LUL and I'm out" and I'm out" and I'm out

Explanation

for(
  $o=LUL;                           # Start with output string "LUL".
  ~$argn--;                         # Loop until N is -1.
  $d=~¦                             # Set delimiter to `"` after first
                                    #   iteration.
)
  $o="One more $d$o$d and I'm out"; # Add text with previous output
                                    #   embedded, between delims.

echo$o;                             # Output resulting string.
\$\endgroup\$
2
  • \$\begingroup\$ @devRicher and aross: We have a Be Nice policy—please remember to follow it and act with a civil tone, even when disagreeing with someone. \$\endgroup\$
    – Doorknob
    Jan 20, 2017 at 16:40
  • \$\begingroup\$ @Doorknob I'm sure you'll agree that an accusation of cheating is uncalled for. I'm also sure that his downvote (which still stands) should be removed, as I corrected my answer \$\endgroup\$
    – aross
    Jan 23, 2017 at 9:30
1
\$\begingroup\$

Tcl, 91 bytes

set g [set f "One more LUL and I'm out"]
time {regsub -all LUL $f "\"$g\"" f} $argv
puts $f

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Is set n ... a valid passing of value in shell script golfing? \$\endgroup\$ Jun 17, 2020 at 21:29
  • \$\begingroup\$ @JonathanFrech Fixed. \$\endgroup\$
    – sergiol
    Jun 18, 2020 at 16:31
1
\$\begingroup\$

Stax, 27 bytes

âΔ▓♥CPM9C"4█é¢┐╥äΔ↔╖◄b)►┤≤▐

Run and debug it

This is a recursive program that decrements the input on each call.

I discovered a bug in stax writing this program. I'll fix the bug sooner or later, but I won't incorporate it into this solution, as it seems unsporting to me.

\$\endgroup\$
1
\$\begingroup\$

Microsoft Excel, 69

Cells:

  • A1 - input
  • A2 - One more "
  • A3 - " and I'm out
  • A4 - "" (Otherwise I'd have to escape them)
  • Wherever - =SUBSTITUTE(REPT(A2,A1)&REPT(A3,A1),A4,"LUL"
\$\endgroup\$
1
\$\begingroup\$

International Esoteric Phonetic Language, 80 bytes

<f>/qubʌɔ|a|"\""u1z<f>"\""uɔ|b||a|ʍu|b|ɖbuʈ\"LUL"w" and I'm out""One more "ɪ<f>""o

Recursive implementation that decrements the input number when recursing.

Explanation:

<f>/qubʌɔ|a|"\""u1z<f>"\""uɔ|b||a|ʍu|b|ɖbuʈ\"LUL"w" and I'm out""One more "ɪ<f>""o
<f>/                                                                              (fun def)
    qu                                                                            (one more)
      bʌɔ|a|                                                                      (if index == 0, continue, else jump to else)
           "\""u                                                                  (quote)
                1z                                                                (decrement index)
                  <f>                                                             (recurse)
                     "\""u                                                        (quote)
                          ɔ|b|                                                    (skip to end)
                              |a|                                                 (else)
                                 ʍu                                               (LUL)
                                   |b|                                            (end)
                                      ɖbuʈ\                                       (and i'm out)
                                           "LUL"w                                 (wegister going wwww LUL)
                                                 " and I'm out""One more "        (strings)
                                                                          ɪ<f>    (input and call)
                                                                              ""o (print newline)
\$\endgroup\$
1
\$\begingroup\$

Husk, 27 bytes

!¡σ"LUL"s₁₁
¨Ønø LULÄdİ'møo

Try it online!

Does infinite replacement of LUL and indexes into it.

1-indexed.

\$\endgroup\$
1
\$\begingroup\$

YASEPL, 161 bytes

=a'(=s)"One more "=u)apostrophe=m)" and I"ſuſ"m out"=x)"LUL"=n=q$34»!a@!sſq!-!m)qſ" and I"ſuſ"m out"=x)"One more LUL"ſ" and I"ſuſ"m out"`1!b;s,a~#x;m,a<
\$\endgroup\$
0
\$\begingroup\$

Perl 6, 57 bytes

{substr "\"One more "x$_~"LUL"~" and I'm out\""x$_,1,*-1}

Slightly more interesting, but 58 bytes:

{join "LUL",("One more "," and I'm out"Xxx$_)».join('"')}
\$\endgroup\$
0
\$\begingroup\$

Clojure, 84 bytes

#(nth(iterate(fn[s](str"One more \""s"\" and I'm out"))"One more LUL and I'm out")%)

Argh why isn't the first LUL in quotes? :( Almost correct in 63 bytes:

#(nth(iterate(fn[s](str"One more \""s"\" and I'm out"))"LUL")%)
\$\endgroup\$
0
\$\begingroup\$

GameMaker Language, 106 bytes

1-indexed

s='LUL'for(a=0,a<argument0;a++)s='"One more '+s+" and I'm out\""return string_copy(s,2,string_length(s)-2)
\$\endgroup\$
0
\$\begingroup\$

Octave, 72 70 bytes

@(n)[{'"One more '}{o=!(1:n)+1} "LUL " {"and I'm out\" "}{o}](2:end-2)

1 based index

Try It Online!

\$\endgroup\$
0
\$\begingroup\$

PowerShell, 88 bytes

for($d=($s="One more LUL and I'm out");$i++-lt$args[0]){$d=$d.Replace("LUL","`"$s`"")}$d
\$\endgroup\$
0
\$\begingroup\$

Batch, 95 bytes

@set s=LUL
@for /l %%i in (0,1,%1)do @call set s="One more %%s%% and I'm out"
@echo %s:~1,-1%

0-indexed, because that means it works even if you forget to pass a parameter. (The 1-indexed version would just print U in that case, which looks silly.)

\$\endgroup\$
0
\$\begingroup\$

C#, 102 90 bytes

string l(string s,int n){return n<0?s.Substring(1,s.Length-2):l($"\"One more {s} and I'm out\"",--n);}

Recursive, call with l("LUL",7);

EDIT

Thank you for pointing out that it is illegal to pass input not specified in the challenge. Here is the fixed version that only takes an integer N:

string l(int N){return N<0?"":$"One more \"{l(--N)}\" and I'm out".Replace("\"\"","LUL");}
\$\endgroup\$
4
  • 1
    \$\begingroup\$ You can't assume that this string is passed as input. It's a standard loophole, which is forbidden by default. - @Zgarb in the deleted Java 7 answer \$\endgroup\$
    – Value Ink
    Jan 19, 2017 at 21:18
  • \$\begingroup\$ Sorry I am new to this. Do I have to add the call to the total bytes? Or find another solution that does only assume an int N as input? \$\endgroup\$ Jan 19, 2017 at 21:20
  • 2
    \$\begingroup\$ You need to find another solution that only assumes the integer \$\endgroup\$
    – Blue
    Jan 19, 2017 at 21:31
  • \$\begingroup\$ Another option is to use C#'s optional arguments thing, so string l(int n,string s="LUL") works as well. But your new solution is now shorter anyways, so it might be better to just leave it as is! Unless someone else with more C# knowledge knows how to golf it further, of course. \$\endgroup\$
    – Value Ink
    Jan 19, 2017 at 21:52
0
\$\begingroup\$

Clojure, 90 bytes

(fn c[n](if(= n -1)"LUL"(let[q(if(> n 0) \")](str"One more "q(c(dec n))q" and I'm out"))))

Written and golfed on my phone on a soft keyboard using the "Clojure REPL" app. That was sure a treat.

Explicitly recursive solution. Inserts the results of recursing into the "template string".

Pregolfed:

(defn lul [n]
  (if (= n -1)
    "LUL"
    (let [quote? (if (> n 0) \")]
      (str "One more "
            quote? (lul (dec n)) quote?
           " and I'm out" ))))
\$\endgroup\$
0
\$\begingroup\$

Scala, 63 bytes

(n:Int)=>("One more \""*n init)+"LUL"+("\" and I'm out"*n tail)

1-indexed

\$\endgroup\$
0
\$\begingroup\$

C++, 183 bytes

Simply input N times you want 'One more LUL' nested.

#include <iostream>
#include <string>
#define s string
using namespace std;main(){int N;cin>>N;s a="LUL";s b="One more \"";s c="\"and I'm out";for(int i=0;i<N;i++){a=b+a+c;}cout<<a;}

Try Me Online!

\$\endgroup\$
1
  • \$\begingroup\$ doesn't work. 1 should output "one more LUL and I'm out" with no quotes \$\endgroup\$ Feb 6, 2017 at 1:30
0
\$\begingroup\$

C++14, 90 bytes

As unnamed lambda modifying its input. Requires s to be std::string or alike.

[](auto&s,int i){s="LUL",++i;for(char c=0;i--;s="One more "+(c+s+c)+" and I'm out",c=34);}

Ungolfed and usage:

#include<string>
#include<iostream>

auto f=
[](auto&s,int i){
 s="LUL",++i;        //set basic LUL
 for(
  char c=0;          //first string concat without quotes
  i--;               
  s="One more "+(c+s+c)+" and I'm out", //string concat
  c=34                                  //set c to "
 );
}
;

int main(){
 std::string s;
 f(s,0);
 std::cout << s << std::endl;
 f(s,1);
 std::cout << s << std::endl;
 f(s,2);
 std::cout << s << std::endl;
 f(s,3);
 std::cout << s << std::endl;
}
\$\endgroup\$
4
  • \$\begingroup\$ does this output null bytes? \$\endgroup\$ Feb 6, 2017 at 1:28
  • \$\begingroup\$ @DestructibleWatermelon no, it just works. I guess adding the null-char is just ignored. \$\endgroup\$
    – Karl Napf
    Feb 6, 2017 at 1:40
  • 1
    \$\begingroup\$ how did you check exactly? \$\endgroup\$ Feb 6, 2017 at 1:50
  • \$\begingroup\$ By running and checking the output. \$\endgroup\$
    – Karl Napf
    Feb 13, 2017 at 10:11
0
\$\begingroup\$

Objective-C, 218

#define p NSString stringWithFormat
-(NSString *)f:(int)a{NSString *o=@"One more ",*k=@" and I'm out",*i=[p:@"%@LUL%@",o,k],*s=@"";for(int j=-a;a-->j+1;s=[p:@"%@\"%@",s,a>0?o:a<0?k:i]);return [s substringFromIndex:1];}

Not the most beautiful language to golf in, but I had fun

\$\endgroup\$
0
\$\begingroup\$

QBIC, 72 bytes

:[a|X=X+@One more `+chr$(34)┘Z=Z+chr$(34)+@ and I'm out`]Z=X+A+@LUL`+B+Z

The chr$(34) for the quotes is particularly costly, I need to fix a bug in the interpreter to make them work inside a string literal...

Sample output:

Command line: 0
One more LUL and I'm out

Command line: 3
One more "One more "One more "One more LUL and I'm out" and I'm out" and I'm out" and I'm out
\$\endgroup\$
0
\$\begingroup\$

dc, 82 bytes

?dsasw[[LUL ]P]se[34dP]sr[lalw>r[One more ]nlad1-dsar1=e0<y[and I'm out]nP32P]dsyx

Might as well add an answer in dc. This is 1-indexed.

"Calculate" it on the Internet!

\$\endgroup\$
0
\$\begingroup\$

Racket, 88 87 bytes

(define(f n)(format"One more ~a and I'm out"(if(= n 0)'LUL(format"\"~a\""(f(- n 1))))))

Ungolfed

(define (f n)
  (format "One more ~a and I'm out"
          (if (= n 0)
              'LUL
              (format "\"~a\"" (f (- n 1))))))

Unit tests

(module+ test
  (require rackunit)
  (check-equal? (f 0) "One more LUL and I'm out")
  (check-equal? (f 1) "One more \"One more LUL and I'm out\" and I'm out")
  (check-equal? (f 2) "One more \"One more \"One more LUL and I'm out\" and I'm out\" and I'm out")
  (check-equal? (f 7) "One more \"One more \"One more \"One more \"One more \"One more \"One more \"One more LUL and I'm out\" and I'm out\" and I'm out\" and I'm out\" and I'm out\" and I'm out\" and I'm out\" and I'm out"))
\$\endgroup\$
5
  • 1
    \$\begingroup\$ I tried it on my PC and it seems your code outputs additional " on beggining and end. Also for n>=1 output should be One more "One more LUL and I'm out" and I'm out without backslash before " etc. It is possible that I have some old version of Racket but please look into it. Also - you can save one byte with 'LUL instead of "LUL" \$\endgroup\$
    – user65167
    Feb 18, 2017 at 11:14
  • \$\begingroup\$ @PrzemysławP In the Racket string "a\"b\"c", typing it into the repl will result the same as what you typed, you want to do (displayln "a\"b\"c") which outputs just a"b"c. Nice catch on the -1 byte, thanks! \$\endgroup\$
    – Winny
    Feb 18, 2017 at 21:36
  • \$\begingroup\$ So your function outputs string that is appropriate for other function to read and output what is needed. I doesn't output what is needed on its own. But probably you know better than me what is allowed - I may try to use this somewhere. \$\endgroup\$
    – user65167
    Feb 20, 2017 at 11:05
  • \$\begingroup\$ @PrzemysławP Could you clarify what isn't correct in this answer? I have no clue what you're going on about. \$\endgroup\$
    – Winny
    Feb 21, 2017 at 3:04
  • \$\begingroup\$ I am sorry for confusion. What I think may be incorrect is that output contains escape characters and quotes. To get rid of them you need to use other function on it (displayln if I understand you correctly). However it is possible that it is allowed, hence my "But probably you know better than me what is allowed(...)". To put it straight: when I write to REPL function definition and function call it displays different thing than what is defined in "Sample Input/Output" section in question. \$\endgroup\$
    – user65167
    Feb 21, 2017 at 9:41
0
\$\begingroup\$

Python, 78 bytes

f=lambda n:'One more "'*(n-1)+"One more LUL and I'm out"+'" and I\'m out'*(n-1)
\$\endgroup\$
0
\$\begingroup\$

k, 58 bytes

Indexing starts at 0. This is a recursive function.

`0:`c${"One more ",$[x;34,o[x-1],34;"LUL"]," and I'm out"}

Try it online.

\$\endgroup\$
0
\$\begingroup\$

GolfScript, 44 bytes

~"LUL"\{'"One more 
 and I\'m out"'n/*}*(;);

Try it online!

1-indexed.

Explanation:

~"LUL"\{'"One more \n and I\'m out"'n/*}*(;); ("\n" is a newline)
~                                             Eval (input is the only stack element on program start)
 "LUL"                                        Push "LUL"
      \                                       Swap
       {'"One more \n and I\'m out"'n/*}      Push block:
        '"One more \n and I\'m out"'            Push "\"One more \n and I'm out\""
                                    n           Push n (default: newline)
                                     /          Split
                                      *         Join
                                        *     Repeat block
                                         (    Pop first element and push to stack
                                          ;   Pop
                                           )  Pop last element and push to stack
                                            ; Pop
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.