Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created April 5, 2013 07:15
Show Gist options
  • Save chbatey/5317253 to your computer and use it in GitHub Desktop.
Save chbatey/5317253 to your computer and use it in GitHub Desktop.
7 languages: Scala: Day2 E2a
trait Censor {
var alternatives = Map("Shoot" -> "Pucky", "Darn" -> "Beans")
def censor(input : String) : String = {
var toReturn = input
alternatives.foreach( entry => toReturn = toReturn.replace(entry._1, entry._2))
toReturn
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment