Sha256: 1660a9b8ee00947ba065935c35af43a2893504b59f5a0f3ed2bd2482c62ce99c
Contents?: true
Size: 566 Bytes
Versions: 103
Compression:
Stored size: 566 Bytes
Contents
module Bob open System let response (input: string) = let isEmpty = String.IsNullOrWhiteSpace input let isYell = Seq.exists Char.IsLetter input && input = input.ToUpperInvariant() let isQuestion = input.Trim().EndsWith "?" match input with | _ when isEmpty -> "Fine. Be that way!" | _ when isYell && isQuestion -> "Calm down, I know what I'm doing!" | _ when isYell -> "Whoa, chill out!" | _ when isQuestion -> "Sure." | _ -> "Whatever."
Version data entries
103 entries across 103 versions & 1 rubygems