Sha256: 03dfec4dfaf028b5e85ed817b7f2da8a5ac37c4f7a3c00211e9df0443373532f
Contents?: true
Size: 564 Bytes
Versions: 66
Compression:
Stored size: 564 Bytes
Contents
bob <- function(input) { # function bob takes a character input and responds # with a couple different sentences # strip white space input <- gsub("[[:space:]]", "", input) if (input == "") { return("Fine. Be that way!") } if (toupper(input) == input && tolower(input) != input && endsWith(input, "?")) { return("Calm down, I know what I'm doing!") } if (toupper(input) == input && tolower(input) != input) { return("Whoa, chill out!") } if (endsWith(input, "?")) { return("Sure.") } return("Whatever.") }
Version data entries
66 entries across 66 versions & 1 rubygems