DEV Community

MilesWK
MilesWK

Posted on

πŸš€ [Free Follow Opertunity]: Who can create the biggest loop? πŸ”

There are many ways to create loops. There is the boring while True: way:

while True: 
    print('hi')
Enter fullscreen mode Exit fullscreen mode

But that is boring, as mentioned above. I want to see if you can create a better to make something RUN FOREVER.

πŸ₯³ Free Follow Opertunity:
There is a really hard challenge for a free follow! The first person to figure out a way to create a function that calls a function that calls the original function to create an endless loop, gets a shoutout, a lot of posts liked, and a follow!

Up for the challenge?

Image description

Top comments (2)

Collapse
 
dariomannu profile image
Dario Mannu

You mean something that won't break the stack, like this?

function fn2 { setTimeout(fn1) }
function fn1 { fn2() }
Enter fullscreen mode Exit fullscreen mode

Why not just a single function, then, as you don't actually need both?

const fn = ()=>
  setTimeout(fn);
;
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mileswk profile image
MilesWK

Hmm... I guess it is harder in Python.
I was thinking something on the python lines like this:

def fn1():
     fn2()

def fn2():
     fn1()
Enter fullscreen mode Exit fullscreen mode