6 kyu
Atbash Cipher Helper
333 of 646jacobb
Loading description...
Algorithms
Ciphers
Security
Object-oriented Programming
Strings
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.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/203.
Please join the discussion to help us identify duplicate kata and retire them.
Node 12 should be enabled (Refer this and this for more info)
Ruby 3.0 should be enabled (Refer this & this for more detail)
Why is the description talking about Hebrew specifically? Hebrew alphabet, "viewing the text", "writing RTL", "alternate forms" has nothing to do with the task.
It has everything to do with the task because the cipher was historically applied to the Hebrew alphabet, your code needs to pass tests in Hebrew using the Hebrew alphabet with the written Hebrew language being written from right-to-left as opposed to English being left-to-right, and if you already know Hebrew you might get caught up on how you'd handle the alternate forms case.
Absolutely irrelevant.
Doesn't affect the way the cipher works at all.
Don't give people the wrong idea that they need to deal with how Hebrew works?
It'd be better if you removed all this useless information instead of coming up with these "justifications".
I'm sorry that you only want to learn to the minimum extent possible.
PHP Translation Kumited - please accept or fork (to add
mbstring
functions) and then accept :DAdd more alphabets in the example test cases, e.g. one with upper case characters, one where only
A
andO
are in there, one with hebrew characters.Javascript version of Kata needs random test cases.
No version of this kata uses random test cases. That being said, there is one Javascript solution that bypasses a single test case. Ruby users on the other hand, they seem to be much more interested in cheating that one test case. I will look into it this weekend if I have free time (NOTE: I don't have a lot of free time, esp since last June). If you want to construct the test cases personally, just comment here with a spoiler flag and I'll review them for inclusion and give you credit in the description if you desire.
I appreciate the feedback.
Error in testes - encode 'CODEWARS', expected answer - 'CODEWARS', when given alphabet is lowercase latin alphabet - expected answer should be an empty string.
From the description (will update to be clearer):
Didn't get that. Thanks for reply ;)
I think there is test case error, please help to check: encodeCODEWARS //this is my console log information which contains current funtion name and the str. Expected: CODEWARS, instead got: XLWVDZIH
For decode(CODEWARS), the expected should be 'XLWVDZIH'.
Edit, also the description for the test case specifically says: Testing with Latin lowercase alphabet
Potential issue, testcase for encoding 'CODEWARS' appears to expect 'CODEWARS' as the return value. Am I missing something?
It isn't intended to support bicameral scripts.
Marking issue as resolved.
jhoffner, I'm pretty sure this is ready.
The last test case is broken, I think... CODEWARS should not encode to CODEWARS...
I made some clarification in the test case description.
Can you mark this as ready or give me some suggestions on how to clarify? Capitalization is a non-issue in this kata. You're supposed to work off only the characters provided in the alphabet and not any variation of them. Character variants aren't usually a part of an encryption algorithm (though they are quite frequently in Steganography).
If I were to enforce that capital letters be transformed, I would also enforce that final forms for Hebrew and Greek characters be transformed properly in those test cases when they end up being the last letter of a word.
Cipher algorithms should never concern themselves with variants of characters unless the variant is significant to decoding characteristics. Handling character-variant cases is not part of an encryption algorithm. If I were to implement this (and I've thought about doing this for a kata), I would implement an input normalization function to transform strings to the proper variants in the provided alphabet, and an output normalization function to handle capitalization, final forms, medial forms, initial forms, isolated forms, and all of those other different character variations that exist throughout the world... maybe even diacritical marks (which I don't even know if it's possible without making decryption easier).
The change I made specifies that the test is using a lowercase Latin alphabet, which I hope provides you with enough information to understand that test case. If you believe that resolves the issue, could you mark the kata as ready? If not can you please elaborate how I could further clarify?
Marking issue as resolved.
The details need to include a description of what should be done. What are the expected inputs and outputs? What is this class supposed to do? Things like that need to be added.
As an example, I initially didn't understand what @abc was for, and only realized what this class was supposed to do when I added in some 'puts' statements. Until then, I was trying to hard-code the Latin and Hebrew alphabets and refer to them in the encode method. Once I understood @abc, this was really easy. Having that described in the details, or even calling it something more informative like @inputted_alphabet, would have saved me an embarrassingly large amount of time.
I've changed the wording:
To:
I think a little more information at the end would be helpful. Here's the sort of thing I have in mind (modify as desired, especially the syntax of the example test case):
I've added example test cases. They're not showing up for me when I try to "Train Again", but they show up in the kata editor.
I still can't see the test cases outside of edit mode. They're there though. I've sent feedback. I'll also add it to the bugs forum. Could you mark this as ready?
Done
Now if only my Vigenere Autokey Cipher and Whitespace Interpreter katas would get enough solutions for approval :).
Not sure what the
right-to-left
stuff was about... I didn't use charAt, and my code passed just fine. Am I missing something here?It's not an issue for the actual implementation, but can be for testing.
Try copy and pasting this:
And then editing it.
Oh, okay. I can see the little note in the description now. I would be inclined to make it a little clearer this has nothing to do with the code, though.
I updated the description, do you think that will help prevent people from being thrown off?
Yeah... that's a little better. Alternatively, you could add a last bullet point instead, saying something like: "This shouldn't affect how your code works, but might help you out when debugging text and such."
It feels like the whole RTL/LTR thing is just a red herring, and maybe that's the point.
This is literally a simple substitution cipher, and pretty much duplicates the existing substitution cipher you've already published.
This comment has been hidden.
Added some historic details to the description.
Lessons learned from creating this kata: dealing with RTL text is a pain because systems either don't acknowledge it. When mixing it with LTR text, backspace and highlighting get messed up. copy/paste is weird too.