Ad
  • Custom User Avatar

    For Python, this Kata is a nice opportunity to learn why the trivial instruction one may want to use shouln't be. Perhaps this could be precised in the details ?

  • Custom User Avatar

    Lovely St Valentine's FizzBuzz :-*

  • Custom User Avatar

    Noob detail : try directly the "attempt" button, not the "Sample tests". As there is no sample test, you'll get no answer even if your solution is good.
    (seems - and is - weird but I looked at the solutions whereas mine was OK...)

  • Custom User Avatar

    At last I got it ! As you did say, it replaces them ALL...
    Thank you for your help and for your patience :-)

  • Custom User Avatar

    That's why I don't understand why these letters are ignored. Is it because of what they are, or their position, or sthing else...?

    I thought that maybe they were already capitalised in the original version, and maybe my solution lowers them. But it's not that : if I lower all the string before JadenCasing it, same result.

    I see others solutions that work of course. But I do wonder why the simple and almost ready-for-use instruction I use has such a behavior.

  • Custom User Avatar

    in Python, my solution works in all cases but 3 and I can't understand why some letters ("t" and "m") are not converted :

    "If there Is Bread Winners, there Is Bread Losers. But You Can't toast What Isn't Real." should equal "If There Is Bread Winners, There Is Bread Losers. But You Can't Toast What Isn't Real."

    "three Men, Six Options, Don't Choose." should equal "Three Men, Six Options, Don't Choose."

    "People tell me to Smile I tell them the Lack Of Emotion In my Face Doesn't mean I'm Unhappy" should equal "People Tell Me To Smile I Tell Them The Lack Of Emotion In My Face Doesn't Mean I'm Unhappy"

  • Custom User Avatar

    My friend @dastevens gave me the explanation. My solution works on the sample test and not the random test because I changed num without knowing it. Why ? In my solution, I wanted to work on a copy of num, so I wrote :

    var numInc = num

    But in Javascript, var numInc = num does not create a real copy : it just copies the reference (address) of num in memory. As a result, any operation on numInc will also modify num itself.

    (This would not be the case if we worked on strings, since strings can never be modified).

    And this is why, we think, the sample tests are passed but not the random ones. Let's say that the author wrote a function, the solution of the kata, named "kataSolution()" ;

    • the sample tests do not run kataSolution(). The expected result is already provided. The tests only compare this expected result with that of incrementer(). In that case everything's OK.

    • but in the random tests, kataSolution() has to be run, to calculate the solution. And it seems that it is run AFTER incremeter(), which modified num. So kataSolution is run on a modified num. Example :

    num = [1, 2, 3]

    myIncrementer(num) = [2, 4, 6] , but it also transforms num in [2, 4, 6].

    so kataSolution(num) is in fact kataSolution(myIncrementer(num)) ! That's to say [3, 6, 9] instead of expected [2, 4, 6].

    We suggest changing the description to say do not change the input array, and add a test that fails if the input array is modified.

    Thanks to the author and to dastevens to make me realize this noticeable feature...

  • Custom User Avatar

    Exactly the same problem for me : sample tests all OK, random tests leave the array unchanged. Thanks for your help !