Skip to content
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

Proposed new exercise: Eliud's Eggs #2333

Merged
merged 4 commits into from
Oct 17, 2023
Merged

Conversation

keiravillekode
Copy link
Contributor

@keiravillekode keiravillekode commented Oct 12, 2023

Count the 1 bits in a number.

Name and description by @vaeng
https://forum.exercism.org/t/new-exercise-suggestion-pop-count/7632

Example implementation:
exercism/vlang@main...keiravillekode:vlang:eliuds-eggs

Nibbly November implementations (mips, wasm, x86-64-assembly) to follow.

website-icons issue: exercism/website-icons#159

@keiravillekode keiravillekode requested a review from a team as a code owner October 12, 2023 10:14
@github-actions
Copy link
Contributor

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


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.

Fix issues lint reported in eliuds-eggs description.
Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely work! Just a few couple of comments.

@@ -0,0 +1,2 @@
title = "Eliud's Eggs"
blurb = "Count the 1 bits in a number"
Copy link
Member

@ErikSchierboom ErikSchierboom Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add your name and vaeng's as source and the forum URL as source_url:

Suggested change
blurb = "Count the 1 bits in a number"
blurb = "Count the 1 bits in a number"
source = "keiravillekode, vaeng"
source_url = "https://forum.exercism.org/t/new-exercise-suggestion-pop-count/7632/4"

We did something similar for resistor-color: https://github.com/exercism/problem-specifications/blob/main/exercises/resistor-color/metadata.toml

P.S. I don't know if you'd like to use your own name or you nickname as source (same goes for vaeng)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My real name is fine :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source and source_url added

exercises/eliuds-eggs/description.md Outdated Show resolved Hide resolved
@@ -0,0 +1,50 @@
# Description

Your friend Eliud inherited a farm from her grandma Tigist. Her granny was an inventor and had a tendency to build things in an overly complicated manner. The chicken coop has a digital display showing an encoded number representing the positions of all eggs that could be picked up.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use a single line per sentence?

Suggested change
Your friend Eliud inherited a farm from her grandma Tigist. Her granny was an inventor and had a tendency to build things in an overly complicated manner. The chicken coop has a digital display showing an encoded number representing the positions of all eggs that could be picked up.
Your friend Eliud inherited a farm from her grandma Tigist.
Her granny was an inventor and had a tendency to build things in an overly complicated manner.
The chicken coop has a digital display showing an encoded number representing the positions of all eggs that could be picked up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have written the forum post that way. Next time :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now using one line per sentence

{
"uuid": "559e789d-07d1-4422-9004-3b699f83bca3",
"description": "pop-count of 0",
"property": "popCount",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that I have a better suggestion, but does popCount fit the domain? I wonder if eggCount is a more descriptive name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, all eggs, please. That makes it easier for users to see the connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now using eggCount for function name,

"cases": [
{
"uuid": "559e789d-07d1-4422-9004-3b699f83bca3",
"description": "pop-count of 0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the description could focus a bit more on what makes this case unique. In this case, an alternative description could be:

Suggested change
"description": "pop-count of 0",
"description": "no eggs",

or:

Suggested change
"description": "pop-count of 0",
"description": "all zeros",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest to make the descriptions about eggs, rather than the mechanics behind it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Descriptions updated

@ErikSchierboom
Copy link
Member

@exercism/reviewers I'd appreciate you all taking a look at this too. We could use this exercise for Nibbly November.

@@ -0,0 +1,50 @@
{
"exercise": "eliuds-eggs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the practice exercises have more direct names which map to the problem being solved, like pop count. I may be mistaken but I think the cute names are only used in concept exercises.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exercise renamed to Pop Count

"cases": [
{
"uuid": "559e789d-07d1-4422-9004-3b699f83bca3",
"description": "all zeros",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, maybe do:

Suggested change
"description": "all zeros",
"description": "0 eggs",

Comment on lines 11 to 13
1. Scan the potential egg-laying spots and mark down a `1` for an existing egg or a `0` for an empty spot.
2. Convert the number from binary to decimal
3. Show the result on the display
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Scan the potential egg-laying spots and mark down a `1` for an existing egg or a `0` for an empty spot.
2. Convert the number from binary to decimal
3. Show the result on the display
1. Scan the potential egg-laying spots and mark down a `1` for an existing egg or a `0` for an empty spot.
2. Convert the number from binary to decimal.
3. Show the result on the display.

@keiravillekode
Copy link
Contributor Author

All comments addressed

@kotp kotp merged commit fbb50d2 into exercism:main Oct 17, 2023
7 checks passed
@keiravillekode keiravillekode deleted the eliuds-eggs branch October 17, 2023 07:24
glennj added a commit to glennj/exercism-tcl that referenced this pull request Oct 18, 2023
glennj added a commit to exercism/tcl that referenced this pull request Oct 18, 2023
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.

5 participants