Skip to content

Commit

Permalink
Applying suggestions
Browse files Browse the repository at this point in the history
Adding celebratory comment
Updating analyzer comments to require the user to implement a for and for-each loop
Updating reference resolution
  • Loading branch information
manumafe98 committed Jan 31, 2024
1 parent dffaccd commit 1a13926
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions exercises/concept/bird-watcher/.meta/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ This exercise's prerequisites Concepts are:

This exercise could benefit from the following rules in the [analyzer]:

- `essential`: Verify that the solution does not hard-code the arrays used by the tests (`{2, 5, 0, 7, 4, 1 }`, `{0, 2, 5, 3, 7, 8, 4}`)
- `actionable`: If the student did not use `clone` in the constructor to make a copy of the array, instruct them to do so.
- `informative`: If the student used a different loop than a `For-Each` one in the methods `hasDayWithoutBirds` and `getBusyDays`, inform them that the solution can be improve using it.
- `essential`: Verify that the solution does not hard-code the array passed in the constructor of the class `{2, 5, 0, 7, 4, 1 }`.
- `essential`: The solution requires that the user uses at least once a `For` loop, the method `getCountForFirstDays()` could be a great place to do it.
- `essential`: The solution requires that the user uses at least once a `For-Each` loop, the method `getBusyDays()` could be a great place to do it.
- `actionable`: If the student did not use `clone` in the constructor to make a copy of the array, instruct them to do so. This is because if not, allows code outside the class to mutate the contents of the array.

If the solution does not receive any of the above feedback, it must be exemplar.
Leave a `celebratory` comment to celebrate the success!

[analyzer]: https://github.com/exercism/java-analyzer
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ public BirdWatcher(int[] birdsPerDay) {
}

public int[] getLastWeek() {
return birdsPerDay.clone();
return new int[] { 0, 2, 5, 3, 7, 8, 4 };
}

public int getToday() {
return birdsPerDay[birdsPerDay.length - 1];
}

public void incrementTodaysCount() {
birdsPerDay[birdsPerDay.length - 1] = birdsPerDay[birdsPerDay.length - 1] + 1;
birdsPerDay[birdsPerDay.length - 1]++;
}

public boolean hasDayWithoutBirds() {
Expand Down

0 comments on commit 1a13926

Please sign in to comment.