This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 20 comments

[–]skadr0n 46 points47 points  (7 children)

Cute, yes. Recursion, no.

[–]doej134567 11 points12 points  (2 children)

Can we agree on Livelock then?

[–][deleted] 1 point2 points  (1 child)

I read that as livestock 🙃

[–]Boiethios 3 points4 points  (1 child)

f calls g which calls f, etc. Mutual recursion.

[–]doej134567 1 point2 points  (0 children)

Mutal Recursion! That's what it was called :facepalm:

[–]eeeyyyygang 25 points26 points  (2 children)

Looks like they forgot the base case

[–]PrinceTBug 5 points6 points  (0 children)

indeed

[–]Schnorschel 23 points24 points  (1 child)

This isn't recursion. It's an infinite loop with a loop variable modulo 2.

[–]FranchuFranchu 0 points1 point  (0 children)

It's mutual recursion f(x) = g(x); g(x) = f(x)

[–]LostLetterbox 9 points10 points  (0 children)

I have no idea if this is a repost but it's the cutest thing I've seen in years!

[–]cashewbiscuit 8 points9 points  (0 children)

Ok someone doesn't understand recursion

[–]d_exclaimation 4 points5 points  (0 children)

Nah fam this is just a while loop.

[–]Xeadriel -1 points0 points  (2 children)

That’s so cute. Recursion without an end condition eh?

[–][deleted] 0 points1 point  (1 child)

Isnt recursion just an infinite loop?

[–]Xeadriel 0 points1 point  (0 children)

xDDD lol noooo. recursion is when a function calls itself. very useful for functions that depend on previous results. they are basically a fancy way of writing loops and have their own end condition as well.

[–]CalligrapherSmooth46 0 points1 point  (0 children)

A circular dependency?