Shortest quine in Kotlin?

507 Views Asked by At

What's the shortest quine written in Kotlin language?

See my implementation in answers, but I believe a shorter one exists.

1

There are 1 best solutions below

0
On BEST ANSWER

Here is a straightforward implementation in kotlin script:

val a="val a=%c%s%c%nprint(a.format(34,a,34))"
print(a.format(34,a,34))

Tested with:

$ kotlinc -script quine.kts > out.kts
$ diff -s quine.kts out.kts
Files quine.kts and out.kts are identical

Number of chars:

$ stat quine.kts
Size: 71