diff --git a/2025/01/kotlin_demo1/README.md b/2025/01/kotlin_demo1/README.md new file mode 100644 index 0000000..5bcd79d --- /dev/null +++ b/2025/01/kotlin_demo1/README.md @@ -0,0 +1,3 @@ +# Basic kotlin project + +The goal was to test how easy / hard is to write kotlin in vim :-). diff --git a/2025/01/kotlin_demo1/build.gradle b/2025/01/kotlin_demo1/build.gradle index cd4ea39..0c0fd16 100644 --- a/2025/01/kotlin_demo1/build.gradle +++ b/2025/01/kotlin_demo1/build.gradle @@ -12,5 +12,5 @@ kotlin { tasks.register('runApp', JavaExec) { classpath = sourceSets.main.runtimeClasspath - mainClass = "ProgramKt" + mainClass = "pl.polgrabia.demos.kotlin.ProgramKt" } diff --git a/2025/01/kotlin_demo1/src/main/kotlin/Program.kt b/2025/01/kotlin_demo1/src/main/kotlin/Program.kt deleted file mode 100644 index 81cfcd8..0000000 --- a/2025/01/kotlin_demo1/src/main/kotlin/Program.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - println("Hello World!!!") -} diff --git a/2025/01/kotlin_demo1/src/main/kotlin/pl/polgrabia/demos/kotlin/Program.kt b/2025/01/kotlin_demo1/src/main/kotlin/pl/polgrabia/demos/kotlin/Program.kt new file mode 100644 index 0000000..48aef6e --- /dev/null +++ b/2025/01/kotlin_demo1/src/main/kotlin/pl/polgrabia/demos/kotlin/Program.kt @@ -0,0 +1,12 @@ +package pl.polgrabia.demos.kotlin + +import kotlin.collections.* + +fun main() { + // val data = listOf(1, 2, 3, 4) + val data : Array = Array(10) { 1 } + val s = data.reduceOrNull ({ r,v -> + r + v + }) + println("Hello World!!! Sum: $s") +}