Sha256: 60b29f8f332f229618f03b61bfc1ac6c9a17c2f4be43c729cc25d6378f354d76

Contents?: true

Size: 525 Bytes

Versions: 163

Compression:

Stored size: 525 Bytes

Contents

val response =
  let
    open Char
    open List
    
    fun isQuestion chars = last (filter (not o isSpace) chars) = #"?"

    fun isYell chars = exists isAlpha chars andalso (map toUpper chars) = chars

    val isNothing = all isSpace

    fun response' chars =
      if isNothing chars
      then "Fine. Be that way!"
      else if isYell chars
           then "Whoa, chill out!"
           else if isQuestion chars
                then "Sure."
                else "Whatever."
  in
    response' o String.explode 
  end

Version data entries

163 entries across 163 versions & 1 rubygems

Version Path
trackler-2.2.1.18 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.17 tracks/sml/exercises/bob/example.sml
trackler-2.2.1.16 tracks/sml/exercises/bob/example.sml