Halite
Halite copied to clipboard
Kotlin starter package
Added kotlin language package. Kotlin compiler can be installed from https://github.com/JetBrains/kotlin/releases/latest
Would love to hear @nmalaguti thoughts on this implementation
It looks like a lot of this is from the Java -> Kotlin autoconversion. It doesn't use a lot of Kotlin idioms.
Example:
for (b in 0..width - 1) {
row.add(Integer.parseInt(input[index]))
index++
}
would be better as
for (b in 0 until width) {
row.add(Integer.parseInt(input[index]))
index++
}
// or you could do something like
input.take(width).map { Integer.parseInt(it) }
Also might want to use mutableListOf
instead of creating explicit ArrayList
instances.
Does it look better now?
Does it look better now?
Much!
I think the package should include details on how to create a JAR with the Kotlin runtime included and a Main-Class
in the manifest (unless kotlinc
does that automatically?)
It should also include a LANGUAGE
file with Kotlin
in it.
I think the package should include details on how to create a JAR with the Kotlin runtime included and a Main-Class in the manifest (unless kotlinc does that automatically?)
It should also include a LANGUAGE file with Kotlin in it.
We can include a Kotlin compiler on the server and properly tag Kotlin bots with the name "Kotlin."
It is still nice to have the LANGUAGE
file in case anyone wants to switch to building with a JAR.
Not sure what is LANGUAGE(just txt with "Kotlin" inside?) file and where it should be.
executable JAR file can be created with:
kotlinc *.kt -include-runtime -d *name*.jar
jar ufe **name**.jar *MainClassName*Kt
and simple run with: java -jar *name*.jar
Should i create sh/bat scripts for that?
Not sure what is LANGUAGE(just txt with "Kotlin" inside?) file and where it should be.
Yes. See "Customizing your language name" in this doc.
Should i create sh/bat scripts for that?
That would be great.
The CI tests are failing because starter packs are assumed to be valid submissions with a MyBot.*
file. In this case, the tests would be looking for a MyBot.jar
file. Since users are expected to create their jar
and zip it up, I'm not sure what to do about the assumption that all starter packs are valid submissions.