Write an endless loop, write some confusing gotos...
The rules are simple: Write a program that never stops. Language: Any. Try to keep it short and confusing :D
Here is an example:
for(i=0; i<10; i++){
for(j=0; i<10; j++){
System.out.println("Blubb.");
}
}
Post your funny, creative solutions below.
Oldest comments (78)
Welcome to Verilog.
My god, this brings back memories that I've been trying to compartmentalize. :'(
C++
assembler
C
I really like the last one. Defining a label to a comment - nice :D
This is far the best 👍
very nice friend!!
C
Ruby:
This gotta be the happiest loop, I've ever seen.
Brainfuck, I guess.
Always gotta have the classics.
Ah, BASIC with manually typed line numbers and GOTO... If only the screenshot were monochromatic green or amber it would be truly classic.
I can do that if you'd like... dev.to/dvdmuckle/hooking-up-a-vt42... :)
That'd be cool to see, but it'd never replace my memories of flickering Commodore PET screens from days of yore. Cool write up though, saving that to read later.
A classical example :P
Or in ES2015
Endless recursivity!
This will crash once the stack is full but nice try. :)
Hahaha yeah it totally did crash Chrome when I tried it. I wanted to just post
but that's a little boring.
Definitely classic but lacks the humor :)
Use a language that allows optimization of tail recursion then ¯_(ツ)_/¯
Us cool kids with our tail recursion could write in, for example, Common Lisp:
Javascript (ES6):
Technically ends because
.then
run on the next tick, but it permanently blocks the JS event loop (I think).(It might eat your RAM)
2 JS classics
Erlang:
loop() ->
do:someVitalTask(),
loop().
Shell command :
yes
Javascript
This post is so dangerous oh my god