19 lines
488 B
Text
19 lines
488 B
Text
func printVerse(name) {
|
|
let x = name[..1].Upper() + name[1..].Lower();
|
|
let y = "AEIOU".IndexOf(x[0]) > -1 ? x.Lower() : x[1..]
|
|
let b = x[0] is 'B' ? y : "b" + y
|
|
let f = x[0] is 'F' ? y : "f" + y
|
|
let m = x[0] is 'M' ? y : "m" + y
|
|
|
|
print("\(x), \(x), bo-\(b)")
|
|
print("Banana-fana fo-\(f)")
|
|
print("Fee-fi-mo-\(m)")
|
|
print("\(x)!", x)
|
|
print()
|
|
}
|
|
|
|
let seq = yields { "Gary", "Earl", "Billy", "Felix", "Mary", "Steve" }
|
|
|
|
for x in seq {
|
|
printVerse(x)
|
|
}
|