6 kyu

Number encrypting: decypher

107 of 136dgrcode
Description
Loading description...
Strings
Regular Expressions
Fundamentals
  • Please sign in or sign up to leave a comment.
  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • docgunthrop Avatar

    This comment has been hidden.

    • dgrcode Avatar

      I understand your suggestion. How would you clarify it?

      1.Any single 'i' followed...

      2.Any single letter 'i' followed...

      3.Specially for letter 'i', when followed...

      4.Given the special behavior of letter 'i', when followed...

      Please, let me know how you think it best clarified to improve the description.

      Thank you for your suggestion! :)

    • docgunthrop Avatar

      I would word it along the lines of:

      From the input, any '1' that is preceded by a space and followed by a non-alphanumeric
      character should translate to its upper-case letter assignment.
      Any other numbers do not follow this special case.
      

      *edited for a more precise definition

  • B-raw Avatar

    Very nice Kata Danoso89, I had a lot of fun with this one!

    Now for part 2...

    Thank you.

  • JohanWiltink Avatar

    Could do with a test case for input like "234.234". People are not checking for the space following the dot. :P

    • dgrcode Avatar

      Actually I didn't consider that scenario because I considered that writing a character just after a dot would be an invalid input.

      However, now that you mention it, I see the possibility of having numbers in the string (not just words as it is right now), in which case this kind of input could be valid. I think any word with a dot in the middle should be considered a number, as a space must be left between a period and a new word. Therefore, the decyphered version of your string, as far as I understand the problem, should be: 234.234, not Rea.Rea nor Rea.zea. What was your result in that case?

      I'm thinking of doing another Kata cyphering and decyphering strings of words and numbers. What do you think?

      Thank you very much for your comment! :)

    • JohanWiltink Avatar

      Honestly? I think it's broken by design as a cipher algorithm. :P

      I see two directions to take it forward: more language parsing (and before you know it, you are implementing English just to obfuscate it as if you were a l33t h4x0r, but one who can write numbers :), or a stronger (different) encryption algorithm (and before you know it, you are the next Alan Turing and GCHQ comes ringing your doorbell with a cozy little white jacket and a cozy little padded cubicle for you to work in).

      Actually, seeing how your first impulse was to start doing more input parsing, the language angle might be the more obvious choice. Not a bad one either. :]

      But I have a feeling there might be more interesting things to do with parsed English than translate it into 1337sp34k. How's weighing text elements for a web search grab you? Filter out the fluff, extract the key words, match them allowing for synonyms (a bear being entirely different from to bear)?

      OK, back to reality now ..