The Name Game: Difference between revisions

Content deleted Content added
Angus (talk | contribs)
+algol68
Robbie (talk | contribs)
Line 1,546:
Fee-fi-mo-mrank
Frank!</pre>
 
=={{header|Visual Basic .NET}}==
{{trans|C#}}
<lang vbnet>Option Strict On
 
Imports System.Text
 
Module Module1
 
Sub PrintVerse(name As String)
Dim sb As New StringBuilder(name.ToLower())
sb(0) = Char.ToUpper(sb(0))
 
Dim x = sb.ToString()
Dim y = If("AEIOU".IndexOf(x(0)) > -1, x.ToLower(), x.Substring(1))
Dim b = "b" + y
Dim f = "f" + y
Dim m = "m" + y
Select Case x(0)
Case "B"c
b = y
Exit Select
Case "F"c
f = y
Exit Select
Case "M"c
m = y
Exit Select
End Select
 
Console.WriteLine("{0}, {0}, bo-{1}", x, b)
Console.WriteLine("Banana-fana fo-{0}", f)
Console.WriteLine("Fee-fi-mo-{0}", m)
Console.WriteLine("{0}!", x)
Console.WriteLine()
End Sub
 
Sub Main()
Dim nameList As New List(Of String) From {"Gary", "Earl", "Billy", "Felix", "Mary", "Steve"}
nameList.ForEach(AddressOf PrintVerse)
End Sub
 
End Module</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!
 
Steve, Steve, bo-bteve
Banana-fana fo-fteve
Fee-fi-mo-mteve
Steve!</pre>
 
=={{header|zkl}}==