Lolololololololololololol

Let us take a break from the brain-wrecking questions and answer some of the simpler ones

You have recently read something extremely funny, and want to express your laughter to the world! But how can you?

Task

You have to display the string: Lolololololololololololololololololololololololololololololololololololololololololololololololololololololololol...

...to STDOUT.

The string should be of infinite length, or will constantly be printed until the end of time.

It is just as simple!

But remember, this is code-golf, so the source code must be as short as possible!

Note: Some languages may throw errors since excecution can be timed out, or for other reasons. That is okay! It can be weird when you laugh forever!

Good luck!

• By the way, standard site rules will allow functions which return the result (e.g. in an infinite generator) making the print to STDOUT part redundant unless you specify that this must be a full program (which I'd advise against, but is allowed). Sep 12 '20 at 13:21
• Possible duplicate of Scream very loudly Sep 12 '20 at 14:38
• I don't understand why this was closed. The other challenge is much simpler. Sep 12 '20 at 19:28
• @thedefault. I don't understand your comment. The difference (requires an extra character to be outputted before the program, and outputs two characters instead of one) is fairly trivial. As you can see, if we remove the print L part and change ol to A, we get an SVL answer!
– null
Sep 13 '20 at 11:56
• I have reopened this question. I believe the small difference presents interesting golfing opportunities in some languages and, furthermore, that simply porting a solution might well not be competitive. One only needs to look at a few of the answers to see some interesting differences. If people disagree then by all means vote to close again. Sep 24 '20 at 8:27

Python 3, 32 bytes

x='L'
while[print(end=x)]:x='ol'


Try it online!

In Python 3, the print function by default has end='\n' to put a newline after what you print. Rather than changing that to the empty string, we stick the value x that we want to be printed there, and don't provide any value to be printed.

We stick the printing in the while loop condition. Since print returns None by default but this is Falsey and won't continue the loop, we wrap it in a singleton list to make it Truthy.

I had tried to stick an infinite iterator into print like print(*iter(...),sep=''), but it looks like Python will consume the whole iterable first and never actually print.

• I wonder why I didn't think of this when I put the printing in the condition in my Jelly answer :/ Sep 12 '20 at 14:11
• Ruby, 23 bytes - x='L';x='ol'while $><<x (Can't post because it's marked as duplicate. Nice trick!) Sep 13 '20 at 4:39 Befunge-98 (PyFunge), 8 bytes "loL",<,  Try it online! How? Lo: Initially the IP is going east. "loL" pushes l, o and L to the stack. , prints L, < turns the IP west and , prints o. lo forever: The IP is now moving west. "loL" pushes L, o and l to the stack. The IP wraps around and ,<, prints l and o. L is left on the stack, but since we usually assume infinite resources, this is fine. x86-16 machine code, IBM PC DOS, 13 10 bytes 00000000: b04c cd29 0c20 3403 ebf8 .L.). 4...  Listing: B0 4C MOV AL, 'L' ; start off with capital L PRINT: CD 29 INT 29H ; write to console 0C 20 OR AL, 20H ; lowercase it 34 03 XOR AL, 3 ; swap between 'l' (0x6c) and 'o' (0x6f) EB F8 JMP PRINT ; loop forever  Try it online! A standalone PC DOS executable COM program. Output to console. -3 bytes thx to @nununoisy's very clever use of XOR to swap between l and o. Runtime: Forever and ever... • 10 bytes: B0 4C mov al, 'L' PRINT: CD 29 int 29h 0C 20 or al,0x20 34 03 xor al,3 EB F8 jmp PRINT Sep 23 '20 at 21:13 • @nununoisy oh that's very clever! Updated with credit given! Sep 23 '20 at 21:32 brainfuck, 41 40 bytes -1 byte thanks @ovs +[+<[-<]>>++]<.>>+[+>+[<]>->]<[.---.+++]  Try it online! • You don't the initial >, at least for the interpreter you linked, since it uses a wrapping tape. – ovs Sep 12 '20 at 16:56 • Thanks i didn't know that. Sep 12 '20 at 17:00 • I found a shorter version using KSab's bfbrute: Try it online! – ovs Sep 12 '20 at 18:36 • @ovs Do you have any tips on how to use bfbrute. Sep 12 '20 at 18:56 • @JoKing the bfbrute result I commented is 30 bytes long. – ovs Sep 24 '20 at 15:54 Labyrinth, 7 bytes 762 8.3  Try it online! Adds 623 % 256 == 111 to the previous answers below. 76 Push 76 and turn right (three-way junction) . Pop and print % 256 as char (L) Now the top is 0, so it should go straight, but instead it reflects to North 623 Turn right at 6 and push 623, going around the corners . Pop and print % 256 as char (o); go straight (three-way junction) 876 Push 876 Loop forever, printing "lo"  10 bytes 76 8.1 11  Try it online! Same idea, but using 876 % 256 == 108. Turns out that going from an uppercase to lowercase is just a matter of prepending a 8 because 800 % 256 == 32. At the center junction, the top is always 0 right after pop and print, so the IP goes straight (first from north to south, and second from east to west). All the numbers are corners which turn the IP 90 degrees, so the overall path is infinity-shaped 76.111.876.111. .... This form is one byte shorter than the naive square loop: 11 bytes 76. 8 1 .11  Try it online! 14 bytes  7 .63 1 1 11.  Try it online! How it works First, the flow: the execution starts at the first valid command, which is 7 on top. The only junction is 6, and since it causes the top of stack to be positive, the IP always turns right. It turns 180 degrees if it hits a dead end. So the sequence of commands executed in order is: 76.111.13676.111.13676.111. ...(runs indefinitely)  The stack has implicit zeros, and each of 0-9 adds that digit to the end of the top of the stack (in other words, n changes the top number x to 10x + n). So the program is supposed to print the characters with charcode 76, 111, 13676, 111, 13676, ... But 13676 is not l! Actually, Labyrinth's character output is done modulo 256. How did I find such a number? With the path designed like this  7 .6? 1 ? 11.  The problem is to find a number ??676 that is same as l (108) modulo 256. Note that, the equation ??xxx == yyy modulo 256 (x and y are givens and ?s are unknown) is solvable if xxx == yyy modulo 8, and if so, it always has a solution within two or fewer digits, in particular 0 <= ?? < 32. Since 676 % 8 == 108 % 8 == 4, this is solvable, and the solution here is 13. Hexagony, 5 bytes L;o>l  Try it online! Hexagony golfing language confirmed For some reason I was looking at my own answer that prints "six" in 6 bytes and randomly thought "what if I remove @?", and exactly got this answer. 4 bytes is impossible because Lol; is already 4 bytes and it is impossible to alternate two chars and print both in a single loop without redirection. Since there is no "halt" command in this program, the program flow looks like this: (It is recommended to read the docs on how > redirects the PC)  A B C > D E F [.....................................] <= looping region A B C > C B A D > A D B F > F C E A > D E F C > C ... L ; o o ; L l L l ; . . o . L l . . o o ^ ^ ^ ^ ^ ^  After the initial L;, o; and l; appear in the big loop in that order, therefore printing Lololol.... Haskell, 13 bytes 'L':cycle"ol"  Try it online! Bash + coreutils, 23 bytes (echo L&yes)|tr " y" ol  Try it online! Explanation We can generate infinite output using yes: without arguments, it outputs an infinite stream of y separated by newlines. echo L & yes outputs an L first, so our output stream looks like L y y y y  To turn this into the output we want, we just need to change newline to o and y to l. tr "\ny" ol does this transliteration, and we can save a further byte by using an actual newline in place of \n. • Although '\ny' is longer, you can use \\ny for the same byte count. – Neil Oct 18 '20 at 18:08 Python 3, 37 34 bytes -3 thanks to xnor - noting that print may have no unnamed argument! x='L' while x:x=print(end=x)or'ol'  Try it online! • Nice assignment trick! You can do print(end=x). – xnor Sep 12 '20 at 13:39 Jelly, 7 bytes ”L⁾olȮ¿  A full program which prints an L then repeatedly prints ol. Try it online! How? ”L⁾olȮ¿ - Main Link: no arguments ”L - set the left argument to 'L' ¿ - while... Ȯ - ...condition: print & yield the left argument ⁾ol - ...do: set the left argument to "ol"  05AB1E, 8 6 bytes ovs' far superior 6-byter: „Lo[?l  Try it online! Explanation: „Lo Push 2-char string onto stack ('lo') [ Begin infinite loop ? Output with no newline l Push lowercase of top of stack ('Lo' -> 'lo') (Implicitly close infinite loop)  05AB1E, 8 bytes My pitiful 8-byter: 'L?„ol[?  Try it online! It might still be golfable, perhaps if there's a way to compress 'Lol' even further. Explanation: 'L Push 'L' onto stack ? Print without newline ('L') „ol Push 2-char string onto stack ('ol') [ Loop Forever ? Print without newline ('ol') (Implicitly close infinite loop)  • Ah of course, How could I have missed that. Thank you! Sep 24 '20 at 11:48 • Generally, low length strings are too much of a hassle to compress without sacrificing golfiness. Sep 25 '20 at 2:44 • My idea was „olÞ'Lš, good job! May 10 '21 at 17:39 Marbelous, 14 31 bytes 6C 6F@0 @0/\4C  Marbelous is a language based on marble machines • @n (n from 0 to Z) is a portal which teleport the marble to another portal with the same value • 00-FF initiate a marble with this value • /\ create a duplicate passing marble to it's left and right • .. is a noop • marbles going out of the machine from the bottom are implicitly outputed interpretor -17 bytes thanks to DLosc • I think this three-line version should work: 6C, 6F@0, @0/\4C (14 bytes). I'm not 100% sure because I tried running Marbelous by putting the source code into Try It Online's Python 2 interpreter, where it seemed oddly nondeterministic--sometimes it just output L, sometimes Loo, sometimes Loooooo infinitely, and sometimes Lololololol infinitely. But since your original code did the same things, I'm reasonably confident the golfed version works correctly. Sep 25 '20 at 0:05 • @DLosc you're right it works, thank :D Sep 25 '20 at 7:05 Poetic, 147 bytes haha l-o-l funny!i saw a thingy,it was soo funny o?what i am crying o?what i am dying,literal CHOKING dying r-n?goddamn just see ohhhhhh heh,lol ig  Try it online! In the form of a text conversation between two people collectively laughing at something they found online. Cascade, 22 14 bytes @o| .l@ L"^ /"  Try it online! -8 thanks to Jo King. • 18 bytes, taking advantage of multiple starting points – Jo King Aug 18 '21 at 15:59 • Wait, what am i doing, we should be using " to print instead: 14 bytes – Jo King Aug 18 '21 at 16:38 Java (JDK), 5148 47 bytes a->{for(var s="L";;s="ol")System.out.print(s);}  Try it online! thanks to user and Jo King helping me save 4 and 1 byte(s) respectively! Pyth, 8 bytes p\L#p"ol  Try it online! Explanation p\L#p"ol p\L : print "L" # : while True: p"ol : print "ol"  Keg, 5 bytes L,{ǪȽ  Try it online! Finally! A reasonable use for the push'n'print commands! Explained • Print the letter "L" (L,) • While true: ({) • ---- Print the letter "o" (Ǫ) • ---- Print the letter "l" (Ƚ) • There's a push and print command for every letter?! Sep 26 '20 at 5:33 • @Razetime yep.... It's a result of Bad Choices™ Sep 26 '20 at 6:13 dc, 14 bytes 76P[[ol]Pdx]dx  Try it online! braingasm, 12 bytes 76.28524+[.]  Prints the byte streams 76 once, then 28524 forever Vyxal5, 9 bytes \L₴{ol₴  Try it Online! • 8 bytes May 11 '21 at 21:31 • 7 bytes May 12 '21 at 0:28 MATLAB/Octave, 38 35 33 31 bytes -2 bytes thanks to flawr -2 bytes thanks to tsh "L";while fprintf(ans);"ol";end  Try it online! In MATLAB the output in GUI command window is truncated, but the code itself executes forever. Maybe if you run script from actual command prompt it will actually display new ols infinitely. Dunno, didn't try. Online Octave implementations I tried (tio.run & octave-online.net) obiously kill the execution of script at some point. Also, if you decide to run this in MATLAB, use Ctrl+C to stop, because clicking Pause won't do anything. • Nice, you can shorten it a little bit using x="L";while fprintf(x);x="ol";end Sep 25 '20 at 20:12 • "L";while fprintf(ans);"ol";end is shorter – tsh May 11 '21 at 10:19 Hexagony, 11 6 bytes -5 thanks to @Bubbler L;o;l;  Try it online!  L ; Executed once: Set memory to 'L' (76) and print o ; l Executed repeatedly: Set memory to 'o' (111), print, set memory to 'l' (108) ; . Executed repeatedly: Print  After the first row is executed once, the second and third rows are repeatedly executed, infinitely printing ol. • Simply L;o;l; works. Not sure if it can be reduced to 5 bytes, but it might be possible. May 16 '21 at 3:46 Flipbit, 3530 28 bytes Thanks to Bubbler for -5 by shortening the loop Thanks to ovs for -2 by being big smort ^>>>^>^>>.<<<<<^>>>[>^>^.<<]  Try it online! Prints L, gets the tape set up for l, then makes use of the fact that o and l differ by only their two least significant bits to create a short loop to print both characters repeatedly. • 30 bytes Jul 24 '21 at 14:03 • @Bubbler Thanks! I wondered if the loop could be shortened, but I couldn’t figure out how to do it. Jul 24 '21 at 15:55 • 28 bytes by setting up l instead of o before the loop. – ovs Jul 24 '21 at 16:13 Forte (Forter), 25 bytes 5PRINT"ol";:LET5=1 1PUT76  Try it online! Explanation An undefined behavior exploit courtesy of Jo King: 1 PUT 76  Print an L character. 5 PRINT "ol"; : LET 5 = 1  Print ol without a final newline, and set 5 to 1. Apparently, this overwrites the former line 1 with the former line 5, and thus (lacking an END statement) the PRINT "ol"; line is executed repeatedly forever. But I don't really understand how this works--especially since it only works if you write line 5 before line 1, not vice versa... Here's a 44-byte version that doesn't use any undefined behavior: 1PUT76 5PRINT"ol";:LET6=6+0 6LET0=2:LET5=5+2  Try it online! Explanation 1 PUT 76  Print an L character. 5 PRINT "ol"; : LET 6 = 6 + 0  Print ol without a final newline, and set 6 to 6. 6 LET 0 = 2 : LET 5 = 5 + 2  Set 0 to 2, and set 5 to 7. 5 7 PRINT "ol"; : LET 6 = 6 + 0 2 Print ol again, and set 6 to 8. 6 8 LET 0 2 = 2 : LET 5 7 = 5 7 + 2 Set 2 to 2, and set 7 to 9. 5 7 9 PRINT "ol"; : LET 6 8 = 6 8 + 0 2 Print ol again, and set 8 to 10. And so on forever. • Or take advantage of undefined behaviour: Try it online! – Jo King Aug 7 '21 at 22:22 • @JoKing Haha! I was just going by the Esolangs article, which sort of implies that "undefined behavior" == "error", so I didn't try it. (Reassigning the current line number is undefined behavior too.) Aug 10 '21 at 0:24 • @JoKing Upon looking at it more closely, I find your second one really weird--do you know why it only works when line 5 is written before line 1? Aug 10 '21 at 0:36 • it looks like the ruby interpreter has this line: @lines.min_by { |line| posclamp(evaluate(line.number) - num) }, which will take the first line in the program that matches the criteria – Jo King Aug 10 '21 at 1:44 Neither beats Johan du Toit's answer, but I enjoy that they are full programs, plus I like the way the longjmp answer works. C (gcc), 39 bytes As straight forward as it gets, uses for initializer to print L, then it's ols from there on out. main(){for(printf("L");printf("ol"););}  Try it online! C (gcc), 50 bytes Definitely more fun, use an int array as jmp_buf, then add the return of setjmp to the string pointer so that the first iteration adds 0, then pass 1 to longjmp so the rest add 1 and skip the L. Thanks to jdt for -4 bytes! j[9];main(){printf("Lol"+setjmp(j));longjmp(j,1);}  Try it online! • +1 for the longjmp. This also works for a full program main(i){main(!printf("Lol"+!i));} – jdt Aug 11 '21 at 14:14 • 50 bytes – jdt Sep 1 '21 at 14:29 convey, 10 bytes ['L'}'lo'}  Try it online! Visualization (separated) Labyrinth, 29 26 bytes 7 :::.:+ 6 1 # # .11 -:.  Try it online! How? Labyrinth starts with the instruction pointer at the top left and executes the character underneath, performing actions on the top of the main stack (and an auxiliary stack, not used here). After executing an instruction the instruction pointer then moves in a direction which is dependent on how many neighbouring instructions there are (spaces are not instructions) and the value of the top of the main stack. As such this code does the following: 7 - pop (implicit 0), multiply by 10 and add seven main stack: [7] 6 - pop (y), multiply by 10 and add six [76] . - pop (76), print that byte ('L') [] 1 - pop (implicit 0), multiply by 10 and add one [1] 1 - pop (1), multiply by 10 and add one [11] 1 - pop (11), multiply by 10 and add one [111] : - duplicate the top of the main stack [111,111] : - duplicate the top of the main stack [111,111,111] : - duplicate the top of the main stack [111,111,111,111] . - pop (111), print that byte ('o') [111,111,111] three neighbours (::#), positive top of main -> turn # - push depth of main stack [3,111,111,111] - - pop (b=3), pop (a=111), subtract (a-b=108), push [108,111,111] : - duplicate the top of the main stack [108,108,111,111] . - pop (108), print that byte ('l') [108,111,111] # - push depth of main stack [3,108,111,111] + - pop (b=3), pop (a=108), add (a+b=111), push [111,111,111] : - duplicate the top of the main stack [111,111,111,111] . - pop (111), print that byte ('o') [111,111,111] three neighbours (::#), positive top of main -> turn # - ...now we will continue to print 'l' then 'o' ad-infinitum  • 14 bytes using 13676%256 == 108. Sep 24 '20 at 3:38 • That's really neat, don't you want to post it yourself? Sep 24 '20 at 8:17 • Unfortunately the question was closed as duplicate... Sep 24 '20 at 8:18 • I've reopened the question and commented about why under the question. Sep 24 '20 at 8:28 Husk, 7 bytes :'L¢"ol  Try it online! Commented: : -- prepend 'L -- the character L ¢ -- to the infinitely repeated "ol" -- string "ol" (closing quote not required)  Equivalent to this Haskell function: (:) 'L' (cycle "ol")  Try it online! Wolfram Language (Mathematica), 31 bytes #0[ol,$Output~WriteString~#]&@L


Try it online!

Stops when the program hits the $IterationLimit, which defaults to 4096. 34 bytes does the job without worrying about that: Do[$Output~WriteString~L;L=ol,∞]


Try it online!

x86-16 machine code MS-DOS - 23 bytes

This answer inspired by 640KB answer.

 000000: B4 02 B7 4C 8A D7 CD 21  B2 6F CD 21 8A D7 80 F2   ...L...!.o.!....
000010: 20 CD 21 EB F3 CD 20                                .!...


Listing:

      6 0100  B4 02              MOV AH, 02H
7 0102  B7 4C              MOV BH, 'L'
8 0104  8A D7              MOV DL, BH
9 0106  CD 21              INT 21H
10
11 0108                 PRINT:
12 0108  B2 6F              MOV DL, 'o'
13 010A  CD 21              INT 21H
14 010C  8A D7              MOV DL, BH
15 010E  80 F2 20           XOR DL, 20H
16 0111  CD 21              INT 21H
17 0113  EB F3              JMP PRINT
18
19 0115  CD 20              INT 20H


Output:

• The INT 20H at the end seems unnecessary. Also, MOV DL, BH (with or without the XOR DL, 20H) takes far too many bytes. Just move the constant into DH directly. Also move the PRINT: back one instruction to save yourself an INT 21H.
– Neil
Oct 18 '20 at 18:12