From ba9f49533004d028f40c4fb20ea74b8923e77805 Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:56:41 -0600 Subject: [PATCH 01/11] Update release.yml hotfix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8d3478..bbcdabf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: uses: softprops/action-gh-release@v2 with: files: | - ./app/build/libs/app.jar + ./app/build/libs/app-all.jar ./numberguessinggame.deb ./archive.zip ./NumberGuessingGame-windows.zip From fd43ff8c3fec39a253fee5e24a0fd0fb093578a0 Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:06:13 +0000 Subject: [PATCH 02/11] placeholders --- .../github/project516/NumberGuessingGame/ReadVersionFile.java | 2 +- app/src/main/resources/version.txt | 2 +- debian-package/DEBIAN/control | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java b/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java index d76a8d2..305222d 100644 --- a/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java +++ b/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java @@ -16,7 +16,7 @@ public class ReadVersionFile { * @return the version string */ public String readVersion() { - String content = "0.1.0"; // Placeholder version + String content = "1.0.0"; // Placeholder version try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream("version.txt"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { diff --git a/app/src/main/resources/version.txt b/app/src/main/resources/version.txt index d917d3e..8da0a6e 100644 --- a/app/src/main/resources/version.txt +++ b/app/src/main/resources/version.txt @@ -1 +1 @@ -0.1.2 +rolling \ No newline at end of file diff --git a/debian-package/DEBIAN/control b/debian-package/DEBIAN/control index 9c95902..2805dfe 100644 --- a/debian-package/DEBIAN/control +++ b/debian-package/DEBIAN/control @@ -1,5 +1,5 @@ Package: numberguessinggame -Version: 0.1.2 +Version: 1.0.0 Section: games Priority: optional Architecture: all From 013b21e01af11ae33ddca4f1def7234942cfba7a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:19:24 +0000 Subject: [PATCH 03/11] Initial plan From 68ef57f092b78891e83c340c9156624bb721805d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:20:16 +0000 Subject: [PATCH 04/11] Initial plan From a93e0ffe0a42c3344a4dba23f5832f68c4fc3019 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:24:50 +0000 Subject: [PATCH 05/11] Fix JavaDoc documentation inaccuracies in CheckGuess, RandomNumber, and ReadVersionFile Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com> --- .../io/github/project516/NumberGuessingGame/CheckGuess.java | 2 +- .../github/project516/NumberGuessingGame/RandomNumber.java | 6 +++--- .../project516/NumberGuessingGame/ReadVersionFile.java | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/github/project516/NumberGuessingGame/CheckGuess.java b/app/src/main/java/io/github/project516/NumberGuessingGame/CheckGuess.java index 5eb0af9..ece1d09 100644 --- a/app/src/main/java/io/github/project516/NumberGuessingGame/CheckGuess.java +++ b/app/src/main/java/io/github/project516/NumberGuessingGame/CheckGuess.java @@ -6,7 +6,7 @@ */ public class CheckGuess { /** - * Validates that a guess is within the acceptable range (1-100). + * Validates that a guess is within the acceptable range (1-101). * * @param guess the user's guess to validate * @throws IllegalArgumentException if the guess is less than 1 or greater than 101 diff --git a/app/src/main/java/io/github/project516/NumberGuessingGame/RandomNumber.java b/app/src/main/java/io/github/project516/NumberGuessingGame/RandomNumber.java index 76d6949..5490449 100644 --- a/app/src/main/java/io/github/project516/NumberGuessingGame/RandomNumber.java +++ b/app/src/main/java/io/github/project516/NumberGuessingGame/RandomNumber.java @@ -12,10 +12,10 @@ public class RandomNumber { Random random = new Random(); /** - * Generates a random integer between 0 and the specified maximum value (inclusive). + * Generates a random integer between 0 (inclusive) and the specified maximum value (inclusive). * - * @param max the maximum value for the random number - * @return a random integer between 0 and max (inclusive) + * @param max the maximum value for the random number (inclusive) + * @return a random integer in the range [0, max] */ int number(int max) { diff --git a/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java b/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java index 305222d..4802a12 100644 --- a/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java +++ b/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java @@ -5,10 +5,7 @@ import java.io.InputStream; import java.io.InputStreamReader; -/** - * Reads version information for the Number Guessing Game. Currently returns a placeholder version - * string. - */ +/** Reads version information for the Number Guessing Game from the version.txt resource file. */ public class ReadVersionFile { /** * Retrieves the current version of the game by reading from the version.txt resource file. From d35c5ae5b313d9f7fb2409192b9d1728bae11d36 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:26:37 +0000 Subject: [PATCH 06/11] Improve compression for release packages Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- README.md | 4 ++-- package-linux.sh | 11 ++++++----- package-macos.sh | 4 ++-- package-win.sh | 4 ++-- package-zip.bat | 4 ++-- package-zip.sh | 4 ++-- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bbcdabf..400bc78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,4 +50,4 @@ jobs: ./archive.zip ./NumberGuessingGame-windows.zip ./NumberGuessingGame-macos.zip - ./NumberGuessingGame-linux.tar.gz + ./NumberGuessingGame-linux.tar.xz diff --git a/README.md b/README.md index 17449f6..e652861 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Download the platform-specific package with bundled JRE from the [latest release - **Windows**: `NumberGuessingGame-windows.zip` (no Java installation required) - **macOS**: `NumberGuessingGame-macos.zip` (no Java installation required) -- **Linux**: `NumberGuessingGame-linux.tar.gz` (no Java installation required) +- **Linux**: `NumberGuessingGame-linux.tar.xz` (no Java installation required) Extract the downloaded archive and run: @@ -183,7 +183,7 @@ Run the following scripts to create platform-specific packages with bundled JRE: ```bash ./package-win.sh # Creates NumberGuessingGame-windows.zip ./package-macos.sh # Creates NumberGuessingGame-macos.zip -./package-linux.sh # Creates NumberGuessingGame-linux.tar.gz +./package-linux.sh # Creates NumberGuessingGame-linux.tar.xz ``` These packages include a bundled JRE and do not require Java to be installed on the target system. They are automatically built and uploaded to GitHub Releases via GitHub Actions. diff --git a/package-linux.sh b/package-linux.sh index 26d452a..6dc54f6 100755 --- a/package-linux.sh +++ b/package-linux.sh @@ -1,7 +1,7 @@ #!/bin/sh # Script to create a Linux package with bundled JRE for Number Guessing Game # This creates a self-contained package that doesn't require Java to be installed -# Output: NumberGuessingGame-linux.tar.gz +# Output: NumberGuessingGame-linux.tar.xz # Exit immediately if any command fails set -e @@ -16,6 +16,7 @@ ADOPTIUM_BASE_URL="https://api.adoptium.net/v3/binary/latest/8/ga" # Clean up any previous builds rm -rf ${PACKAGE_NAME} rm -rf ${JRE_DIR} +rm -f ${PACKAGE_NAME}.tar.xz rm -f ${PACKAGE_NAME}.tar.gz # Build the application using Gradle @@ -58,14 +59,14 @@ EOF # Make the run script executable chmod +x ${PACKAGE_NAME}/run.sh -# Create the final tar.gz archive -echo "Creating tar.gz archive..." -tar -czf ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}/ +# Create the final tar.xz archive with maximum compression +echo "Creating tar.xz archive..." +tar -cJf ${PACKAGE_NAME}.tar.xz ${PACKAGE_NAME}/ # Clean up temporary directories rm -rf ${PACKAGE_NAME} rm -rf ${JRE_DIR} echo "" -echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.gz" +echo "✓ Linux package with bundled JRE created: ${PACKAGE_NAME}.tar.xz" echo "" diff --git a/package-macos.sh b/package-macos.sh index b87bc2e..da7e747 100755 --- a/package-macos.sh +++ b/package-macos.sh @@ -58,9 +58,9 @@ EOF # Make the run script executable chmod +x ${PACKAGE_NAME}/run.sh -# Create the final zip archive +# Create the final zip archive with maximum compression echo "Creating zip archive..." -zip -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ +zip -9 -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ # Clean up temporary directories rm -rf ${PACKAGE_NAME} diff --git a/package-win.sh b/package-win.sh index 5f9d671..c2f55da 100755 --- a/package-win.sh +++ b/package-win.sh @@ -54,9 +54,9 @@ jre\bin\java.exe -jar game.jar @pause EOF -# Create the final zip archive +# Create the final zip archive with maximum compression echo "Creating zip archive..." -zip -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ +zip -9 -r ${PACKAGE_NAME}.zip ${PACKAGE_NAME}/ # Clean up temporary directories rm -rf ${PACKAGE_NAME} diff --git a/package-zip.bat b/package-zip.bat index bdc0e6a..5baaeaa 100644 --- a/package-zip.bat +++ b/package-zip.bat @@ -17,8 +17,8 @@ copy scripts\run.sh NumberGuessingGame\run.sh copy README.md NumberGuessingGame\README.txt copy LICENSE NumberGuessingGame\LICENSE -REM Create the ZIP archive using PowerShell -powershell -command "Compress-Archive -Path NumberGuessingGame -DestinationPath archive.zip -Force" +REM Create the ZIP archive using PowerShell with maximum compression +powershell -command "Compress-Archive -Path NumberGuessingGame -DestinationPath archive.zip -CompressionLevel Optimal -Force" REM Clean up temporary directory rmdir /s /q NumberGuessingGame diff --git a/package-zip.sh b/package-zip.sh index 712ed00..f4cb1f6 100755 --- a/package-zip.sh +++ b/package-zip.sh @@ -22,8 +22,8 @@ cp -r scripts/run.sh NumberGuessingGame/run.sh cp -r README.md NumberGuessingGame/README.txt cp -r LICENSE NumberGuessingGame/LICENSE -# Create the ZIP archive -zip -r archive.zip NumberGuessingGame/ +# Create the ZIP archive with maximum compression +zip -9 -r archive.zip NumberGuessingGame/ # Clean up temporary directory rm -rf NumberGuessingGame From 4e840d186de149e045cb317551660b0dab93e0bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:26:51 +0000 Subject: [PATCH 07/11] Add JavaDoc for HighScore.toString() method Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com> --- .../io/github/project516/NumberGuessingGame/HighScore.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/io/github/project516/NumberGuessingGame/HighScore.java b/app/src/main/java/io/github/project516/NumberGuessingGame/HighScore.java index b5446f2..3163ed1 100644 --- a/app/src/main/java/io/github/project516/NumberGuessingGame/HighScore.java +++ b/app/src/main/java/io/github/project516/NumberGuessingGame/HighScore.java @@ -58,6 +58,11 @@ public int compareTo(HighScore other) { return Integer.compare(this.numberOfGuesses, other.numberOfGuesses); } + /** + * Returns a string representation of this high score in the format "username: X guess(es)". + * + * @return a formatted string containing the username and number of guesses + */ @Override public String toString() { return username + ": " + numberOfGuesses + " guess" + (numberOfGuesses == 1 ? "" : "es"); From 2e3b528186e7af6405edff44105d06add1cdd8e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:28:27 +0000 Subject: [PATCH 08/11] Update inline comment to match updated JavaDoc terminology Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com> --- .../github/project516/NumberGuessingGame/ReadVersionFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java b/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java index 4802a12..2cac0c8 100644 --- a/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java +++ b/app/src/main/java/io/github/project516/NumberGuessingGame/ReadVersionFile.java @@ -13,7 +13,7 @@ public class ReadVersionFile { * @return the version string */ public String readVersion() { - String content = "1.0.0"; // Placeholder version + String content = "1.0.0"; // Default fallback version try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream("version.txt"); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { From b355dfea42e5c22803278c7213fd5362e682a1fd Mon Sep 17 00:00:00 2001 From: eycastillo <138796702+Project516@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:39:23 -0600 Subject: [PATCH 09/11] update README --- .idea/compiler.xml | 2 +- .idea/gradle.xml | 1 - .idea/misc.xml | 2 +- README.md | 9 +-------- app/build.gradle | 2 ++ 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index bcf4711..61a9130 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index c4a4b3e..3ced4eb 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -14,6 +14,5 @@ -