- Programming exercises done in Kotlin
Mainly meant to be used within Intellij, which should be able to give you magic green arrows next to main functions.
Run via the gradle wrapper (will even work on Windows!):
gradle wrapper # Setup the wrapper
./gradlew run # Run a simple hello worldAdditionally, use the green run buttons in Intellij. If they disappear, wire the particular class into Main.kt
Other solutions for Advent of Code, up to 2022:
Solution to leetcode problems, that passed the tests.
I also try to provide my own tests during development.
To seamlessly run tests for a specific LeetCode problem, simply pass its number to the lctest command:
./kwork.sh test 49
# or
./gradlew lctest 49Includes helper code for header comment generation. Run via kwork.sh or directly with Gradle:
# show available CLI flags
./kwork.sh --help
./gradlew cli --quiet --args " --help"
# regenerate the table above
./kwork.sh --genProblemTable
./gradlew cli --quiet --args " -gpt"
# scaffold solution + test for problem 42
./kwork.sh --genFiles --number 42
./gradlew cli --quiet --args " --genFiles --number 42"
# run tests for problem 49
./kwork.sh test 49
./gradlew lctest 49For reasons yet unknown, other internet suggested version of the JavaExec task do not work, as Gradle complains
about main and about the classpath.
This one works:
tasks.register<JavaExec>("lcutil") {
group = "Leetcode Utils"
mainClass = "lcutils.JavaWorkCLI"
classpath = sourceSets["main"].runtimeClasspath
}