Skip to content

Commit

Permalink
Merge pull request #90 from Ultraviolet-Ninja/dev
Browse files Browse the repository at this point in the history
Update Cycle
  • Loading branch information
Ultraviolet-Ninja authored Oct 2, 2024
2 parents 6405179 + 97009cb commit d963e7c
Show file tree
Hide file tree
Showing 53 changed files with 636 additions and 352 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ "dev" ]
schedule:
- cron: '30 10 * * 1'

jobs:
analyze:
Expand All @@ -31,7 +29,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,6 +51,6 @@ jobs:
run: ./gradlew build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
103 changes: 103 additions & 0 deletions Contribution Guidelines for the Gradle Centurion Project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Contribution Guidelines for the Gradle Centurion Project

Welcome to the Gradle Centurion project! This JavaFX application aims to provide solutions for the various puzzles
found in the Centurion bomb mod of *Keep Talking and Nobody Explodes*. I welcome contributions from developers of all
skill levels to help enhance and expand this project!

## Getting Started

To contribute, follow these steps:

1. **Parse the README**: If you've never heard of the game, this would be an excellent place to understand what the
game is and what the project is about

2. **Fork the Repository**: Click on the "Fork" button at the top right of this repository to create a copy on your
GitHub account.

3. **Clone the Forked Repository**: Clone your fork to your local machine using:

```bash
git clone https://github.com/your-username/GradleCenturion.git
```

4. **Set Up the Development Environment**: Ensure you have **Java 21** set up on your machine, then Gradle should be
able to handle the rest of the dependencies when loading up the project. This project is developed in Intellij; all
other IDEs are fine, but we'd have to discuss IDE specific issues if/when they occur.

5. **Explore the Codebase**: Take a look at the existing puzzles implemented in the project to understand the
structure and coding style. The codebase is set up with basic outlines for `.fxml` files, and it will be up to the
programmer to work on the associated controller and puzzle classes.

## Areas of Contribution

I'm looking for contributors to help tackle some of the **unhandled puzzles** or to **fix one of the few UI issues**
I'm having with the project. Unhandled puzzles can be seen in the [Progress file](Progress.md) at the base-level of the
project repository. To claim that you'll be tackling a certain puzzle, please add a comment to the
[discussion board](https://github.com/Ultraviolet-Ninja/GradleCenturion/issues/131). After approval, create an issue
on the given page so that we can discuss further instructions.

### Unhandled Puzzles

Every puzzle has an associated manual page that you can find in the `maunals/` subdirectory or on the
[KTANE Manual Page Website](https://ktane.timwi.de/). It will be your job to interpret the manual page so that a
computer can solve the puzzle. This involves developing the algorithm that will handle the inputs, the UI that displays
what a 'manual expert' needs to fill in, the controller that acts as the middleware between the two and the test code
that validates the algorithm to be correct in different scenarios.

#### How to choose a puzzle to solve

The `manuals/Centurion Puzzle Difficulty.xlsx` file contains all the puzzles and their relative 'manual expert'
difficulty. This would probably be a good place to start for finding interesting problems.

#### Testing Puzzle Solutions

Puzzle solutions should have tests associated with them. Unit testing will be an important part of making sure that
your solutions are correct and tested against wrong user input.

### UI Issues

There are a few known UI issues that occur in the project. If you're interested in looking into fixing those,
I can explain more about the problem that occurs.

## Creating a Pull Request

1. **Create a New Branch**:

- **Features** can just be labeled as the puzzle name
- **Issues** can be prefixed with `issue/`

```bash
git checkout -b puzzle-name
```

2. **Make Your Changes**: Implement your solution to the chosen puzzle.

3. **Commit Your Changes**: Ensure your commits are descriptive.

```bash
git commit -m "Add solution for Puzzle A"
```

4. **Push Your Changes**:

```bash
git push origin puzzle-name
```

5. **Open a Pull Request**: Go to the original repository and click on "Pull Requests" to open a new pull request.
Provide a summary of your changes and make sure that you are merging to the `dev` branch.

## Code Style

Please glance at existing puzzle solutions to get a feel for the coding style of the project. This project is run
through automatic code style checking using **Codacy** for new code changes, so fixing most code style issues will
be an important part of this project's development process.

Java files for a new puzzle solution should live under the `bomb.modules.[ALPHABETIC_LABEL].[PUZZLE_NAME]` package.
Sub-package organization at that point is left to your discretion.

## Questions and Support

If you have any questions, feel free to open an issue or reach out to me. I'm here to help!

Thank you for contributing to the Gradle Centurion project, and happy coding!
63 changes: 45 additions & 18 deletions Learned.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,64 @@
# What I've learned
# What have I learned through this project?

## JavaFX Custom Components
- Understanding how to create CC's with this [video](https://www.youtube.com/watch?v=1yuaJQJ1FXg) as a guide.
- Experimenting with CC's to figure out how to correctly turn them into jar files that are compatible with SceneBuilder.
- Experimenting with CC's to figure out how to correctly turn them into jar files that are compatible with SceneBuilder,
thus making them easier to work with in front-end design.
- Utilizing CSS to style components and make them look like the puzzles in the game.

## Project Tech/Design Choices
When my friend was working on the project, he helped me decide to move to a RadioButton design for switching between puzzles. This helped me get away from my previous design of nested TabPanes in a TabPane, which probably isn't the most visually appealing.
When my friend was working on the project, he helped me decide to move to a RadioButton design for switching between
puzzle displays. This helped me get away from my previous design of nested TabPanes in a TabPane, which probably
isn't the most visually appealing.

Another thing we talked about while he was on the project was moving back to `Java 8` since it was easier to work
with JavaFX. This decision was later reversed after some time experimenting in Gradle.

Another thing we talked about while he was on the project was moving back to Java 8 since it was easier to work with JavaFX. This decision was later reversed after some time experimenting in Gradle.
## Gradle/Continuous Integration
- Using the build.gradle file to organize dependencies and plugins, facilitate testing, set up distributions in zip and tar files, and releases for GitHub.
- Using the `build.gradle` file to organize dependencies and plugins, facilitate testing, set up distributions in zip
and tar files, and releases for GitHub.
- Making custom tasks and using parameters for CI pipelines to partition my test suite.
- Automating tests with CircleCI using this [video](https://www.youtube.com/watch?v=9PgZCJNzY9M) as a guide.
- Coming across ~~LGTM~~ (_when it was still around_) Codacy and taking advantage of its code quality checking for flaws in my Java code.
- Automating tests with CircleCI using this [video](https://www.youtube.com/watch?v=9PgZCJNzY9M) as a guide to get the initial set up.
- Partitioning my test suite to understand how test splitting and YML file syntax worked and how to parse
[Circle CI documentation](https://circleci.com/docs/parallelism-faster-jobs/)
- Coming across ~~LGTM~~ (_when it was still around_) Codacy and taking advantage of its code quality checking for
flaws in my Java code.

## Graphs and their Algorithms
- Creating graphs by looking up the concept or using the JGraphT library.
- Understanding how graphs work by watching videos on the theory, creating them from scratch and using the
[JGraphT library](https://jgrapht.org/) to solve different puzzles.
- Making use of Dijkstra's Shortest Path and A* to solve different problems.
## From my Internship

## From my first internship
- Using a backlog to organize tasks that are done, in progress, or haven't been looked at.
- Creating results that get deployed to GitHub and can be downloaded by anyone.
- Using a less technical version of design documents. I used them to outline how I will solve puzzles and what the front end will look like.
- Using a less technical version of design documents. I used them to outline how I will solve puzzles and what the
front end will look like.

## From my Classes

### School

#### Tools & Practices
- Understanding how to use Git and GitHub to host my project.
- Having an introduction to Gradle from one of my teammates trying to bring it into another project. (_Wasn't successful, but still_)
- Understanding how to use Git and GitHub to host my project when analyzing the needs of my project.
- Having an introduction to Gradle from one of my teammates trying to bring it into our school project.
(_Wasn't successful, but still, it was a discovery_)

#### Verification
- Understanding the perks of TestNG vs. my previous experience with J-Unit.
- Discovering Pitest, Exploratory Testing, Mockito, and Jacoco as different ways to test code and thinking about which concepts I should implement into the project.
- Understanding the perks of TestNG vs. my previous experience with J-Unit as it relates to how the project
could benefit.
- Discovering Pitest, Exploratory Testing, Mockito, and Jacoco as different ways to test code and thinking about
which concepts I should implement into the project.

#### Design Patterns
- Using Adapters, Factories, Facades, and Observers to facilitate repeating code and updating related modules.
- Using Strategies, Factories, Facades, and Observers to facilitate repeated code and updating related modules.
- Being introduced to code coupling and cohesion, which was later applied when I had a CodeMR free trial.

### Udemy
- Understanding how to write Groovy code. [Link](https://www.udemy.com/course/gradle-for-java-developers/)
- Using CompletableFuture to split up unrelated tasks. [Link](https://www.udemy.com/course/parallel-and-asynchronous-programming-in-modern-java/)
- Utilizing functional interfaces and the Streams API wherever necessary. [Link](https://www.udemy.com/course/functional-programming-and-reactive-programming-in-java/)
- Learning about graph algorithms and heuristics. [Link](https://www.udemy.com/course/artificial-intelligence-games-in-java/learn/lecture/5958944?start=0#overview)
- Using CompletableFuture to split up unrelated tasks, especially for the program boot up process.
[Link](https://www.udemy.com/course/parallel-and-asynchronous-programming-in-modern-java/)
- Utilizing functional interfaces and the Streams API wherever necessary.
[Link](https://www.udemy.com/course/functional-programming-and-reactive-programming-in-java/)
- Learning about graph algorithms and heuristics.
[Link](https://www.udemy.com/course/artificial-intelligence-games-in-java/learn/lecture/5958944?start=0#overview)
1 change: 1 addition & 0 deletions Progress.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Module Progress

### Finished Modules
- Alphabet
- Astrology
Expand Down
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@
![Project Version](https://img.shields.io/badge/version-0.23.1-blueviolet)

## Intro
This project is designed to solve all puzzles found on the Centurion Bomb from Keep Talking and Nobody Explodes, which is a combination of many community-made puzzles and some from the base game set in different languages.<br>
This project is designed to solve all puzzles found on the Centurion Bomb from Keep Talking and Nobody Explodes, which
is a combination of many community-made puzzles and some from the base game set in different languages. See below
for pictures or this [parody video](https://www.youtube.com/watch?v=krRPQQz524I).<br>

This is a huge project for one man to tackle, but I've [learned a lot](Learned.md) from the challenges I've faced.
This is a **huge** project for one man to tackle, but I've [learned a lot](Learned.md) from the challenges I've faced
and this project marks points of my Software Engineering learning journey.

## Technologies
- Java 21
- Gradle 8.4
- Gradle 8.6

### Plugins
- JavaFX
- Breadmoirai GitHub Release

### Dependencies
- MaterialFX ver. `11.12.0`
- JFoenix ver. `9.0.4`
- JavaTuple ver. `1.2`
- JGraphT ver. `1.5.2`
- OpenCSV ver. `5.8`
- OpenCSV ver. `5.9`

### Other Technologies
- Circle CI with TestNG and Pitest
- CodeMR Free Trial
Expand All @@ -31,15 +37,23 @@ See the running list of modules [here](Progress.md)

## How to run the program
*Disclaimer*: This is referring to program versions `0.22.2` onward
- The `source code` option of the [Release Page](https://github.com/Ultraviolet-Ninja/GradleCenturion/releases) contains an executable, a Windows batch file and all the necessary jar files to run the program
- The `Gradle-Centurion-[VERSION]-[OPERATING SYSTEM]` contains an OS-specific executable file with a runtime environment for the program to run in
- The `source code` option of the [Release Page](https://github.com/Ultraviolet-Ninja/GradleCenturion/releases) contains an executable, a Windows batch file and all the
necessary jar files to run the program
- The `Gradle-Centurion-[VERSION]-[OPERATING SYSTEM]` contains an OS-specific executable file with a runtime
environment for the program to run in
- *Only supports Windows currently*

## Contributing to the Project

See the [Contribution Document](Contribution%20Guidelines%20for%20the%20Gradle%20Centurion%20Project.md) for details.

## Inspiration
After my first manual turning out to be successful in solving the main-game bombs, I thought "*Why stop there?*".

After my [first manual](https://github.com/Ultraviolet-Ninja/KTANE_Java_Bomb_Manual) turning out to be successful in solving the main-game bombs, I thought "*Why stop there?*", like Tony Stark, except he was getting his Arc Reactor removed.
I started creating this project working on the auto-solver for the vanilla game, which was, by comparison, much easier.

### Example Bomb

#### Front view
![Front](markdown/Front.jpg)

Expand All @@ -55,4 +69,5 @@ Number of Battery Holders, Two-Factor Authentication, and the Serial Code.

![WidgetTwo](markdown/Widget2.jpg)
**One port plate** with a **PS/2 port**, another **D battery in one holder** and a serial code **"PN4XC5"**.<br>
Overall, this edgework would be given as "1 PS2 port in 1 plate, a lit November SA, 2 in 2 (2 batteries in 2 holders), and serial is Papa November 4 X-ray Charlie 5" (Using the Nato Phonetic Alphabet)
Overall, this edgework would be given as "1 PS2 port in 1 plate, a lit November SA, 2 in 2 (2 batteries in 2 holders),
and serial is Papa November 4 X-ray Charlie 5" (_Using the Nato Phonetic Alphabet_)
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ plugins {
id 'java'
id 'jacoco'
id 'application'
id 'org.beryx.jlink' version '3.0.0'
id 'org.beryx.jlink' version '3.0.1'
id 'info.solidsoft.pitest' version '1.15.0'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.javamodularity.moduleplugin' version '1.8.12'
id 'com.github.breadmoirai.github-release' version '2.4.1'
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'com.github.breadmoirai.github-release' version '2.5.2'
}

group 'jasmine.jragon'
Expand Down Expand Up @@ -40,12 +40,12 @@ repositories {
}

dependencies {
implementation 'com.opencsv:opencsv:5.8'
implementation 'com.opencsv:opencsv:5.9'
implementation 'org.javatuples:javatuples:1.2'
implementation 'org.jgrapht:jgrapht-ext:1.5.2'
implementation 'org.jetbrains:annotations:24.0.1'
implementation 'org.jetbrains:annotations:25.0.0'
//implementation 'io.github.fvarrui:javpackager:1.5.1'
implementation 'ch.qos.logback:logback-classic:1.4.8'
implementation 'ch.qos.logback:logback-classic:1.5.8'

implementation('com.jfoenix:jfoenix:9.0.4') {
exclude group: "org.javafx"
Expand All @@ -54,9 +54,9 @@ dependencies {
exclude group: "org.javafx"
}

testImplementation 'org.testng:testng:7.8.0'
testImplementation 'org.testng:testng:7.10.2'
testImplementation 'org.pitest:pitest-testng-plugin:1.0.0'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.15.2'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.17'
}

def firstInstance = project.hasProperty('thread0')
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 3 additions & 1 deletion src/main/java/bomb/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import static javafx.scene.input.KeyCombination.CONTROL_DOWN;

public final class Main extends Application {
public static final String IMAGE_ICON_RESOURCE = String.valueOf(Main.class.getResource("KTANE logo.png"));

@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader loader = new FXMLLoader(Main.class.getResource("manual.fxml"));
Expand All @@ -40,7 +42,7 @@ public void start(Stage primaryStage) throws Exception {

primaryStage.setTitle("Centurion Bomb Manual");
primaryStage.setScene(scene);
primaryStage.getIcons().add(new Image(String.valueOf(Main.class.getResource("KTANE logo.png"))));
primaryStage.getIcons().add(new Image(IMAGE_ICON_RESOURCE));
primaryStage.show();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bomb/ManualController.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private CompletableFuture<Map<Toggle, Region>> setupRegionMap() {
ObserverHub.addObserver(RESET, resetObserver);

//Change the drive to test a new way to load the fxml files
var drive = FxmlBootDrive.createStandardDrive();
var drive = FxmlBootDrive.createParallelStreamDrive();
var fxmlMapFuture = supplyAsync(() -> drive.createFXMLMap(resetObserver));
var radioButtonNameFuture = createButtonNameFuture(options.getToggles());

Expand Down
Loading

0 comments on commit d963e7c

Please sign in to comment.