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

Add Eliuds Eggs exercise #639

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

homersimpsons
Copy link
Contributor

@homersimpsons homersimpsons commented Feb 25, 2024

Copy link
Contributor

@tomasnorre tomasnorre left a comment

Choose a reason for hiding this comment

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

LGTM, with few adjustments.

exercises/practice/eliuds-eggs/.meta/config.json Outdated Show resolved Hide resolved
exercises/practice/eliuds-eggs/.meta/example.php Outdated Show resolved Hide resolved
@tomasnorre
Copy link
Contributor

  • Should I add instruction about binary operators ?

I personally think that would be helpful, I would appreciate information on that, to easier solve the exercise.

@homersimpsons homersimpsons force-pushed the exercise/eliuds-eggs branch 2 times, most recently from b22dd93 to 6d28ec7 Compare February 25, 2024 18:03
@homersimpsons
Copy link
Contributor Author

homersimpsons commented Feb 25, 2024

  • Should I add instruction about binary operators ?

I personally think that would be helpful, I would appreciate information on that, to easier solve the exercise.

I did add some instructions in: https://github.com/exercism/php/pull/639/files#diff-1b8add07daeefcbb201624c607300ed14d8a926741b6a6d9562b7faa1c9b291f

Do you think this is enough?

I think the current should be enough for someone providing a working solution such as:

$displayValue = 89;
$eggCount = (($displayValue & 0b00000001) > 0)
          + (($displayValue & 0b00000010) > 0)
          + (($displayValue & 0b00000100) > 0)
          + (($displayValue & 0b00001000) > 0)
          + (($displayValue & 0b00010000) > 0)
          + (($displayValue & 0b00100000) > 0)
          + (($displayValue & 0b01000000) > 0)
          + (($displayValue & 0b10000000) > 0);
// => 4

Copy link
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

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

Nice recursive solution to the problem. Add the UUIDs if you want to, but we can merge it as is.

@mk-mxp
Copy link
Contributor

mk-mxp commented Feb 25, 2024

  • Should I add instruction about binary operators ?

I did add some instructions in: https://github.com/exercism/php/pull/639/files#diff-1b8add07daeefcbb201624c607300ed14d8a926741b6a6d9562b7faa1c9b291f

Do you think this is enough?

I think that is fine. One does not need much knowledge about binary operators, the PHP manual page will be enough.

@mk-mxp mk-mxp added x:action/create Work on something from scratch x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/large Large amount of work x:rep/large Large amount of reputation labels Feb 25, 2024
@homersimpsons homersimpsons merged commit 1ed86e7 into exercism:main Feb 25, 2024
12 checks passed
@homersimpsons homersimpsons deleted the exercise/eliuds-eggs branch February 25, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/create Work on something from scratch x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation x:size/large Large amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants