# 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?

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). – Jonathan Allan Sep 12 '20 at 13:21
• Possible duplicate of Scream very loudly – pppery Sep 12 '20 at 14:38
• I don't understand why this was closed. The other challenge is much simpler. – the default. 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. – Jonathan Allan 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 :/ – Jonathan Allan 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!) – DrQuarius 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. # 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. – RezNesX 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. – RezNesX 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. # 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 – nununoisy Sep 23 '20 at 21:13 • @nununoisy oh that's very clever! Updated with credit given! – 640KB Sep 23 '20 at 21:32 # 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 # 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 # 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"  # 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. – DLosc Sep 25 '20 at 0:05 • @DLosc you're right it works, thank :D – jonatjano Sep 25 '20 at 7:05 # Haskell, 13 bytes 'L':cycle"ol"  Try it online! # 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! – Bismarck71 Sep 24 '20 at 11:48 • Generally, low length strings are too much of a hassle to compress without sacrificing golfiness. – Razetime Sep 25 '20 at 2:44 # MATLAB/Octave, 38 35 33 bytes -2 bytes thanks to flawr x="L";while fprintf(x);x="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 – flawr Sep 25 '20 at 20:12 # 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"  ## Batch, 42 bytes @set/ps=L<nul :g @set/ps=ol<nul @goto g  set/p outputs the string after the = as the prompt, and then expects to read from the console, which ends the line when you hit enter. But we redirect the input, so no enter happens, and we simply end up with a infinite series of "prompts" all on one line. # 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. – Bubbler Sep 24 '20 at 3:38 • That's really neat, don't you want to post it yourself? – Jonathan Allan Sep 24 '20 at 8:17 • Unfortunately the question was closed as duplicate... – Bubbler Sep 24 '20 at 8:18 • I've reopened the question and commented about why under the question. – Jonathan Allan Sep 24 '20 at 8:28 ### 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 # Flobnar, 18 bytes og,!< \l@>\< 2:L!_  Try it online! (requires the -i flag) ## Explanation Flobnar is a 2D language where expressions are laid out geometrically. For example, for a program that computes the number 10, you might write: 5 + @ 5  Here, @ indicates the entry point for the program, and has the effect of evaluating the term to its west; + evaluates the terms to the north and south and returns their sum; etc. The basic idea for this program is to embed the characters 'o', 'l', and 'L' in the source code at coordinates (0, 0), (1, 1), and (2, 2) respectively. Execution proceeds roughly like this: def step(n): step(!n if (!putchar(get(n, n))) else "impossible since putchar() returns 0") step(2)  Here's what the program looks like ungolfed: o >>>>v l ^ \ < \ @ L v 2 :!_ : g , !< :  See the specification for more detailed information about what each term does. • Note that this requires -i, so I don't think it works for the reference implementation. – Wezl Oct 5 '20 at 19:41 • @Wezl I don't think the reference implementation even supports character IO. – Esolanging Fruit Oct 5 '20 at 20:05 # StupidStackLanguage, 26 bytes avqvvmifavvqimiqdddltflflu  Try it online! • This sounds like an interesting language! – user Sep 12 '20 at 16:40 # dc, 14 bytes 76P[[ol]Pdx]dx  Try it online! # braingasm, 12 bytes 76.28524+[.]  Prints the byte streams 76 once, then 28524 forever # PHP, 24 bytes L<?php while(1)echo'ol';  • -1 byte using a for loop. – Razetime Sep 28 '20 at 6:51 # Python 3, 44 bytes print('L',end='') while 1:print('ol',end='')  How it works: The program first prints 'L' and then infinitely prints 'ol' on a single line using the end=''. Try it online! # 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! # Japt, 14 11 bytes -3 bytes thanks to @Shaggy OoUª'L ß"ol  Try it online! ## Explanation OoUª'L // Output input if it exists else 'L' ß"ol // Run program with input being "ol"  • 11 bytes – Shaggy Sep 12 '20 at 22:31 • Or 12 bytes if you want to avoid the overflow. – Shaggy Sep 12 '20 at 23:44 # Powershell v5 32 Byte while(1-ne2){Write-Host -n 'lo'}  Has someone an idea how to shorten Write-Host? Is there an alias? New One 52 Byte for(1){Write-Host -n 'L' for(1){Write-Host -n 'ol'}}  • The first character printed must be a capital L, the rest must be in lower-case. You can maybe answer Scream verly loudly like this. – Jonathan Allan Sep 24 '20 at 11:47 • ...although actually there already a terser Powershell program there. – Jonathan Allan Sep 24 '20 at 11:49 • Thanks for the hint. – Add-TheNewOne Sep 24 '20 at 11:53 • You can shorten your answer by 4 characters by removing the not equal expression: while(1){Write-Host -n 'lo'} – DBADon Sep 24 '20 at 14:45 • This is close, but does not write to a single line: while(1){('L')+('ol'*100)} – DBADon Sep 24 '20 at 15:24 # 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!

# Javascript, 23 22 bytes

(-1 from Jo King)

f=a=>(a?"ol":"L")+f(1)


Try it online!

• @joking yes. Actually, it even fits better to the requirement. Thanks – SomoKRoceS Sep 24 '20 at 21:52
• I think this (20 bytes including f=) should work. – Bubbler Sep 24 '20 at 22:55
• @JoKing legit :) I'll edit my answer wiith 2+ – SomoKRoceS Sep 25 '20 at 14:38
• @Bubbler I liked that! should I add it to this answer? – SomoKRoceS Sep 25 '20 at 14:38
• I'm new to code golf, but it seems to me that task requires text to be printed. So shouldn't console.log() be included in script and increase byte count? – NoOorZ24 Sep 28 '20 at 6:07

# 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?! – Razetime Sep 26 '20 at 5:33
• @Razetime yep.... It's a result of Bad Choices™ – Lyxal Sep 26 '20 at 6:13

# !@#$%^&*()_+, 7 bytes L(@o@l)  Try it online! L(@o@l) L Pushes character literal 'L' ( ) Loop while top of stack: @ Output top of stack as character ('L' first iteration, 'l' otherwise) o@ Output 'o' l Push 'l', repeating the loop  • Fun fact: This language inspired me to make this challenge. In fact, the first program I wrote in !@#$%^&*()_+ was a LOLOL program (it printed the capitalized version though). Today it survives in its esolang article. – SunnyMoon Sep 28 '20 at 12:43
• @SunnyMoon I'm honored :D What a bizarre coincidence, I haven't posted on this site in almost a year. – Conor O'Brien Sep 29 '20 at 2:27
• Welcome back, Conor :) – Shaggy Sep 29 '20 at 19:39

# MAWP, 10 bytes

76;["ol":]


Try it!