Ad
  • Custom User Avatar

    Chess grid is not part of input, and you do not have to build it.
    You do not need the whole board to solve this kata.

  • Default User Avatar

    Do we have to build the chess board grid? or is it already part of the data for the Kata?

  • Default User Avatar

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

  • Default User Avatar

    I'm reading the Kata's description in English.

    https://www.etymonline.com/word/-teen

    There's the origin of the word "teen"

  • Default User Avatar

    "Ten, Eleven, Twelve" does not end in "teen".

    thirTEEN does...

    This is common knowledge... correct?

  • Default User Avatar
  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

    Thank you for responding.
    If you'll notice my update on the same day as my post, I realized why my tests were passing. My output was being printed in the browser innerHTML which was auto deleting the whitespace. I didn't notice the difference between that and the console output.
    Thanks again

  • Custom User Avatar

    [...] an issue of how the codewars editor handles the code

    I am not sure what it would mean. What kind of incorrect handling would the editor do?

    it seems it might be calling the arr.join method twice when you try to log it before the return. Maybe the tests are doing the same to it

    I have some problems understanding what "it" would be, but tests are not doing anything to anything, other than invoking your solution and comparing it with an expected answer.

    BTW, some tests that fail here pass in repl.it. Also all the tests I've done pass in VSCODE with live server, Also my code passes on w3schools editor, and at Code Playground.

    It's difficult for me to believe. Your code does indeed not solve the task of the kata correctly, and there's no chance it would pass tests anywhere else, unless they are not exhaustive enough and test only some subset of scenarios. It's enough to study sample tests to notice what's the difference between your results and expected results.

    Focus on sample tests, especially on the test case with input of "AWUBWUBWUBBWUBWUBWUBC", see what your solution returns, what is expected answer, and what it returns in other editors.

  • Custom User Avatar

    I told you, the first test passes, the second one doesn't, and it won't pass in any editor, your code doesn't replace multiple WUBs with only one space. Try using something like this to see it: http://pythontutor.com/javascript.html#mode=edit

  • Default User Avatar

    Why is it wrong? I don't think it's a kata issue as much as an issue of how the codewars editor handles the code. BTW, some tests that fail here pass in repl.it.
    Also all the tests I've done pass in VSCODE with live server, Also my code passes on w3schools editor, and at Code Playground.

    I'd really like to learn from this, but I need to know the "why".
    Thanks

    ::UPDATE:: You're right - it logs incorrectly in the other ones too.
    But it prints to innerHTML correctly. That was my mistake and overlooking the fact that those two checks were different.

    Still not sure why it needs the extra step.

    Thanks a lot for your time

  • Custom User Avatar

    Your code is wrong, and it fails in repl.it too.
    If you add a console.log(arr) before the return line, you'll see this: ['A', '', '', 'B', '', '', 'C']

    When your code returns undefined, you console.log the first test, which works and shows you a single space between letters, when you return, the second test fails.

    Not a kata issue.

  • Default User Avatar

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

  • Default User Avatar

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

  • Loading more items...