diff --git a/Program.cs b/Program.cs index 6617917..4633ba6 100644 --- a/Program.cs +++ b/Program.cs @@ -7,8 +7,9 @@ class Program { Console.Clear(); int scelta, lineaAutobus, lineaAutobus2, fermataAutobus, conto; (string[], string[], bool[,]) configurazione = Configurazione(); - string[] fermateAutobus = configurazione.Item1, lineeAutobus= configurazione.Item2; + string[] fermateAutobus = configurazione.Item1, lineeAutobus = configurazione.Item2; bool[,] corrispondenzaLineaFermata = configurazione.Item3; + bool nullo = true; do { @@ -63,7 +64,7 @@ class Program { conto = 0; lineaAutobus = SelezionaElementoArray(lineeAutobus); Console.Clear(); - + Console.WriteLine($"La linea {lineeAutobus[lineaAutobus]} ha le fermate:"); for (int i = 0; i < corrispondenzaLineaFermata.GetLength(0); i++) { if (corrispondenzaLineaFermata[i, lineaAutobus]) { @@ -77,7 +78,25 @@ class Program { case 4: Console.Clear(); lineaAutobus = SelezionaElementoArray(lineeAutobus); + Console.Clear(); lineaAutobus2 = SelezionaElementoArray(lineeAutobus); + Console.Clear(); + if (lineaAutobus != lineaAutobus2) { + + for (int i = 0; i < corrispondenzaLineaFermata.GetLength(0); i++) { + if (corrispondenzaLineaFermata[i, lineaAutobus] == corrispondenzaLineaFermata[i, lineaAutobus2]) { + Console.WriteLine(fermateAutobus[i]); + nullo = false; + } + } + if (nullo) { + Console.WriteLine("Nessuna"); + } + Console.WriteLine($"Sono le fermate in comune tra le linee {lineeAutobus[lineaAutobus]} e {lineeAutobus[lineaAutobus2]}"); + } + else { + Console.WriteLine("Selezionare due linee differenti."); + } Pausa(); break; @@ -170,7 +189,7 @@ class Program { Console.WriteLine("Opzione non valida."); Pausa(); break; - } + } } r++; c = 0; diff --git a/bin/Debug/net9.0/matrix_4.dll b/bin/Debug/net9.0/matrix_4.dll index 9c47ef2..3e0df22 100644 Binary files a/bin/Debug/net9.0/matrix_4.dll and b/bin/Debug/net9.0/matrix_4.dll differ diff --git a/bin/Debug/net9.0/matrix_4.pdb b/bin/Debug/net9.0/matrix_4.pdb index e43b89c..72f4923 100644 Binary files a/bin/Debug/net9.0/matrix_4.pdb and b/bin/Debug/net9.0/matrix_4.pdb differ diff --git a/obj/Debug/net9.0/matrix_4.AssemblyInfo.cs b/obj/Debug/net9.0/matrix_4.AssemblyInfo.cs index 1a2ff92..426640a 100644 --- a/obj/Debug/net9.0/matrix_4.AssemblyInfo.cs +++ b/obj/Debug/net9.0/matrix_4.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("matrix_4")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+09c2790b6439f86cc13b508eb80180ea9969a5a2")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9f8919a5b574eba0398cd547568ac709b540f80e")] [assembly: System.Reflection.AssemblyProductAttribute("matrix_4")] [assembly: System.Reflection.AssemblyTitleAttribute("matrix_4")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net9.0/matrix_4.AssemblyInfoInputs.cache b/obj/Debug/net9.0/matrix_4.AssemblyInfoInputs.cache index 14160e0..3f27e31 100644 --- a/obj/Debug/net9.0/matrix_4.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/matrix_4.AssemblyInfoInputs.cache @@ -1 +1 @@ -bed50ea4f11c788e1d8baa9bb78b38bfe5902dba3b657e8830dfc1654dab19d4 +80491e960ab3c3ece613e74c8824978a6fa119e6468122d8e986f574efda6e8a diff --git a/obj/Debug/net9.0/matrix_4.dll b/obj/Debug/net9.0/matrix_4.dll index 9c47ef2..3e0df22 100644 Binary files a/obj/Debug/net9.0/matrix_4.dll and b/obj/Debug/net9.0/matrix_4.dll differ diff --git a/obj/Debug/net9.0/matrix_4.pdb b/obj/Debug/net9.0/matrix_4.pdb index e43b89c..72f4923 100644 Binary files a/obj/Debug/net9.0/matrix_4.pdb and b/obj/Debug/net9.0/matrix_4.pdb differ diff --git a/obj/Debug/net9.0/ref/matrix_4.dll b/obj/Debug/net9.0/ref/matrix_4.dll index 24de1e5..95812c7 100644 Binary files a/obj/Debug/net9.0/ref/matrix_4.dll and b/obj/Debug/net9.0/ref/matrix_4.dll differ diff --git a/obj/Debug/net9.0/refint/matrix_4.dll b/obj/Debug/net9.0/refint/matrix_4.dll index 24de1e5..95812c7 100644 Binary files a/obj/Debug/net9.0/refint/matrix_4.dll and b/obj/Debug/net9.0/refint/matrix_4.dll differ