Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/The-Name-Game/Wren/the-name-game.wren
Normal file
23
Task/The-Name-Game/Wren/the-name-game.wren
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import "/str" for Str
|
||||
|
||||
var printVerse = Fn.new { |name|
|
||||
var x = Str.capitalize(Str.lower(name))
|
||||
var z = x[0]
|
||||
var y = "AEIOU".contains(z) ? Str.lower(x) : x[1..-1]
|
||||
var b = "b%(y)"
|
||||
var f = "f%(y)"
|
||||
var m = "m%(y)"
|
||||
if (z == "B") {
|
||||
b = y
|
||||
} else if (z == "F") {
|
||||
f = y
|
||||
} else if (z == "M") {
|
||||
m = y
|
||||
}
|
||||
System.print("%(x), %(x), bo-%(b)")
|
||||
System.print("Banana-fana fo-%(f)")
|
||||
System.print("Fee-fi-mo-%(m)")
|
||||
System.print("%(x)!\n")
|
||||
}
|
||||
|
||||
["Gary", "Earl", "Billy", "Felix", "Mary", "Steve"].each { |name| printVerse.call(name) }
|
||||
Loading…
Add table
Add a link
Reference in a new issue