Skip to content

Commit 581e9b6

Browse files
authored
Merge pull request #86 from Project516/copilot/review-javadoc-organization
Fix JavaDoc inaccuracies and missing documentation
2 parents 4a19def + 2e3b528 commit 581e9b6

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

app/src/main/java/io/github/project516/NumberGuessingGame/CheckGuess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
public class CheckGuess {
88
/**
9-
* Validates that a guess is within the acceptable range (1-100).
9+
* Validates that a guess is within the acceptable range (1-101).
1010
*
1111
* @param guess the user's guess to validate
1212
* @throws IllegalArgumentException if the guess is less than 1 or greater than 101

app/src/main/java/io/github/project516/NumberGuessingGame/HighScore.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ public int compareTo(HighScore other) {
5858
return Integer.compare(this.numberOfGuesses, other.numberOfGuesses);
5959
}
6060

61+
/**
62+
* Returns a string representation of this high score in the format "username: X guess(es)".
63+
*
64+
* @return a formatted string containing the username and number of guesses
65+
*/
6166
@Override
6267
public String toString() {
6368
return username + ": " + numberOfGuesses + " guess" + (numberOfGuesses == 1 ? "" : "es");

app/src/main/java/io/github/project516/NumberGuessingGame/RandomNumber.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public class RandomNumber {
1212
Random random = new Random();
1313

1414
/**
15-
* Generates a random integer between 0 and the specified maximum value (inclusive).
15+
* Generates a random integer between 0 (inclusive) and the specified maximum value (inclusive).
1616
*
17-
* @param max the maximum value for the random number
18-
* @return a random integer between 0 and max (inclusive)
17+
* @param max the maximum value for the random number (inclusive)
18+
* @return a random integer in the range [0, max]
1919
*/
2020
int number(int max) {
2121

app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@
55
import java.io.InputStream;
66
import java.io.InputStreamReader;
77

8-
/**
9-
* Reads version information for the Number Guessing Game. Currently returns a placeholder version
10-
* string.
11-
*/
8+
/** Reads version information for the Number Guessing Game from the version.txt resource file. */
129
public class ReadVersionFile {
1310
/**
1411
* Retrieves the current version of the game by reading from the version.txt resource file.
1512
*
1613
* @return the version string
1714
*/
1815
public String readVersion() {
19-
String content = "1.0.0"; // Placeholder version
16+
String content = "1.0.0"; // Default fallback version
2017
try (InputStream inputStream =
2118
getClass().getClassLoader().getResourceAsStream("version.txt");
2219
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {

0 commit comments

Comments
 (0)