Skip to content
Brandon Choi edited this page May 25, 2016 · 20 revisions

2016-05-25

  • hello world - 정진욱(jwChung)
  • bob - 최정렬
class Bob {
  def hey(arg: String): String = {
    
    def isYelling(s: String) = !s.filter(_.isLetter).isEmpty() && s.toUpperCase() == s
    
    arg.trim match {
      case ""                           => "Fine. Be that way!"
      case s: String if isYelling(s)    => "Whoa, chill out!"
      case s: String if s.endsWith("?") => "Sure."
      case _                            => "Whatever."
    }
  }
}
Clone this wiki locally