public static void Answer(int questionNumber) { while (true) { int ind1 = default; Console.Write("Your choice: "); string choice = Console.ReadLine(), answer = default; int index = (questionNumber - 1) * 5 + 1; if (choice == "0") { Console.WriteLine("\n" + "Congrats! you won $" + cost + "\n" + "-----------------------------------------------------------------"); ind = "Ending program"; ifChoice0 = 1; return; } if (choice == "1" || choice == "2" || choice == "3") { Tips.tips(choice, questionNumber); continue; } if (choice.ToUpper() == "A") { answer = fileData[index]; } else if (choice.ToUpper() == "B") { answer = fileData[index + 1]; } else if (choice.ToUpper() == "C") { answer = fileData[index + 2]; } else if (choice.ToUpper() == "D") { answer = fileData[index + 3]; } else { Console.WriteLine("Invalid input try again" + "\n"); ind1 = 1; } if (ind1 == 0) { if (answer == nonUpdated[index]) { Console.WriteLine("You are gorgeous" + "\n" + "\n" + "-----------------------------------------------------------------"); return; } else { Console.WriteLine("Unfortunately, this is the wrong answer... Game over." + "\n" + "-----------------------------------------------------------------"); ind = "Ending program"; return; } } } }
public static void Output(int start, int questionNumber) { Console.WriteLine(Decrypt(fileData[start], key)); Console.WriteLine("A: " + Decrypt(fileData[start + 1], key)); Console.WriteLine("B: " + Decrypt(fileData[start + 2], key)); Console.WriteLine("C: " + Decrypt(fileData[start + 3], key)); Console.WriteLine("D: " + Decrypt(fileData[start + 4], key)); Console.WriteLine(); Console.WriteLine("--------------------------Other options--------------------------"); Console.WriteLine(); if (questionNumber > 2) { Console.WriteLine("0: Take money"); } Console.WriteLine(); Tips.TipsOutput(); }