RosettaCodeData/Task/The-Name-Game/Yabasic/the-name-game.basic
2024-10-16 18:07:41 -07:00

40 lines
887 B
Text

dim listanombres$(5)
listanombres$(0) = "Gary"
listanombres$(1) = "EARL"
listanombres$(2) = "billy"
listanombres$(3) = "FeLiX"
listanombres$(4) = "Mary"
listanombres$(5) = "ShirlEY"
for i = 0 to arraysize(listanombres$(), 1)
TheGameName(listanombres$(i))
next i
end
sub TheGameName(nombre$)
local x$, x0$, y$, b$, f$, m$
x$ = lower$(nombre$)
x$ = upper$(mid$(x$, 1, 1)) + mid$(x$, 2, len(x$) - 1)
x0$ = upper$(mid$(x$, 1, 1))
if x0$ = "A" or x0$ = "E" or x0$ = "I" or x0$ = "O" or x0$ = "U" then
y$ = lower$(x$)
else
y$ = mid$(x$, 2)
end if
b$ = "b" + y$
f$ = "f" + y$
m$ = "m" + y$
switch x0$
case "B" : b$ = y$
case "F" : f$ = y$
case "M" : m$ = y$
end switch
print x$ + ", " + x$ + ", bo-" + b$
print "Banana-fana fo-" + f$
print "Fee-fi-mo-" + m$
print x$ + "!" + chr$(10)
end sub