using System;
class Program
{
static void Main()
{
String wort;
Char tipp;
Int32 i;
Console.Write("\n\n\tBitte geben Sie das Wort ein das zu erraten ist!: ");
wort = Console.ReadLine();
Char[] wortsplit = new Char[wort.Length];
wortsplit = wort.ToCharArray();
Char[] tippsplit = new Char[wort.Length];
while (tippsplit != wortsplit)
{
Console.Write("\n\t\tBitte geben Sie einen Buchstaben ein!: ");
tipp = Convert.ToChar(Console.ReadLine());
for (i = 0; i < wort.Length; i++)
{
if (wortsplit[i] == tipp)
{
tippsplit[i] = tipp;
}
else if (wortsplit[i] != tipp && wortsplit[i] != tippsplit[i])
{
tippsplit[i] = '-';
}
Console.Write(tippsplit[i]);
}
}
Console.WriteLine("\n\n\t Glückwunsch Sie haben das Wort erraten! \n\n\tEs lautet{0}", wortsplit);
}
}
Ich weiß nicht wieso aber ich bleib in der While hängen. Die logische Bedingung sollte eigentlich stimmen.Aber irgendwie scheint tippsplit und wortsplit nie gleich zu sein.
Danke für die Hilfe im Vorraus !







