Sha256: acdad866abfba9abce8c6f0a112737a35b16572ac736b5cecfc4e14c4f7b869c
Contents?: true
Size: 579 Bytes
Versions: 116
Compression:
Stored size: 579 Bytes
Contents
package bob import "strings" const testVersion = 3 func Hey(drivel string) string { switch drivel = strings.TrimSpace(drivel); { case silent(drivel): return "Fine. Be that way!" case yelling(drivel): return "Whoa, chill out!" case asking(drivel): return "Sure." default: return "Whatever." } } func yelling(drivel string) bool { return strings.ToUpper(drivel) == drivel && strings.ToLower(drivel) != strings.ToUpper(drivel) } func asking(drivel string) bool { return strings.HasSuffix(drivel, "?") } func silent(drivel string) bool { return drivel == "" }
Version data entries
116 entries across 116 versions & 1 rubygems