The Name Game: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) m (→{{header|Z80 Assembly}}: improved readability of code) |
No edit summary |
||
Line 2,821: | Line 2,821: | ||
Fee-fi-mo-mteve |
Fee-fi-mo-mteve |
||
Steve!</pre> |
Steve!</pre> |
||
=={{header|Vlang}}== |
|||
<lang vlang>fn main() { |
|||
list := ['Gary', 'Earl', 'Billy', 'Felix', 'Mary'] |
|||
for name in list {verse(name)} |
|||
} |
|||
fn verse(name string) { |
|||
mut b, mut f, mut m, mut y :='','','','' |
|||
mut x := name.to_lower().title() |
|||
y = x.substr(1, x.len) |
|||
if 'AEIOU'.contains(x[0].ascii_str()) {y = x.to_lower()} |
|||
b = 'b' + y |
|||
f = 'f' + y |
|||
m = 'm' + y |
|||
match x[0].ascii_str() { |
|||
'B' {b = y} |
|||
'F' {f = y} |
|||
'M' {m = y} |
|||
else {} |
|||
} |
|||
println('$x, $x, bo-$b') |
|||
println('Banana-fana fo-$f') |
|||
println('Fee-fi-mo-$m') |
|||
println('$x!\n') |
|||
}</lang> |
|||
{{out}} |
|||
<pre> |
|||
Gary, Gary, bo-bary |
|||
Banana-fana fo-fary |
|||
Fee-fi-mo-mary |
|||
Gary! |
|||
Earl, Earl, bo-bearl |
|||
Banana-fana fo-fearl |
|||
Fee-fi-mo-mearl |
|||
Earl! |
|||
Billy, Billy, bo-illy |
|||
Banana-fana fo-filly |
|||
Fee-fi-mo-milly |
|||
Billy! |
|||
Felix, Felix, bo-belix |
|||
Banana-fana fo-elix |
|||
Fee-fi-mo-melix |
|||
Felix! |
|||
Mary, Mary, bo-bary |
|||
Banana-fana fo-fary |
|||
Fee-fi-mo-ary |
|||
Mary! |
|||
</pre> |
|||
=={{header|Wren}}== |
=={{header|Wren}}== |