Ad
  • Custom User Avatar

    What does it mean for a kata to be retired? Does it stop being retired if the satisfaction rate goes up? if so how?

    It's not that much of an annoying edge-case. The effect is to get a funny word like ass-car. The joke somehow won't work with something like ass-father-in-law (best example I could find unlike something like self-reference). Btw, writing this paragraph felt reaaally weird but I don't have anyone to blame for that except myself.

    No offense taken and I really appreciate your feedback, but how is this less interesting than "move zeros to the end" or other arbitrary tasks in other katas? Judging by the new solutions that actually work and the satisfaction rate, I'm assuming most of them are left from when I first published the kata with its many issues.

    I added the randmon tests for the word-word word-word pattern. Unless i'm getting something wrong it wasn't that huge.

    Thanks again <3

  • Custom User Avatar

    I think all should be fine now.

  • Custom User Avatar

    Thank you for taking the time to audit my kata.

    Wouldn't the line "patterns such as 'word-word word-word' don't have to be modified." in the description suffice in covering this case? Your solution should only modify the input with the pattern word-ass word.

  • Custom User Avatar

    The input issue is fixed now. Users are explicitly told that the input is going to be a string. That case with 0 is now '0'.

  • Custom User Avatar

    Oh god... I added random cases. Am I doing this wrong? This is my first kata, and I'm kinda freaking out a bit haha 0~0

  • Custom User Avatar

    Ok. Now I see why you included random tests. My assumption was that nobody would "cheat" that way.

  • Custom User Avatar

    Thank you for your thorough examination. I really appreciate it. <3

    Handling of casing should be explained (why an upper-case letter turns into a lower-case letter?) done.
    "output MUST be a string in small letters"


    given funny-ass self-reference
     expected 'funny ass-self-reference' to deeply equal 'funny-ass self-reference'
    

    fixed


    For more information, and hopefully a giggle, visit the comic that inspired this kata

    I didn't mean information regarding how to solve the kata, but I can see how it can be misleading.
    Now it simply says:

    If you want some giggles, visit the comic that inspired this kata:

    Is it better? Or should I avoid external links if possible?


    There are two inputs with different expected answer?

    fixed


    Do I have to inlcude random tests? It doesn't really go with the essence of the kata...


    assert.deepEqual(xkcd37(0), "0"); - this sucks, why even. "Does not follow the pattern" would arguably still imply that inputs are strings, it does not clearly explain that inputs can be integers or airplanes.

    Sorry, can you be a bit more clear? Now it just says the output MUST be a string. And with the examples the the description fixed, I think it's a bit more clear. Should I clearly state that the input might be and integer, float or a string?


    Textual representation removed.

  • Custom User Avatar

    Omg, I never laughed this hard XDDD

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Same reaction, didn't know this existed... idk why but smh it feels wrong to use "easy" solutions with low level languages like c++ and java. Great answer nontheless.

  • Custom User Avatar

    I really liked this one, by using that regular expression you can take advantage of the replacer function by selecting groups so v would bep1 and m is the match in mdn terms, ultimately it gets rid of the slightly more messy match => match[1].toUpperCase() part. Thanks for this cool solution.

  • Custom User Avatar

    Can you explain a bit more? It's not like I'm stuck or anything (nervous laughter), just asking since you're interested in recursion.

  • Custom User Avatar

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

  • Custom User Avatar

    Hey I know I'm probably late to the party. But in addition to what blade-sensei said you can run a expanded version of this with tests to see what's going on (which I think is better than searching up different parts of a solution as soon as seeing one, you should do that later).
    Here is the code I used:

    function findOdd(inputArray) {
      return inputArray.reduce((accumulator, currentValue, currentIndex, arr) => {
        console.log(`
    accumulator	
    ${accumulator}
    
    currentValue	
    ${currentValue}
    
    accumulator ^ currentValue	
    ${accumulator^currentValue}
    
    ${arr.slice(0,currentIndex).join("^")}
    ${accumulator^currentValue}
    
    
    `)
        return accumulator ^ currentValue
      })
    }
    
    console.log(findOdd([10, 3, 20, 10, 3, 20, 10]))
    

    Hopefully, this'll be helpful.

  • Loading more items...