static void Main(string[] args) { ChipArray chipArray = new ChipArray(); Console.WriteLine("\nEnter the type of chips you want to view: "); Console.Write("1. System Chips \n2. Attack Chips\n"); string choice = Console.ReadLine(); bool result = int.TryParse(choice, out int userChoice); if (result) { switch (userChoice) { case 1: List <string> systemChips = CreateList("SystemChips.txt"); chipArray.Chips = ChipArray.SystemData(systemChips); ChipArray.DisplayChips(chipArray.Chips); currentChipsDisplay(chipArray); break; case 2: break; default: break; } } else { Console.WriteLine("Sorry that is not in correct format."); Console.ReadLine(); } Console.WriteLine("Thank You for using!: "); Console.ReadLine(); }
protected static void currentChipsDisplay(ChipArray chipArray) { bool moreChip = true; do { Console.WriteLine("Which chip do you want to view: \n>>>"); int chipChoice = int.Parse(Console.ReadLine()); ChipArray.ChipInfo(chipArray.Chips, chipChoice); Console.WriteLine("\n want to Choose another chip? Y/N: "); string userChoice = Console.ReadLine(); if (userChoice.ToUpper() == "Y") { ChipArray.DisplayChips(chipArray.Chips); moreChip = true; } else { moreChip = false; } } while (moreChip); }