Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Done!, Many thanks for the feedback.
The turn pull the card face down and the game ends. Otherwise it would never end.
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
Many thanks for the help, I'll work harder in test cases in future katas.
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.
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?
I've added more example test and made a first aproach to ramdom tests. Can you check if they are appropiate?
Many thanks, I'll work on the ramdom tests.
This comment is hidden because it contains spoiler information about the solution
I'll review it. Many Thanks.
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.
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.
I found the description confusing. It worked in Javascript, but i would suggest to write the description focussed in what the test cases expect.