Challenge

cu2_s02_conditional_program_flow_using_if

#1

Incorrect Entry:
image

Easter Egg:
image

Code:

public class Hacker : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        ShowMainMenu("        Select Target System");
    }

    void ShowMainMenu(string message)
    {
        Terminal.ClearScreen();
        Terminal.WriteLine("Anodyne Sytems Terminal Interface v1.8\n");
        Terminal.WriteLine("\n"+message+"\n");
        Terminal.WriteLine("1. Natalie's Cell Phone");
        Terminal.WriteLine("2. Amaretto High School");
        Terminal.WriteLine("3. Reliable Construction Inc\n");
    }

    void OnUserInput(string input)
    {
        print("The user typed: " + input);
        if (input == "menu")
        {
            ShowMainMenu("        Select Target System");
        }
        else if (input == "frak")
        {
            ShowMainMenu("Chiana says hi!  Please try again.");
        }
        else
        {
            ShowMainMenu("Invalid Input.  Please try again.");
        }

    }
}

#2

Would you mind telling me how you shared your code like that? It seems much better than a screenshot. It’s probably something very simple but I’d love to know for future posts. Thanks!


#3

Sorry for taking so long to respond. If I remember correctly, I just make sure to separate the lines like so:

And then highlight the text I want separate like that, then I just click the Preformatted text button.

I think I found it important to have a line above and below that were blank. It’s been a little while and I don’t have enough text to test it out here.


#4

Thanks for the response, I appreciate it