Last active
August 18, 2021 20:09
-
-
Save idarlington/2faa75d6a3fc8afdac87dd3b48855671 to your computer and use it in GitHub Desktop.
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
object CracklePop { | |
def main(args: Array[String]): Unit = { | |
(1 to 100).collect { | |
case number if (number % 5 == 0) && (number % 3 == 0) => println("CracklePop") | |
case number if number % 5 == 0 => println("Pop") | |
case number if number % 3 == 0 => println("Crackle") | |
case number => println(number) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment