7 kyu

Fac Recursion (Pest control - find the bugs and fix them)

821 of 1,071pmarek
Description
Loading description...
Recursion
Debugging
  • Please sign in or sign up to leave a comment.
  • Unixfscker Avatar

    Your function did not recurse enough times - Expected: 4, instead got: 3

    Why it's occurs ? My solution is completely written in a recursive way

    • 3au4onok Avatar

      This is an Idiot test, the author checks that you really use recursion or not. This quest is over 7 years old, so forgive him for that

  • Voile Avatar

    Recursion checking code does not work with lambdas.

    It also relies on Function.prototype.toString().

    • matt c Avatar

      Note: this is a bug fixing kata, whose definition is something like "fix bugs" not modify the current function completely which is what you would be doing if you would make it a lambda. I don't believe this is actually an issue... and If relying on Function.prototype.toString() is really an issue then you can restore it from a instance instead of using a potentially modified one?

    • Voile Avatar

      A recursive function is still recursive even if it's a lambda, so it's perfectly according to specs. This has nothing to do with "bugfix" or anything.

      And of course, relying on Function.prototype.toString is not the best practice because, you know, you can just obtain the user solution code.

  • jgrubard Avatar

    my code passes 7 tests and fails 1. not sure what the last case is testing, so I don't know how to correct my code.

  • user5036852 Avatar

    It's your first kata. :-) Great.

    But some hints for you:

    You should write in the task, that this is a bug-fixing-kata. Maybe also in the title. Add random tests.

  • matt c Avatar

    There are no inforcement tests to make sure the kata is recursive.

  • g964 Avatar

    No random test and duplicate of https://www.codewars.com/kata/factorial-recursive.

    • matt c Avatar

      this is a bugfixing kata though unlike the one you linked.

    • g964 Avatar

      Maybe but you don't almost have anything to change... Recursive factorials are everywhere:-)

    • matt c Avatar

      if it enforced the requirement of recursion and some percentage of change being a bug fixing kata then it would probably be unique enough to not be considered a duplicate?

    • user5036852 Avatar

      Hey matt, there are two translations for your very good kata "Large Factorials".

    • pmarek Avatar

      Well, random tests are in it, so I guess this is resolved? I must say, this is pretty funny :)

      Issue marked resolved by pmarek 9 years ago