I already learned python and am trying to learn C# by recreating one of my python text based games. in the game there is a main method which is where you can look to fight something, see stats, coins, shop, turn on or off music and quit the program. in python its simply quit() but i cant figure how to just stop the program in C#. i asked people on discord but they cant understand the question and go on rants about random things so ill show the python code then my C# code so far if that helps you understand. Python:
def Main():
print("-------------------------------------------")
choice = input("\n1.fight \n2.Shop \n3.Stats \n4.See coins \n5.music on \n6.music off \n7.quit \nInput:")
if choice == "1":
battlestate()
elif choice == "2":
Shop()
elif choice == "3":
print("-------------------------------------------")
print("health: ",character.health)
print("strength: ",character.strength)
print("armor: ",character.armor)
elif choice == "4":
print("-------------------------------------------")
print("you have: ",character.coins," coins")
Main()
elif choice == "4":
battlestate()
elif choice == "5":
music = True
music = winsound.PlaySound("311 - Love from Afar.wav", winsound.SND_ASYNC | winsound.SND_ALIAS )
Main()
elif choice == "6":
music = False
music = winsound.PlaySound("311 - Love from Afar.wav", winsound.SND_ASYNC | winsound.SND_ALIAS )
Main()
elif choice == "7":
quit()
else:
print("i dont understand, please try again!")
Main()
C#
class Program
{
private void Main()
{
Console.Write("1.Fight \n7.Quit");
string choice = Console.ReadLine();
if (choice == "1")
{
BattleState();
}
else if(choice == "7")
{
}
}