Skip to content

Instantly share code, notes, and snippets.

Created September 10, 2016 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/224304daffea1a3f25648f6ea7e988ba to your computer and use it in GitHub Desktop.
Save anonymous/224304daffea1a3f25648f6ea7e988ba to your computer and use it in GitHub Desktop.
int caseSwitch = 1;
switch (caseSwitch)
{
case 1:
while(true)
{
Console.WriteLine("MENU 1 ##### 1 2 3");
string inp = Console.ReadLine();
if (inp.Length > 0) {
if (inp == "1") { goto case 1; }
if (inp == "2") { goto case 2; }
if (inp == "3") { goto case 3; }
}
}
case 2:
while (true)
{
Console.WriteLine("MENU 2 ##### 1 2 3");
string inp = Console.ReadLine();
if (inp.Length > 0)
{
if (inp == "1") { goto case 1; }
if (inp == "2") { goto case 2; }
if (inp == "3") { goto case 3; }
}
}
case 3:
while (true)
{
Console.WriteLine("MENU 3 ##### 1 2 3");
string inp = Console.ReadLine();
if (inp.Length > 0)
{
if (inp == "1") { goto case 1; }
if (inp == "2") { goto case 2; }
if (inp == "3") { goto case 3; }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment