Last active
April 15, 2017 06:47
-
-
Save jollyjoester/533e8e4ee24865140d9ce6bf06510216 to your computer and use it in GitHub Desktop.
fizzbuzz in kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..100).map { | |
when { | |
it % 15 == 0 -> "fizzbuzz" | |
it % 3 == 0 -> "fizz" | |
it % 5 == 0 -> "buzz" | |
else -> it.toString() | |
} | |
}.forEach { println(it) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment