Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/The-Name-Game/Perl/the-name-game.pl
Normal file
14
Task/The-Name-Game/Perl/the-name-game.pl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
sub printVerse {
|
||||
$x = ucfirst lc shift;
|
||||
$x0 = substr $x, 0, 1;
|
||||
$y = $x0 =~ /[AEIOU]/ ? lc $x : substr $x, 1;
|
||||
$b = $x0 eq 'B' ? $y : 'b' . $y;
|
||||
$f = $x0 eq 'F' ? $y : 'f' . $y;
|
||||
$m = $x0 eq 'M' ? $y : 'm' . $y;
|
||||
print "$x, $x, bo-$b\n" .
|
||||
"Banana-fana fo-$f\n" .
|
||||
"Fee-fi-mo-$m\n" .
|
||||
"$x!\n\n";
|
||||
}
|
||||
|
||||
printVerse($_) for <Gary Earl Billy Felix Mary Steve>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue