Skip to content

Commit 2fbf89f

Browse files
authored
Adding analyzer feedback for captains-log concept exercise (#2755)
* Adding analyzer feedback for captains-log concept exercise * Adding extra information to the nextInt comment * Adding actionable, and two informative comments, removing the essential comments * Updating comments regarding nextDouble(double,double) and nextInt(int, int) to only be taking into account if the user has java version 17 or higher
1 parent c1f9ee4 commit 2fbf89f

File tree

1 file changed

+18
-0
lines changed
  • exercises/concept/captains-log/.meta

1 file changed

+18
-0
lines changed

exercises/concept/captains-log/.meta/design.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,21 @@
1919
- `strings`: know how to use string formatting.
2020
- `numbers`: know how to apply basic mathematical operators.
2121
- `arrays`: know how to retrieve array elements by their index.
22+
23+
## Analyzer
24+
25+
This exercise could benefit from the following rules in the [analyzer]:
26+
27+
- `actionable`: If the solution hardcodes the number of planet classes in `randomPlanetClass`, instruct the student to use `length` method instead.
28+
- `informative`: If the solution uses Java version >= 17 and [`RandomGenerator.nextDouble(double)`][nextDouble(double)], inform the student that they could use [`RandomGenerator.nextDouble(double, double)`][nextDouble(double, double)] to achieve a clearer solution.
29+
- `informative`: If the solution uses Java version >= 17 and [`RandomGenerator.nextInt(int)`][nextInt(int)], inform the student that they could use [`RandomGenerator.nextInt(int, int)`][nextInt(int, int)] to achieve a clearer solution.
30+
- `informative`: If the solution uses `String.format` in the `randomShipRegistryNumber` method, inform the student that this cause a small performance penalty compared to string concatenation.
31+
32+
If the solution does not receive any of the above feedback, it must be exemplar.
33+
Leave a `celebratory` comment to celebrate the success!
34+
35+
[analyzer]: https://github.com/exercism/java-analyzer
36+
[nextDouble(double)]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html#nextDouble(double)
37+
[nextDouble(double, double)]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html#nextDouble(double,double)
38+
[nextInt(int)]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html#nextInt(int)
39+
[nextInt(int, int)]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/random/RandomGenerator.html#nextInt(int,int)

0 commit comments

Comments
 (0)