Wednesday, April 22, 2015

reusing Ifs anywere without typing it over and over

This is what i'm trying to achive, but I want it to automatically initiate when the Console.Readline() method is called

MainMenu:

string PlayerReply = Console.ReadLine()

if(List.About.Contains(PlayerReply.ToLower()))
{
    MessageBox.Show("Test");
    goto MainMenu;
}
else if (List.Quit.Contains(PlayerReply.ToLower()))
{
    Environment.Exit(0);
}

No comments:

Post a Comment