6 kyu
Number encrypting: decypher
107 of 136dgrcode
Loading description...
Strings
Regular Expressions
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Ruby 3.0 should be enabled.
This comment has been hidden.
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! :)
I would word it along the lines of:
*edited for a more precise definition
Very nice Kata Danoso89, I had a lot of fun with this one!
Now for part 2...
Thank you.
Great! I'm glad you liked it! :)
Could do with a test case for input like
"234.234"
. People are not checking for the space following the dot. :PActually 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
, notRea.Rea
norRea.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! :)
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 fromto bear
)?OK, back to reality now ..