I'm coding "Higher / Lower". I commented where is the problem. Please don't spoiler the full solution of that game.
static void Main(string[] args)
{
Console.WriteLine("Higher ! Lower Game");
Console.WriteLine("\nSchwierigkeitsstufen:\nEasy: 1 - 100\nMedium: 100 - 1000\nHard: 1000 - 10000");
Console.WriteLine("\nWähle ein Level!");
string auswahl = Convert.ToString(Console.ReadLine());
Console.WriteLine("\nDu hast " + auswahl + " gewählt\nBist du sicher?\n'Ja' / 'Nein'");
string confirm = Convert.ToString(Console.ReadLine());
/// TEXT
/// PROZESS
if (confirm == "Ja")
{
if (auswahl == "Easy")
{
Console.WriteLine("\nGebe eine Zahl ein!");
int eingabe = Convert.ToInt32(Console.ReadLine());
Random rnd = new Random();
int rmd = rnd.Next(0, 99);
while (eingabe != rmd)
{
int eingabe2 = Convert.ToInt32(Console.ReadLine());
while (eingabe < rmd)
{
Console.WriteLine("Higher");
return; /// Here, it should go back to "eingabe2" to let the user guess again. if im trying: "return eingabe2;" there comes the error "CS0127".
}
while (eingabe > rmd)
{
Console.WriteLine("Lower");
return; /// Here, it should go back to "eingabe2" to let the user guess again. if im trying: "return eingabe2;" there comes the error "CS0127".
}
}
}
}
}