-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add affine-cipher exercise #709
base: main
Are you sure you want to change the base?
Conversation
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
Note that there are 2 trailing commas in the |
No need to create a new PR at this time. You can even do a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but I would make the changes to the return name in encode and decode.
I think return $ret
could be correct, but it is correct for every case of returning a return, and so it is less than informative. Most other exercises use returns that are named descriptive names for their return, and according to the problem being solved.
I would like to continue that tradition for the example code.
$ret .= chr( ( ( $a * ( ord( lc($_) ) - 97 ) + $b ) % 26 ) + 97 ); | ||
} | ||
} | ||
return $ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both cases of encode
and decode
the return appears to b the message (regardless of the type of message).
I would not use return $ret
as it does not describe "message" as the return, in either case.
Forum discussion located: https://forum.exercism.org/t/add-affine-cipher-exercise/15516