Ad
  • Custom User Avatar

    Done!, Many thanks for the feedback.

  • Custom User Avatar

    The turn pull the card face down and the game ends. Otherwise it would never end.

  • Custom User Avatar

    Following the description: "To solve the problem you need to convert the number to binary and invert it. At this point you'll have the one's complement. The two's complement it's the 1's plus 1.", "The tests expect the decimal conversion of that last complement."

    Binary of 0 ----- 0
    Reverse --------- 1
    Add (1) --------- 10

    Binary to Integer 2

  • Custom User Avatar

    Many thanks for the help, I'll work harder in test cases in future katas. :thumbsup:

  • Custom User Avatar

    As you said that would be the corner case. I'm not as deep in Mathemathics so when I write the problem I was thinking that other programers would choose a friendly approach to the problem, in the way of basic programming learning about standard objects and their methods, a clean 8-bit case or similiar was enough for my. The 32-bit input is a shot over my original target.

    I'm open to your recommendations.

  • Custom User Avatar

    I'm adding test cases and random tests. About negative numbers. I described input of the kata as accepting positive integers. Should I refactor it to implement negative numbers too?

  • Custom User Avatar

    I've added more example test and made a first aproach to ramdom tests. Can you check if they are appropiate?

  • Custom User Avatar

    Many thanks, I'll work on the ramdom tests.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I'll review it. Many Thanks.

  • Custom User Avatar

    I'm struggling to pass the 17th test in javascript. I've tried to encode and decode the Yates quote in repl.it and it worked. Can't see why it fails in codewars test frame. I'd thank some advice.

  • Custom User Avatar

    The example tests in javascript calls 'difference' instead of 'array_diff', this may cause some issues if someone change the function name, and like others are pointed example tests aren't implemented.

  • Custom User Avatar

    I found the description confusing. It worked in Javascript, but i would suggest to write the description focussed in what the test cases expect.