Skip to content

[Eliud’s Eggs] Add approaches#4232

Open
Yrahcaz7 wants to merge 17 commits into
exercism:mainfrom
Yrahcaz7:eliuds-eggs-approaches
Open

[Eliud’s Eggs] Add approaches#4232
Yrahcaz7 wants to merge 17 commits into
exercism:mainfrom
Yrahcaz7:eliuds-eggs-approaches

Conversation

@Yrahcaz7

@Yrahcaz7 Yrahcaz7 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

See this issue and this forum thread.

Closes #4227 when merged.

@Yrahcaz7

Yrahcaz7 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

All three recommended approaches are done now.

@BethanyG, is there some way to mark this PR as resolving issue #4227? Is that option hidden somewhere, or do only maintainers have permission to do that?

@Yrahcaz7 Yrahcaz7 marked this pull request as ready for review June 9, 2026 19:47
@Yrahcaz7

Yrahcaz7 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@BethanyG, the PR should be ready for review now.

I ended up leaving recursion and regexes out, as recursion isn't that relevant for an exercise linked to the loops concept, and I didn't see any regex-based community solutions for the exercise.

@BethanyG

BethanyG commented Jun 9, 2026

Copy link
Copy Markdown
Member

I think Microsoft went and "Microsofed" all over this. I think you can find "closing words" under the [devlopment] section to the right-hand side. But I'll go ahead and mark it as related. I think you can also still use the phrase "this closes ___". I'll test that.

@BethanyG

BethanyG commented Jun 9, 2026

Copy link
Copy Markdown
Member

The closes keyword works. But I think you can also do it under the development section, if you can see it??

@BethanyG

BethanyG commented Jun 9, 2026

Copy link
Copy Markdown
Member

I have meetings this afternoon, but will get to reviewing ASAP after that. THANK YOU SO MUCH FOR THIS!!. I know it was a TON of work. Much appriciated. 😄

@BethanyG

BethanyG commented Jun 9, 2026

Copy link
Copy Markdown
Member

Sorry to be so quite. I have been really swamped.

@Yrahcaz7

Yrahcaz7 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Sorry to be so quite. I have been really swamped.

It's fine, I know life sometimes does that 😅

The closes keyword works. But I think you can also do it under the development section, if you can see it??

I can see the development section now, but I'm not sure if it was there before? I don't think I can edit any of the things in the bar on the right-hand side though, so it's probably a permissions thing.

@BethanyG BethanyG force-pushed the eliuds-eggs-approaches branch from e446e4a to 909ca84 Compare June 18, 2026 21:32
@BethanyG

BethanyG commented Jun 18, 2026

Copy link
Copy Markdown
Member

CRAP. I just used the GH CLI and it removed ALL of my edits. That's 4 hours worth of work ... gone.

I am going to try and back up and fix it. I hope I can.

@Yrahcaz7

Copy link
Copy Markdown
Contributor Author

😱 I really hope it can be fixed...

@BethanyG

Copy link
Copy Markdown
Member

I got he changes back, but I have renamed some files. I think the safest thing to do is to save out your most recent changes elsewhere, let me re-commit my changes, then we can re-apply your most recent ones. Does that sound OK to you?

@BethanyG

Copy link
Copy Markdown
Member

Alright. I think (I hope and I pray) that things are resolved. That will teach me to trust that gh CLI will do the right thing. UGH.

Apologies for making changes directly instead of suggesting. There was enough to review that I decided to pull it locally -- but there's no mechanism for then "suggesting". My recommendation is to give it a quick read-over, and if you hate the changes I've made (or I have borked yours), you can overwrite them, or ask me to revert them.

An explanation about changing parameter to argument. Yes -- it is pedantic, but also important. When you write a function and put in a names in the function signature ... those are parameters. When you call a function with some values, you are giving it an argument.

See argument and parameter for all the gory details.

@BethanyG

Copy link
Copy Markdown
Member

AARG. Looks like to really see the changes, you have to look at the individual commits. Dang. I am *SO SORRY).

@Yrahcaz7

Copy link
Copy Markdown
Contributor Author

An explanation about changing parameter to argument. Yes -- it is pedantic, but also important. When you write a function and put in a names in the function signature ... those are parameters. When you call a function with some values, you are giving it an argument.

It seems like it's worth it to change them to argument to avoid confusing learners. That was a good catch, I kind of forgot about that distiction.

AARG. Looks like to really see the changes, you have to look at the individual commits. Dang. I am *SO SORRY).

Hmm... I think I have a way to avoid that 😄

@BethanyG

Copy link
Copy Markdown
Member

It seems like it's worth it to change them to argument to avoid confusing learners. That was a good catch, I kind of forgot about that distinction.

A lot of times it's sorta a distinction without a difference ...until you get into all the crazy-pants stuff Python does with parameters. They take typehints (arguments don't). AND they have 5 different types (positional or keyword, positional-only, keyword-only, variable-positional, variable-keyword) - yeah, that's about 3 too many. And then there is the horrifying foot-gun of setting a mutable data structure as a default argument (which takes the form of a named parameter "pre-assigned" a value that's an empty list)

I am NOT looking forward to writing up the concept on those. ;-)

@Yrahcaz7

Yrahcaz7 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Yeah... That sounds like quite an ordeal. At least the basics of variable ones were already covered by "Unpacking And Multiple Assignment", and type-hints could be a separate concept.

@BethanyG

Copy link
Copy Markdown
Member

Type-hints will certainly be its own concept. And likely a later one. If we are going to teach type-hints then we need to enforce good ones. And that means wiring up something like my-py or another static type checker. Fun times.

@Yrahcaz7

Yrahcaz7 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

AARG. Looks like to really see the changes, you have to look at the individual commits. Dang. I am *SO SORRY).

Hmm... I think I have a way to avoid that 😄

In case you're curious, I did this by:

  • Backing up my current local files
  • Deleting the local branch
  • Getting the branch back from the remote
  • Replacing the files (but not the .git folder!) with the backup
  • Using a tool with diff visualization to see the combined changes (albeit backwards)

Kind of hacky, but it works!

@Yrahcaz7

Yrahcaz7 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

The convert-to-binary-string variation 3 additions aren't really making sense to me. Using int() would work if sum() was used, but this is the len() variant. len() doesn't care if the elements are True or False:

def egg_count(display_value):
    return len([bool(int(digit)) for digit in bin(display_value)[2:]])

print(egg_count(0b10010))
#=> 5

@BethanyG

BethanyG commented Jun 19, 2026

Copy link
Copy Markdown
Member

We can remove it. My thinking was that len() works either way (and that bools are subtype of int). But its not a hill I want to climb or die on. 😄

@Yrahcaz7

Yrahcaz7 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

It was interesting to consider, but having the if clause seems necessary. I tried running the tests on the new sub-variant to make sure, and it didn't pass. (You can run the tests yourself to be sure!)

also revert most additions to `convert-to-binary-string` variation 3, as agreed upon
@BethanyG

BethanyG commented Jun 19, 2026

Copy link
Copy Markdown
Member

oh DUH. I am an idiot. of course it needs the if clause - we're using len(). 🙄 Glad you are double checking me, I can get real creative. And that's not always a good thing!!

@Yrahcaz7

Copy link
Copy Markdown
Contributor Author

The other edits were really good, though! Other than that issue, I just fixed/improved a few small things.

@BethanyG

Copy link
Copy Markdown
Member

did you do the pushy-push thing? Are we ready to merge, or should we marinate it until tomm? 😄

@Yrahcaz7

Copy link
Copy Markdown
Contributor Author

did you do the pushy-push thing?

If you mean force-pushing, then no, it was a normal push.

Are we ready to merge, or should we marinate it until tomm? 😄

Probably one or both of us should sense-check the latest edits tomorrow with fresh eyes.

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.

Add approaches for the Eliud’s Eggs exercise

2 participants