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

pop-count: rename to eliuds-eggs #2716

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
"difficulty": 3
},
{
"slug": "pop-count",
"slug": "eliuds-eggs",
"name": "Eliud's Eggs",
"uuid": "2d5b6404-3315-48c1-892f-b594a960e7a1",
"practices": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
],
"files": {
"solution": [
"src/main/java/PopCount.java"
"src/main/java/EliudsEggs.java"
],
"test": [
"src/test/java/PopCountTest.java"
"src/test/java/EliudsEggsTest.java"
],
"example": [
".meta/src/reference/java/PopCount.java"
".meta/src/reference/java/EliudsEggs.java"
],
"invalidator": [
"build.gradle"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public class PopCount {
public class EliudsEggs {
public int eggCount(int number) {
var count = 0;
var remaining = number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public class PopCount {
public class EliudsEggs {
public int eggCount(int number) {
throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@

import static org.assertj.core.api.Assertions.assertThat;

public class PopCountTest {
public class EliudsEggsTest {
@Test
@DisplayName("0 eggs")
public void test0Eggs() {
assertThat(new PopCount().eggCount(0))
assertThat(new EliudsEggs().eggCount(0))
.isEqualTo(0);
}

@Disabled("Remove to run test")
@Test
@DisplayName("1 egg")
public void test1Egg() {
assertThat(new PopCount().eggCount(16))
assertThat(new EliudsEggs().eggCount(16))
.isEqualTo(1);
}

@Disabled("Remove to run test")
@Test
@DisplayName("4 eggs")
public void test4Eggs() {
assertThat(new PopCount().eggCount(89))
assertThat(new EliudsEggs().eggCount(89))
.isEqualTo(4);
}

@Disabled("Remove to run test")
@Test
@DisplayName("13 eggs")
public void test13Eggs() {
assertThat(new PopCount().eggCount(2000000000))
assertThat(new EliudsEggs().eggCount(2000000000))
.isEqualTo(13);
}
}
2 changes: 1 addition & 1 deletion exercises/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ include 'practice:perfect-numbers'
include 'practice:phone-number'
include 'practice:pig-latin'
include 'practice:poker'
include 'practice:pop-count'
include 'practice:eliuds-eggs'
include 'practice:pov'
include 'practice:prime-factors'
include 'practice:protein-translation'
Expand Down