How do i make these Readlines not interfere with each other
Its a menu and it has problems
![No description](https://cdn.answeroverflow.com/1194759226850029608/Screenshot_2024-01-10_224355.png)
26 Replies
Console.WriteLine("This is a menu test");
Console.WriteLine("there are (4) options");
Console.WriteLine("");
Console.WriteLine("Start (1) ");
Console.WriteLine("Help (2) ");
Console.WriteLine("Exit (3)");
//declaration
string choice;
do{
choice = Console.ReadLine();
if(choice == "1") {
Console.WriteLine("Yay start"); Console.WriteLine("say something"); string answer = Console.ReadLine(); Console.WriteLine(answer);
}
if(choice == "2") { Console.WriteLine("Do this"); }
if(choice == "3") { Console.WriteLine("Bye bye"); return; } else { Console.WriteLine("that was not an answer"); } }while (choice != "quit");
if(choice == "1") {
Console.WriteLine("Yay start"); Console.WriteLine("say something"); string answer = Console.ReadLine(); Console.WriteLine(answer);
}
if(choice == "2") { Console.WriteLine("Do this"); }
if(choice == "3") { Console.WriteLine("Bye bye"); return; } else { Console.WriteLine("that was not an answer"); } }while (choice != "quit");
what do you mean by interfere?
also, $code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/
To post C# code type the following:
```cs
// code here
```
Get an example by typing $codegif
in chat
For longer snippets, use: https://paste.mod.gg/just do what the text says
ile show the terminal output
?
![No description](https://cdn.answeroverflow.com/1194760158409142272/Screenshot_2024-01-10_224956.png)
your problem isn't the readlines
your problem is the logic in your loop
wait
i got thrown off by your spacing
i mean, they're not interfering with each other because that's not a thing that can happen
i mean they are active at the same time
what does "active" mean?
i mean the else
else
{
Console.WriteLine("that was not an answer");
}
okay, so look at all your if statements
follow the logic in your code
they are all in the same lane