-
-
Notifications
You must be signed in to change notification settings - Fork 157
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 Eliud's eggs exercise #694
Conversation
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.
Would you mind moving its config entry after complex-numbers? There are two PRs open that modify the main config, and merging it as-is will create conflicts in both.
Also, adding 'basics' as a prerequisite would be nice to have.
79ada38
to
10f7b5b
Compare
@kahgoh Since the instructions mention a |
Hey @tasxatzial, I just had a look at the I don't think we need stop students from using the other bitwise operations. For example, another strategy is to use bit shifting (to divide by two) and bitwise & to work out when to increment the count (for example in this C solution or this Python one). |
I see, so a solution that looks like so would be considered ok?
This converts to a binary string (via Java interop), constructs a list from 0 to the number of its digits - 1, maps bit-test over that list to check if the bit at each index is true or false, and finally counts the number of true values. |
Okay, I'll allow the Side note: This appears to be a great exercise for exploring different approaches. |
9158458
to
10f7b5b
Compare
I’m also thinking that 'don't use bit-count functionality' could easily be interpreted as 'don't use bit-* and count functions,' since bit-count isn't a Clojure function. I'll be monitoring the solutions closely, but I'll most likely add an appendix to prevent confusion. Then again, mentioning the bit-* functions might make people lean towards using them instead of thinking of alternative ways to solve the problem. Forum thread: |
This is one of the 48in24 exercises