If you have to use more than 2 or 3 strings in the if statement, I would put them in a List or Array in the beginning of the class and use the Enumberable method ‘Contains()’ to query through it.
Something like this:
private string[] levelOneSolution = new ["Atlichna","Popka","Yablaka","Ura","Fcusna"];
[...]
if (levelOneSolution.Contains(input)) {
Terminal.WriteLine("You're in! :)");
}else{
Terminal.WriteLine("Incorrect password");
}
Also, if you compare to a string, that is fully case-insensitive, you can do that with
if(input.Equals("menu", StringComparison.OrdinalIgnoreCase))
in your example, it’s just the first letter that can be written differently, so you could use a Regex statement instead like this:
if(Regex.Match(input, @"^(m|M)enu§").Success){ ... }
You can test your regex statements easily for example on this page: https://regexr.com/
At last, like @Lloyd_Risper already mentioned, use a switch statement inside the second else if for the level integer. If possible, refactor your outputs in their own small private methods with easily readable names. That makes it so much easier to read through your own code and helps to keep methods small and compact.
} else if (currentScreen == Screen.Password) {
switch (level) {
case 1: CompareInputForLevelOne();
break;
case 2: CompareInputForLevelTwo();
break;
case 3: CompareInputForLevelThree();
break;
}
}
private void CompareInputForLevelOne() { ... }
private void CompareInputForLevelTwo() { ... }
private void CompareInputForLevelThree() { ... }
For clean code in general I recommend you ‘Clean Code’ from Robert C. Martin.
It may already be a little bit older, but the design principiles for easily readable and accessible code are still appliable to every code.