Buch Cover Buch Cover Buch Cover Buch Cover

Web-Code: - Webcode Help

The Name Game! (Zeichenketten)

The name game!

Shirley:
Shirley, Shirley, bo-birley
Banana-fana fo-firley
Fee-fi-mo-mirley
Shirley!

Lincoln:
Lincoln, Lincoln, bo-bincoln
Banana-fana fo-fincoln
Fee-fi-mo-mincoln
Lincoln!

Come on, everybody, I say now, let's play a game / I betcha I could make a rhyme out of anybody's name / The first letter of the name I treat it like it wasn't there / But a "B" or an "F" or an "M" will appear / And then I say "bo", add a "b", then I say the name / Then "banana-fana" and "fo" and then I say the name again with an "f" very plain / Then a "fee-fi" and "mo" and then I say the name again with an "m" this time / And there isn't any name that I can't rhyme.

Arnold:
Arnold, Arnold, bo-barnold
Banana-fana fo-farnold
Fee-fi-mo-marnold
Arnold!

But if the first two letters are ever the same / I drop them both, then say the name: / Like Bob, Bob, drop the B's: Bo-ob / Or Fred, Fred, drop the F's: Fo-red / Or Mary, Mary, drop the M's: Mo-ary / That's the only rule that is contrary

Okay, now say "bo" -- (Bo!)

Now Tony with a "B" -- (Bo-ny!)

Then banana fana and fo -- (Banana fana-fo!)

Then you say the name again with an "f" very plain (Fo-ny!)

Then a fee-fi and mo -- (Fee-fi-mo!)

Then you say the name again with an "M" this time -- (Mo-ny!)

And there isn't any name that you can't rhyme

Everybody do Tony:
Tony, Tony, bo-bony
Banana-fana fo-fony
Fee-fi-mo-mony
Tony!

Pretty good, let's do Billy:
Billy, Billy, bo-illy
Banana-fana fo-filly
Fee-fi-mo-milly
Billy!

Very good, now let's do Marsha:
Marsha, Marsha, bo-barsha
Banana-fana fo-farsha
Fee-fi-mo-arsha
Marsha!

A little trick with Nick:
Nick, Nick, bo-bick
Banana-fana fo-fick
Fee-fi-mo-mick
Nick!

The name game!

(Elis Sherley: The Name Game)

 

Ihre Aufgabe: erstellen Sie Ihre eigene Strophe (und genießen Sie die kleine Zeireise in die Sechziger).

0 Kommentare

Bitte melde dich an um einen Kommentar abzugeben

4 Lösung(en)

// NET 6.x | C# 10.x | VS-2022 => refactored
var names = new List<string> { "Arnold", "Shirley", "Billy", "Tony", "Marsha", "Nick", "Jens" };
names.ForEach(x => PrintSong(x));

static void PrintSong(string name) {
    Console.WriteLine($"{name}, {name}, {GetName(name, 'b')}" +
    $"\nBanana-fana {GetName(name, 'f')}" +
    $"\nFee-fi-{GetName(name, 'm')}\n{name}!\n");
}

static string GetName(string s, char c) {
    var pos = s.IndexOf(s.Where(x => char.ToUpper(x) is 'A' or 'E' or 'I' or 'O' or 'U').First());
    return $"{c}o-" + (s[0] == char.ToUpper(c) ? s[1..] : $"{c}" + (pos == 0 ? s.ToLower() : s[pos..]));
}
                

Lösung von: Jens Kelm (@JKooP)

function getNameGameVerse(name) {

  name = name.toLowerCase();
  name = name[0].toUpperCase() + name.slice(1);

  let firstVowelPos = (function() {
    let vowels =
      'aeiouàáâãäåæèéêëìíîïòóôõöøùúûü?????????????????œ??????' // etc.
    .split('');

    function isVowel(char) {
      return vowels.indexOf(char) >= 0;
    }

    // der Y-fall.
    // ob das funktioniert? man kann nur beten.
    if (isVowel(name[0].toLowerCase())) return 0;
    if (name[0] == 'Y' && !isVowel(name[1])) return 0;
    if (name[0] == 'Y' && isVowel(name[1])) return 1;
    vowels = vowels.concat(vowels, 'yÿý'.split(''));
    for (let i = 1; i < name.length; i++)
      if (isVowel(name[i])) return i;
  })();

  let init  = name[0].toLowerCase(),
      trunk = name.slice(firstVowelPos).toLowerCase(),
      b = trunk, f = trunk, m = trunk;

  switch (init) {
    case 'b':
      f = 'f' + trunk;
      m = 'm' + trunk;
      break;
    case 'f':
      b = 'b' + trunk;
      m = 'm' + trunk;
      break;
    case 'm':
      b = 'b' + trunk;
      f = 'f' + trunk;
      break;
    default:
      b = 'b' + trunk;
      f = 'f' + trunk;
      m = 'm' + trunk;
  }

  return (`
    <p>${name}:<br>
    ${name}, ${name}, bo-${b}<br>
    Banana-fana fo-${f}<br>
    Fee-fi-mo-${m} —<br>
    ${name}!<br></p>
  `);
}

// ausgabe
document.write( getNameGameVerse('Lisa') );

/* =>
Lisa:
Lisa, Lisa, bo-bisa
Banana-fana fo-fisa
Fee-fi-mo-misa —
Lisa!
*/

                

Lösung von: Lisa Salander (Heidi-Klum-Gymnasium Bottrop)

// C++ 14 | VS-2022
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

std::string get_name(const std::string& str, const char& chr) {
    const std::string vow{ "aeiouAEIOU" };
    auto low{ str };
    std::transform(low.begin(), low.end(), low.begin(), ::tolower);
    const auto pos{ [&str, &vow]() {
        for (auto i { 0}; i < str.length(); i++) 
            if (vow.find(str[i]) != std::string::npos) return i;
        return -1; } };
    std::string out{ chr };
    if (pos() > -1) return out + "o-" + (str[0] == std::toupper(chr) ? low.substr(1) : chr + (pos() == 0 ? low : low.substr(pos())));
    return str;
}

void print(const std::string& name) {
    std::cout << name << ", " << name << ", " << get_name(name, 'b')
        << "\nBanana-fana " << get_name(name, 'f')
        << "\nFee-fi-" << get_name(name, 'm')
        << "\n" << name << "!\n\n";
}

int main() {
    std::vector<std::string> v{ "Shirley", "Lincoln", "Arnold", "Tony", "Billy", "Marsha", "Nick", "Jens"};
    for(const auto& i : v) print(i);
}
                

Lösung von: Jens Kelm (@JKooP)

' für VBA

Sub Main() 'mit [Strg + G] Direktbereich öffnen
    Dim arr As Variant, i As Integer
    arr = Array("Shirley", "Lincoln", "Arnold", "Tony", "Billy", "Marsha", "Nick", "Jens")
    For i = 0 To UBound(arr)
        Debug.Print GetSong(arr(i))
    Next
End Sub

Function GetName(str As String, chr As String) As String
    Dim pos As Integer
    Dim res As String, low As String, tmp As String
    low = LCase(str)
    pos = GetPos(str)
    If pos > 0 Then
        If Left(str, 1) = UCase(chr) Then
            tmp = Mid(low, 2)
        Else
            If pos = 1 Then
                tmp = chr & low
            Else
                tmp = chr & Mid(low, pos)
            End If
        End If
        res = chr & "o-" & tmp
    Else
        res = str
    End If
    GetName = res
End Function

Function GetPos(str As String) As Integer
    Dim res As Integer, i As Integer, pos As Integer
    For i = 1 To Len(str)
        pos = InStr("aeiouAEIOU", Mid(str, i, 1))
        If pos > 0 Then
            res = i
            Exit For
        End If
    Next i
    GetPos = res
End Function

Function GetSong(ByVal name As String) As String
    GetSong = name & ", " & name & ", " & GetName(name, "b") & vbCrLf & _
    "Banana-fana " & GetName(name, "f") & vbCrLf & _
    "Fee-fi-" & GetName(name, "m") & vbCrLf & _
    name & "!" & vbCrLf & vbCrLf
End Function
                

Lösung von: Jens Kelm (@JKooP)

Verifikation/Checksumme:

Earl:
Earl, Earl, bo-bearl
Banana-fana fo-fearl
Fee-fi-mo-mearl
Earl!

Philipp:
Philipp, Philipp, bo-bilipp
Banana-fana fo-filipp
Fee-fi-mo-milipp
Philipp!

Yvonne:
Yvonne, Yvonne, bo-byvonne
Banana-fana fo-fyvonne
Fee-fi-mo-myvonne
Yvonne!

Yannick:
Yannick, Yannick, bo-bannick
Banana-fana fo-fannick
Fee-fi-mo-mannick
Yannick!

Aktionen

Bewertung

Durchschnittliche Bewertung:

Eigene Bewertung:
Bitte zuerst anmelden

Meta

Zeit: 0.5
Schwierigkeit: Leicht
Webcode: q9in-p9ir
Autor: ()

Download PDF

Download ZIP

Zu Aufgabenblatt hinzufügen