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.
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.
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.
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.
Totally agree - that shouldn't have been there 😅.
Co-authored-by: Angelika Cathor <angelikacathor@fastmail.com>
cf9fdee to
7c7c64d
Compare
|
The comments seemed pretty straight forward to me. I've just pushed the updates. |
This adds the recently added intergalactic-transmission exercise for the Elixir track.