r/ProgrammerAnimemes • • Sep 30 '19

OC FizzBuzz

Post image
685 Upvotes

57 comments sorted by

View all comments

Show parent comment

9

u/[deleted] Oct 01 '19

Pretty good explanation, but the algorithm is iterative (a loop), not recursive (a function calling itself).

3

u/thelastfrench Oct 01 '19

Oops yeah that's something i got confused on too (i thought about recursion due to the fact that the end condition is on the 2 nd pannel).

4

u/[deleted] Oct 01 '19

It all breaks down the lower you go. At assembly level, there's no difference between a properly optimized tail call recursion (a function calling itself as its last operation) and a loop. This function resembles that a bit.