private static string GeneraAddRel(ref NomiClass gen, bool lettere) { char carattere3 = RandomClass.RandomLetteraRelazione(); if (lettere) { char carattere1 = RandomClass.RandomLettera(); char carattere2 = RandomClass.RandomLettera(); return("addrel \"" + carattere1 + "\" \"" + carattere2 + "\" \"" + carattere3 + "\""); } String nome1, nome2; int n1, n2; Random rand = new Random(); n1 = rand.Next(11); n2 = rand.Next(11); if (n1 <= 8) { nome1 = gen.GeneraNomeUsato(); } else { nome1 = gen.NomeCasuale(); } if (n2 <= 7) { nome2 = gen.GeneraNomeUsato(); } else { nome2 = gen.NomeCasuale(); } return("addrel " + nome1 + " " + nome2 + " \"" + carattere3 + "\""); }
private static void Main(string[] args) { if (args.Length > 0) { Main2(args, true); return; } int nCicli = RandomClass.RandomInt(7, 10); for (int i = 0; i < nCicli; i++) { int n = GeneratoreClass.GeneraNumeroTest() + i; int righe = GeneratoreClass.GeneraRighe() + i; args = new string[] { "-g", n.ToString(), righe.ToString(), "Y" }; Main2(args, false); } }
private static string GeneraDelEnt(ref NomiClass gen, bool lettere) { if (lettere) { char carattere = RandomClass.RandomLettera(); return("delent \"" + carattere + "\""); } string nome; Random rand = new Random(); int n = rand.Next(11); if (n <= 5) { nome = gen.GeneraNomeUsato(); } else { nome = gen.NomeCasuale(); } gen.RimuoviDaUsati(nome); return("delent " + nome); }
internal static int GeneraRighe() { return(RandomClass.RandomInt(100, 200) * RandomClass.RandomInt(1, 4) * RandomClass.RandomInt(100, 200) * RandomClass.RandomInt(2, 5)); }
internal static int GeneraNumeroTest() { return(RandomClass.RandomInt(10, 100)); }