Skip to content

affine-cipher: Add new exercise - #1600

Merged
FridaTveit merged 8 commits into
exercism:masterfrom
lemoncurry:add-affine-cipher
Oct 17, 2018
Merged

FridaTveit merged 8 commits into
exercism:masterfrom
lemoncurry:add-affine-cipher

Conversation

@lemoncurry

Copy link
Copy Markdown
Contributor

Reviewer Resources:

Track Policies

@lemoncurry lemoncurry changed the title [WIP] affine-cipher: Add new exercise affine-cipher: Add new exercise Oct 13, 2018

@FridaTveit FridaTveit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion, thank you!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙂

@FridaTveit FridaTveit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor thing, should this be genAfficeCipher? 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, of course, thank you! 😄

@Test
public void testEncodeYes() {
assertEquals("xbt", affineCipher.encode("yes", 5, 7)
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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? 🙂

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, seems I didn't exactly understand your previous comment. Of course I will correct it! 😃

@FridaTveit FridaTveit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks @lemoncurry! Excellent new exercise! 😄

@FridaTveit
FridaTveit merged commit 39c8aef into exercism:master Oct 17, 2018
@lemoncurry
lemoncurry deleted the add-affine-cipher branch October 17, 2018 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants