7 kyu

Reversed Message

Description
Loading description...
Fundamentals
Strings
  • Please sign in or sign up to leave a comment.
  • SkellXC Avatar

    Python Translation

  • LosBlobbos Avatar

    JavaScript fork
    Fixing the issue I raised and updating to node 18

  • LosBlobbos Avatar

    JS - random tests can generate "0-length words" leading to words separated by more than 1 space.
    Possible solutions:

    • Don't generate empty words
    • Add to description that there can be more than 1 space between words and how they should be handled
  • kurtovk Avatar

    I've passed all tests. Also i passed random tests but i got an error "Cannot read property 'toUpperCase' of undefined". How it can be?

    • hobovsky Avatar

      In what language?

    • NunoOliveira Avatar

      JS - random tests can generate "0-length words" leading to words separated by more than 1 space. I think that such inputs shouldn't be tested, but I haven't checked other languages.

    • kurtovk Avatar

      With JS. I tried to split with regexp. But it doesn't work. Very strange.

    • NunoOliveira Avatar

      Unfortunately, your new approach runs into a different problem - it consumes all extra spaces between words, which differs in behaviour from the reference solution.

      I think this can be considered a kata issue, and it should be either specified in the description, or not tested at all (I prefer the latter option).

      I guess a third option can be considered: retire the kata. I'm pretty sure it's a duplicate and it's only available in JS, so not much would be lost.

  • farhanaditya Avatar

    JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)

  • glynester Avatar

    JS I pass all the intitial tests. I've filtered out 'words' with spaces but I only pass about 2/3's (on average) of the main tests. I've looked at a couple of the failed tests and if there are any differences between my result and the provided solution, they are not visible to the naked eye - so invisible characters perhaps... Anyone have any clues?

  • Voile Avatar

    Now that this kata is approved, it needs random tests.

  • BAov Avatar

    How can I see all the tests? I've passed tests. But the result of full tests is "Cannot read property 'toUpperCase' of undefined". I can't get why:(

    • EmilyScripts Avatar

      Hi I moved the tests over into the example tests so you can see what's exactly being tested. I've tried to work out what causing your problem but I cannot figure it out so just thought I'd give you a short term solution for the time being

    • BAov Avatar

      Thanks. I stuck on this test: Test.assertEquals(reverseMessage(''),''). But i've already solved this problem

    • n0belus Avatar

      How did you do that?

    • BAov Avatar

      Hi, I split the string into an array using space as a separator. Then I used the filter() method to get rid of all the empty strings in my array. I carried out all the other operations with the array returned by filter() method. I can't disclose my code here because it will be a spoiler

  • kazk Avatar

    Needs random tests

  • HerrWert Avatar

    !atak Tsrif Ruoy No Snoitalutargnoc