Omg i did this

Okay. I made two separate voids to check input in each of them, so if input == password which I think about
terminal prints “Database hacked” and if input is different terminal prints “Password inccorect, try again”:

void passwordOneCheck(string input)
    {
      
        if (input == "книга")
        {
            Terminal.WriteLine("База данных взломана.");
        }
        else if (input != "книга")
        {
            Terminal.WriteLine("Не верный пароль, попробуйте снова.");
        }

                
    }

void passwordTwoCheck(string input)
    {

        if (input == "пулемет")
        {
            Terminal.WriteLine("База данных взломана.");
        }
        else if (input != "пулемет")
        {
            Terminal.WriteLine("Не верный пароль, попробуйте снова.");
        }

So if we are on level 1 we run passwordOneCheck if we are on level 2 we run passwordTwoCheck

if (input == "меню") 
        {
            WelcomeMenu();
        }

        else if (currentScreen == Screen.MainMenu)
        {
            RunMainMenu(input);
        }

        else if (level == 1)
        {
            passwordOneCheck(input);
        }

        else if (level == 2)
        {
            passwordTwoCheck(input);
        }

I’m Russian and im not best in English but I hope you understand the idea :smiley: took me 2 hours of strugle to do that.

1 Like

Hello Oleg, welcome to the community :slight_smile:

Well done on your successes and there is no need to apologise about your English, it’s great.

Just so you know, you can copy/paste your code into the forum and then just apply the code formatting characters both before and after so that it appears correctly. This is often more suitable than a screenshot, as if you are asking for help it allows others to copy/paste parts of your code back to you, without having to type it all out themselves.

Hope this helps and again, welcome to the community :slight_smile:


See also;

alright i edited my post, thanks for information

1 Like

It was only really for future reference, but thank you, and well done again :slight_smile:

I like that you’ve taken a different route for your passwords! I just did an IF/AND check based on whether difficulty = 1, 2 or 3. Others as I’m sure you have seen assigned a variable “password” to be checked or updated depending on user input. So many different ways to complete this challenge!

Privacy & Terms