Skip to content

Chapter 7 recursion #58

@Micha10

Description

@Micha10

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions