diff --git a/README.md b/README.md index 953f4eb..d5ab11a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ A [Java](https://www.java.com/) version can be found in the [java](java) folder; javac Song.java && java Song +A [Kotlin](https://kotlinlang.org/) version can be found in the [kotlin](kotlin) folder; produce the song with: + + kotlinc Song.kt -include-runtime -d Song.jar + java -jar Song.jar + A [PHP](https://php.net/) version can be found in the [PHP](PHP) folder; produce the song with: php song.php diff --git a/kotlin/Song.kt b/kotlin/Song.kt new file mode 100644 index 0000000..6553342 --- /dev/null +++ b/kotlin/Song.kt @@ -0,0 +1,43 @@ +fun main(args: Array) { + val song = "There was an old lady who swallowed a fly.\n" + + "I don't know why she swallowed a fly - perhaps she'll die!\n" + + "\n" + + "There was an old lady who swallowed a spider;\n" + + "That wriggled and wiggled and tickled inside her.\n" + + "She swallowed the spider to catch the fly;\n" + + "I don't know why she swallowed a fly - perhaps she'll die!\n" + + "\n" + + "There was an old lady who swallowed a bird;\n" + + "How absurd to swallow a bird.\n" + + "She swallowed the bird to catch the spider,\n" + + "She swallowed the spider to catch the fly;\n" + + "I don't know why she swallowed a fly - perhaps she'll die!\n" + + "\n" + + "There was an old lady who swallowed a cat;\n" + + "Fancy that to swallow a cat!\n" + + "She swallowed the cat to catch the bird,\n" + + "She swallowed the bird to catch the spider,\n" + + "She swallowed the spider to catch the fly;\n" + + "I don't know why she swallowed a fly - perhaps she'll die!\n" + + "\n" + + "There was an old lady who swallowed a dog;\n" + + "What a hog, to swallow a dog!\n" + + "She swallowed the dog to catch the cat,\n" + + "She swallowed the cat to catch the bird,\n" + + "She swallowed the bird to catch the spider,\n" + + "She swallowed the spider to catch the fly;\n" + + "I don't know why she swallowed a fly - perhaps she'll die!\n" + + "\n" + + "There was an old lady who swallowed a cow;\n" + + "I don't know how she swallowed a cow!\n" + + "She swallowed the cow to catch the dog,\n" + + "She swallowed the dog to catch the cat,\n" + + "She swallowed the cat to catch the bird,\n" + + "She swallowed the bird to catch the spider,\n" + + "She swallowed the spider to catch the fly;\n" + + "I don't know why she swallowed a fly - perhaps she'll die!\n" + + "\n" + + "There was an old lady who swallowed a horse...\n" + + "...She's dead, of course!" + println(song) +} \ No newline at end of file