Some nice scripts for a pleasant Kotlin competitive-programming experience.
You'll need to install the kotlin command-line compiler beforehand from here.
Download the install.sh
from above.
Run it with root priviliges.
sudo bash install.sh
And you're done! Restart your terminal now to allow paths to take effect.
CompetitiveKotlin
provides two commands:
kk
for compiling and executing.
kj
for compiling kotlin into java, for those online judges which do not support kotlin.
To compile and run [your_filename].kt
:
kk [your_filename]
It will compile and execute your program altogether for you, and would delete the compiled .class
file for you.
To compile your kotlin code from [your_filename].kt
into java:
kj [your_filename]
The result file would be [your_filename].java
, you could copy this code and submit it to your judge.