public static void Generatore(string[] args, bool interagisciFinale) { //=> syntax .exe -g [NUM_TEST] [AVARAGE_LINES_PER_TEST] [LETTERE (Y/N)] //=> example .exe -g 100 150 Y if (args.Length < 3) { ConsoleClass.ConsoleStampaConInterazioneUtente("Need more arguments", interagisciFinale); return; } RandomClass.rnd = new Random(); DirectoryClass.CreaDirectory(); int n_test = Convert.ToInt32(args[1]); int avg_lines = Convert.ToInt32(args[2]); bool lettere = args[3].ToString().ToLower() == "y"; for (int i = 0; i < n_test; i++) { GeneraTest(avg_lines, interagisciFinale, lettere); } ConsoleClass.ConsoleStampaConInterazioneUtente(n_test + " generated.", interagisciFinale); return; }
private static void GeneraTest(int avg_lines, bool interagisciFinale, bool lettere) { NomiClass genNomi = new NomiClass(); List <string> L = new List <string>(); for (int i = 0; i < avg_lines; i++) { L.Add(GeneraLinea(ref genNomi, lettere)); } L.Add("end"); string output_path = DirectoryClass.GetOutputPath(); File.WriteAllLines("i/" + output_path, L); var r = SolveClass.Solve("i/" + output_path, interagisciFinale); DirectoryClass.Save("o/" + output_path, r); }