Ad
  • Default User Avatar

    i upvoted this as 'best practice', cause this solution made my day much more joyful

  • Default User Avatar

    Ohhh now got it, thanks

  • Custom User Avatar

    you need a function that adds two numbers and by not carrying over the digits so 11+11=22 and 88+88=1616. This way the function will pass all the tests :)

  • Default User Avatar

    But I'm not able to understand how I can write the function. For example, if return num1 + num2, these it passes for the first set of test cases, however not in the 2nd set of cases and vice versa.

  • Custom User Avatar

    Ah i see thanks! haha..

  • Custom User Avatar

    The real, silly, and big addition names are describing the test not a type of function used. You always perform the same operation as described in the description. The tests then do a few examples where the result of the fucntion is what would be expected with 'real' addition; then some where you have to remember not to carry the difits; and then some where the input numbers get quite big.

  • Custom User Avatar

    How do I know if the output should be Real, Silly or Big addition?

    Is there some kind of variable passed down?

  • Custom User Avatar

    It makes debugging easier - you know on what sort of test your code is failing on.

  • Default User Avatar

    Why there is two set of test cases, one with original addition and onw with the fake one? In both set of test cases, it is calling the same method.

  • Custom User Avatar

    You just do addition but instaead of carrying the numbers over, you just write make a new digit in the number.

      1 1 
    + 1 1 
    -----
      2 2
    

    So 11 + 11 = 22

      8 8
    + 8 8
    -----
     16 16
    

    So 88 + 88 = 1616

  • Default User Avatar

    Finally it worked! Thanks.

  • Default User Avatar

    integers don't get mutated. (in this case the RNG needed a modification) so, @t1ao: please try your code again

  • Default User Avatar

    my problem is i dont know how to start the second part with meme answers, mb im stupid but i didnt get what to do. I solve first part and pressed test, half is done. other half is left, thanks for replying but i didnt get what to do.

  • Custom User Avatar

    You need to click on TRAIN button, and you will be presented with a kata trainer view and two panels of main interest:

    • Solution editor is the place which contains some stub with method signature, and you need to fill it in with your solution. Solution is just a function, with arguents and return value, which is later called by tests.
    • Sample tests editor which contains some test cases. This is how numbers are passed to your solution, your solution gets invoked by them, and they receive the result returned by your solution. You can add more test cases here if you want
    • When sample tests pass and you believe your solution is ready, you can press ATTEMPT to test it against full, hidden test suite.
  • Custom User Avatar

    Well, if you hit the 'Train' button, you should be able to write code on the right side, and at bottom right you'll see a few testcases. (relevant link)

    You will receive numbers as function arguments, and your goal is to write that function and RETURN the result.

    You will complete it once you hit the 'Attempt' button and pass all test cases.

    Does that make it any clearer?

  • Loading more items...