RosettaCodeData/Task/The-Name-Game/Chipmunk-Basic/the-name-game.basic

40 lines
938 B
Plaintext

100 sub thegamename(nombre$)
110 x$ = lcase$(nombre$)
120 x$ = ucase$(mid$(x$,1,1))+mid$(x$,2,len(x$)-1)
130 x0$ = ucase$(mid$(x$,1,1))
140 if x0$ = "A" or x0$ = "E" or x0$ = "I" or x0$ = "O" or x0$ = "U" then
150 y$ = lcase$(x$)
160 else
170 y$ = mid$(x$,2)
180 endif
190 b$ = "b"+y$
200 f$ = "f"+y$
210 m$ = "m"+y$
220 if x0$ = "B" then
230 b$ = y$
240 else
245 if x0$ = "F" then
250 f$ = y$
260 else
265 if x0$ = "M" then
270 m$ = y$
275 endif
276 endif
280 endif
290 print x$+", "+x$+", bo-"+b$
300 print "Banana-fana fo-"+f$
310 print "Fee-fi-mo-"+m$
320 print x$+"!"+chr$(10)
330 end sub
340 dim listanombres$(5)
350 listanombres$(0) = "Gary"
360 listanombres$(1) = "EARL"
370 listanombres$(2) = "billy"
380 listanombres$(3) = "FeLiX"
390 listanombres$(4) = "Mary"
400 listanombres$(5) = "ShirlEY"
410 for i = 0 to ubound(listanombres$)
420 thegamename(listanombres$(i))
430 next i
440 end