Repository navigation
affine-cipher: Add new exercise - #1600
Conversation
FridaTveit
left a comment
There was a problem hiding this comment.
This is looking really good @lemoncurry, thanks for adding this exercise! 😄
I've left a few comments, feel free to ask questions or disagree with me 🙂
| return String.join(" ", words); | ||
| } | ||
|
|
||
| private static String translate(String text, int keyA, int keyB, int mode) { |
There was a problem hiding this comment.
It looks like you're using mode essentially as a switch that should only have one of two values? In which case maybe using a boolean would be better, e.g. something like shouldDecode? Or you could use an enum? Not very important, but if there should only be two possible values then it's preferrable to use a type with only two values 🙂
There was a problem hiding this comment.
Great suggestion, thank you!
FridaTveit
left a comment
There was a problem hiding this comment.
This looks great @lemoncurry! 😄 I just have two minor comments 🙂 Apart from those things it looks ready to merge! 🙂
| private AffineCipher affineCipher; | ||
|
|
||
| @Before | ||
| public void genAffineCipfer() { |
There was a problem hiding this comment.
Very minor thing, should this be genAfficeCipher? 🙂
There was a problem hiding this comment.
yes, of course, thank you! 😄
| @Test | ||
| public void testEncodeYes() { | ||
| assertEquals("xbt", affineCipher.encode("yes", 5, 7) | ||
| ); |
There was a problem hiding this comment.
I still think this should be on the previous line? So that it becomes:
assertEquals("xbt", affineCipher.encode("yes", 5, 7));
What do you think? 🙂
There was a problem hiding this comment.
yes, seems I didn't exactly understand your previous comment. Of course I will correct it! 😃
FridaTveit
left a comment
There was a problem hiding this comment.
Great, thanks @lemoncurry! Excellent new exercise! 😄
Reviewer Resources:
Track Policies