ProgrammingBasics icon indicating copy to clipboard operation
ProgrammingBasics copied to clipboard

Chapter 7 recursion

Open Micha10 opened this issue 6 years ago • 0 comments

imho wouldn't that be easier to understand?

add(3,3)
 => add(3,2)
  => add(3,1)
   => add(3,0)
   { b == 0 so return a (=3)
  { return 3.plus1()} -> 4
 { return 4.plus1() } -> 5
{ return 5.plus1()  } -> 6

Micha10 avatar Oct 16 '18 16:10 Micha10