Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 43 additions & 0 deletions kotlin/Song.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
fun main(args: Array<String>) {
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)
}