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
defmodule FizzBuzz do | |
@default_map %{3 => "Fizz", 5 => "Buzz"} | |
@default_range_size 100 | |
def go() do | |
go(@default_map, @default_range_size) | |
end | |
def go(map, range_size) | |
when is_map(map) |
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
def toChickenCase(text: Seq[Char], soFar: List[Char] = List.empty, wasLastUpper: Boolean = false): String = text.toList match { | |
case h :: t => | |
val shouldUpper = !wasLastUpper | |
val newList = if (shouldUpper) soFar :+ Character.toUpperCase(h) else soFar :+ h | |
toChickenCase(t, newList, shouldUpper) | |
case _ => soFar.mkString | |
} | |
toChickenCase("Our engineers have reviewed your code and they deemed it unworthy.") |