Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Done too.

  • Custom User Avatar

    Done.

  • Custom User Avatar

    Thanks for this link. I could get greats advices out of it.

  • Custom User Avatar

    Haha, for your defense, learning French is more difficult than learning English (because of its many specifics and weird rules), but that's also my own opinion ;)

  • Custom User Avatar

    Thanks for the details.

    I've just published a new version with a big random test. Hope it'll fit.

  • Custom User Avatar

    Edited and published.

  • Custom User Avatar

    Hi donaldsebleung,

    Thanks for your advices. How could I set up random test cases ? I'm not really familiar with tdd : should I do something like this ? :

    function additionner_nombres_pairs(tbl_nombres) {
      return tbl_nombres.filter(...).reduce(...);
    }
    
    let randomList = get_random_number_list();
    let result = additionner_nombres_pairs( get_random_number_list );
    
    Test.equals( randomList, result, 'test with random input' );
    
    
  • Custom User Avatar

    Wow. I didn't expect to get so much reactions about the french version of my kata ;)

    As I said in a previous comment (it was a reply, so probably some of you missed it), I have french students I would like to train with this kata (my first one on codewars) and as I know that the language barrier can be a problem to them, I chose to help them providing first a french version.

    To be honest, I didn't even suspect that members of the codewars community would review my really-first test kata with so much energy. So thank you for all your advices ;)

    Now as you said @JohanWiltink, nobody must solve this kata. I'll use it first with my students and maybe I will give it an update to be fully English afterwards. Don't worry, I also think French formulaes in Excel are evil ^^

    So cheers from Paris guys ;)

  • Custom User Avatar

    I just provided a translation, and changed to the camel case notation. Tell me if there's anything else :)

    Best.

  • Custom User Avatar

    Hi Johan,

    Didn't know someone already reviewed my kata.

    To be honest, I wanted to give "Codewars" a try as I'd like to use this kata as an exercice for my "French" students. I don't know if I'm doing it the good way, since it's my first experience in creating a kata :)

    Is there a way to propose many differents languages ?

  • Custom User Avatar

    function elapsedSeconds(startDate, endDate)
    {
    var value = endDate.getSeconds() - startDate.getSeconds();
    console.log(endDate.getSeconds()+' - '+startDate.getSeconds()+' = '+value);

    return value;
    }

    // Outputs :
    // 2 - 1 = 1
    // Test passed

    // 20 - 1 = 19
    // Test passed

    // 20 - 1 = 19
    // Test failed : Value is not what it is expected.

    Am I crazy ? :)