Skip to content

Commit 2f42b49

Browse files
authored
Merge pull request #83 from Project516/master
Prep 0.1.2
2 parents 41a9cca + 443edce commit 2f42b49

File tree

25 files changed

+31
-1269
lines changed

25 files changed

+31
-1269
lines changed

.github/workflows/javadoc.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323

2424
- name: Generate JavaDoc
2525
run: ./gradlew javadoc
26-
27-
- name: Build TeaVM (JavaScript compilation)
28-
run: ./teavm.sh
2926

3027
- name: Deploy to GitHub Pages
3128
uses: peaceiris/actions-gh-pages@v4

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ NumberGuessingGame-linux/
3636
NumberGuessingGame-windows.zip
3737
NumberGuessingGame-macos.zip
3838
NumberGuessingGame-linux.tar.gz
39-
40-
# TeaVM generated JavaScript (build artifact)
41-
teavm/classes.js

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# Number Guessing Game
22

3-
A simple number guessing game where you try to guess a randomly generated number. The game features both a user-friendly graphical interface (GUI) and a classic console mode. The GUI provides visual feedback with color-coded hints and tracks your progress in real-time.
3+
A simple number guessing game where you try to guess a randomly generated number. The game features both a user-friendly graphical user interface (GUI) and a classic console mode. The GUI provides visual feedback with color-coded hints and tracks your progress in real-time.
44

55
**Features:**
66
- Swing-based GUI (default)
77
- Console mode (use `--console` flag)
8-
- Web browser version (available on GitHub Pages)
98
- High score tracking with usernames
109
- Persistent score storage
11-
- Cross-platform
10+
- Cross-platform (Made in Java!)
1211

1312
## Installation & Running
1413

@@ -20,14 +19,16 @@ For Debian/Ubuntu and derivatives (recommended for terminal usage):
2019

2120
You can use curl to do it from the command line:
2221
```bash
23-
curl -s -L -o numberguessingame.deb https://github.com/Project516/NumberGuessingGame/releases/download/0.0.x/numberguessinggame.deb
22+
curl -s -L -o numberguessingame.deb https://github.com/Project516/NumberGuessingGame/releases/download/0.x.y/numberguessinggame.deb
2423
```
25-
where `x` is the version you want.
24+
where `x` and `y` is the version you want.
2625
2. Install it:
2726
```bash
2827
sudo apt update # Update packages
2928
sudo apt install ./numberguessinggame.deb # From directory with the deb package
3029
sudo apt install -f # Install dependencies
30+
echo 'export PATH=$PATH:/usr/games' >> ~/.bashrc # Add games directory to user PATH
31+
source ~/.bashrc
3132
```
3233
3. Run from anywhere in your terminal:
3334
```bash
@@ -62,7 +63,7 @@ Download the `archive.zip` from the [latest release](https://github.com/project5
6263

6364
#### Requirements
6465

65-
- Java 17 or higher
66+
- Java 8 or higher
6667

6768
#### How to Run
6869

app/build.gradle

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ plugins {
44

55
//Spotless
66
id 'com.diffplug.spotless' version '8.0.0'
7-
8-
// TeaVM plugin for JavaScript compilation
9-
id 'io.github.zebalu.teavm-gradle-plugin' version '1.0.0'
7+
8+
id 'com.gradleup.shadow' version '9.2.2'
109
}
1110

1211
repositories {
@@ -17,17 +16,16 @@ repositories {
1716
dependencies {
1817
// This dependency is used by the application.
1918
implementation libs.guava
20-
21-
// TeaVM JSO APIs for web development (needed at compile time for WebGUI)
22-
compileOnly 'org.teavm:teavm-jso-apis:0.12.3'
19+
20+
implementation files('../libs/jlibutils-0.0.1.jar')
2321
}
2422

2523
testing {
2624
suites {
2725
// Configure the built-in test suite
2826
test {
2927
// Use JUnit Jupiter test framework
30-
useJUnitJupiter('6.0.0')
28+
useJUnitJupiter('5.14.1')
3129
}
3230
}
3331
}
@@ -36,17 +34,10 @@ testing {
3634
java {
3735
toolchain {
3836
// Use JDK 25
39-
languageVersion = JavaLanguageVersion.of(25)
37+
languageVersion = JavaLanguageVersion.of(8)
4038
}
4139
}
4240

43-
tasks.withType(JavaCompile) {
44-
// Changed from 8 to 11 to support TeaVM for web deployment.
45-
// TeaVM 0.10.2+ requires Java 11 as minimum target.
46-
// This change affects the minimum JRE required to run the JAR.
47-
options.release.set(17)
48-
}
49-
5041
application {
5142
// Define the main class for the application.
5243
mainClass = 'io.github.project516.NumberGuessingGame.Main'
@@ -70,9 +61,3 @@ jar {
7061
)
7162
}
7263
}
73-
74-
// TeaVM configuration for compiling Java GUI to JavaScript
75-
teavm {
76-
// Main class to compile
77-
mainClass = 'io.github.project516.NumberGuessingGame.WebGUI'
78-
}

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

Lines changed: 0 additions & 214 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
# Wrapper script to launch Number Guessing Game
33

4-
java -jar /usr/share/games/numberguessinggame/game.jar "$@"
4+
java -jar /usr/share/games/numberguessinggame/game.jar --console "$@"

gradle/wrapper/gradle-wrapper.jar

1.83 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)