Skip to content

Commit

Permalink
pop-count: rename to eliuds-eggs (#2716)
Browse files Browse the repository at this point in the history
* Rename the `pop-count` exercise to `eliuds-eggs`.

* Renaming exercise from pop count to eliuds eggs

* Fixing typo on config.json

---------

Co-authored-by: manumafe98 <[email protected]>
  • Loading branch information
ErikSchierboom and manumafe98 authored Feb 2, 2024
1 parent de59086 commit e36fdc5
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 12 deletions.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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

0 comments on commit e36fdc5

Please sign in to comment.