public void MainMenu(int i) { Console.WriteLine("Select an option..."); Console.WriteLine("0 - Generic Test File"); Console.WriteLine("1 - Prime numbers generator and binary search"); Console.WriteLine("2 - Eight Queen Problem"); Console.WriteLine("3 - Buy Sell Gold"); Console.WriteLine("4 - ParallelMatrixComputation"); ConsoleKeyInfo key = Console.ReadKey(); Console.WriteLine(i); switch (key.KeyChar) { case '0': SecondaryMenu.Meh(); break; case '1': BinarySieve.ExecuteBinaryAndSieve(); break; case '2': EightQueenProblem.Backtracking(); break; case '3': BuySellGold.Initialize(); break; case '4': ParallelMatrixMultiplication.ExecuteMultiplyMatrices(); break; } }
public static void Initialize() { BuySellGold buySellGold = new BuySellGold(); //int[] pricesGroup = new int[10000]; //Random rnd = new Random(); //for (int i = 0; i < pricesGroup.Length; i++) //{ // pricesGroup[i] = rnd.Next(rnd.Next(0, 100000), 10000000); //} int[] pricesGroup = new int[] { 200, 187, 167, 133, 121, 100, 70, 55, 23, 1 }; buySellGold.bestDays = buySellGold.FindMaxOrMinDifference(pricesGroup, pricesGroup.Length); buySellGold.WriteResults(); IMenuController alg = new Algorythms() as IMenuController; alg.MainMenu(); }