I'm making my first text adventure game with C#, and I was just wondering how I would loop back to a previous if statement. For Example:
if (x == 2 || y == 3)
{
//do this
if ( z > 3 || v = 6)
{
//do this
}
}
What would I use to make it go from the nested if, to the top if statement?
EDIT: more specifically:
//start
System.Console.WriteLine("You awake in a stupor. The sun blinds you as you roll over to breathe the new day.");
System.Console.WriteLine(" ");
System.Console.WriteLine(" ");
System.Console.WriteLine("To your (west), you see a volcanic mountain, with a scraggly, dangerous looking path.");
System.Console.WriteLine(" ");
System.Console.WriteLine("In the (east), you see a thick forrest. there is nothing visible past the treeline.");
System.Console.WriteLine(" ");
System.Console.WriteLine("Looking (south), you see a long winding road that seems to have no end.");
System.Console.WriteLine(" ");
System.Console.WriteLine("Hearing a sound of celebration, you look to the (north). There appears to be a city, with a celebration going on.");
System.Console.WriteLine(" ");
System.Console.WriteLine(" ");
System.Console.WriteLine("Which direction would you like to travel?");
string direction1 = Convert.ToString(Console.ReadLine());
//first decision (north)
if (direction1 == "north" || direction1 == "North")
{
Console.WriteLine("You proceed towards the north, only to be stopped by a guard:");
Console.WriteLine("Guard: 'the kingdom of al'arthar is off limits to outsiders today, its the queens birthday, and the kingdom is packed full");
Console.WriteLine(" ");
Console.WriteLine(" ");
Console.WriteLine("you can either try to (swindle) the guard, or (leave). What will you do?");
string guardConvo1 = Convert.ToString(Console.ReadLine());
Say, for example, if someone traveled North in this scenario, and then wanted to go back. Rather than recode the previous if statement, how would I make it just loop back to the previous if statement?