-
-
Notifications
You must be signed in to change notification settings - Fork 406
Add intergalactic-transmission exercise #1566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add intergalactic-transmission exercise #1566
Conversation
|
Thank you for contributing to Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:
Automated comment created by PR Commenter 🤖. |
angelikatyborska
left a comment
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 is a very fun exercise for a topic that doesn't get a lot of love 🙂 thank you very much!
I'm leaving a few requests for small changes.
| @@ -0,0 +1,17 @@ | |||
| defmodule Transmission do | |||
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.
The convention in elixir is that module names should match their filenames. You would need to commit to either to IntergalacticTransmission as the module name and rename this and the test module, or commit to Transmission and rename a bunch of files, as well as the module in the mix.exs file.
| @@ -0,0 +1,17 @@ | |||
| defmodule Transmission do | |||
| import Bitwise | |||
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.
It's possible to solve this exercise without bit operations (see below) so I would remove this import from the stub solution. If people use bit operations, then adding the right import should be part of the practice that they do 😁
defp parity(bits) do
list_of_bits =
bits
|> Stream.unfold(fn
<<i::1, r::bitstring>> -> {i, r}
<<>> -> nil
end)
|> Enum.into([])
Integer.mod(Enum.sum(list_of_bits), 2)
endThere 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.
Totally agree - that shouldn't have been there 😅.
Co-authored-by: Angelika Cathor <[email protected]>
cf9fdee to
7c7c64d
Compare
|
The comments seemed pretty straight forward to me. I've just pushed the updates. |
angelikatyborska
left a comment
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.
Thank you 🚀
This adds the recently added intergalactic-transmission exercise for the Elixir track.