Project initialized

This commit is contained in:
stefan
2025-04-17 13:02:03 +02:00
commit 12c723cad2
28 changed files with 3685 additions and 0 deletions
@@ -0,0 +1,3 @@
package at.mocode
const val SERVER_PORT = 8080
@@ -0,0 +1,9 @@
package at.mocode
class Greeting {
private val platform = getPlatform()
fun greet(): String {
return "Hello, ${platform.name}!"
}
}
@@ -0,0 +1,7 @@
package at.mocode
interface Platform {
val name: String
}
expect fun getPlatform(): Platform
@@ -0,0 +1,7 @@
package at.mocode
class JVMPlatform: Platform {
override val name: String = "Java ${System.getProperty("java.version")}"
}
actual fun getPlatform(): Platform = JVMPlatform()
@@ -0,0 +1,7 @@
package at.mocode
class WasmPlatform: Platform {
override val name: String = "Web with Kotlin/Wasm"
}
actual fun getPlatform(): Platform = WasmPlatform()