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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* Inverse Fizzbuzz (for Java) | |
* http://www.jasq.org/2/post/2012/05/inverse-fizzbuzz.html | |
*/ | |
public class InvFizzBuzz { | |
public List<Integer> process(String[] args) { |
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
/** | |
* Inverse Fizzbuzz | |
* http://www.jasq.org/2/post/2012/05/inverse-fizzbuzz.html | |
**/ | |
object InverseFizzBuzz extends App { | |
val fizzbuzz = new PartialFunction[Int, (Int, String)] { | |
def apply(x:Int) = (x, (x%3,x%5) match { | |
case (0, 0) => "fizzbuzz" | |
case (0, _) => "fizz" |
NewerOlder