Opzione 4
This commit is contained in:
parent
9f8919a5b5
commit
c2792696c8
25
Program.cs
25
Program.cs
@ -7,8 +7,9 @@ class Program {
|
|||||||
Console.Clear();
|
Console.Clear();
|
||||||
int scelta, lineaAutobus, lineaAutobus2, fermataAutobus, conto;
|
int scelta, lineaAutobus, lineaAutobus2, fermataAutobus, conto;
|
||||||
(string[], string[], bool[,]) configurazione = Configurazione();
|
(string[], string[], bool[,]) configurazione = Configurazione();
|
||||||
string[] fermateAutobus = configurazione.Item1, lineeAutobus= configurazione.Item2;
|
string[] fermateAutobus = configurazione.Item1, lineeAutobus = configurazione.Item2;
|
||||||
bool[,] corrispondenzaLineaFermata = configurazione.Item3;
|
bool[,] corrispondenzaLineaFermata = configurazione.Item3;
|
||||||
|
bool nullo = true;
|
||||||
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -63,7 +64,7 @@ class Program {
|
|||||||
conto = 0;
|
conto = 0;
|
||||||
lineaAutobus = SelezionaElementoArray(lineeAutobus);
|
lineaAutobus = SelezionaElementoArray(lineeAutobus);
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
|
|
||||||
Console.WriteLine($"La linea {lineeAutobus[lineaAutobus]} ha le fermate:");
|
Console.WriteLine($"La linea {lineeAutobus[lineaAutobus]} ha le fermate:");
|
||||||
for (int i = 0; i < corrispondenzaLineaFermata.GetLength(0); i++) {
|
for (int i = 0; i < corrispondenzaLineaFermata.GetLength(0); i++) {
|
||||||
if (corrispondenzaLineaFermata[i, lineaAutobus]) {
|
if (corrispondenzaLineaFermata[i, lineaAutobus]) {
|
||||||
@ -77,7 +78,25 @@ class Program {
|
|||||||
case 4:
|
case 4:
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
lineaAutobus = SelezionaElementoArray(lineeAutobus);
|
lineaAutobus = SelezionaElementoArray(lineeAutobus);
|
||||||
|
Console.Clear();
|
||||||
lineaAutobus2 = SelezionaElementoArray(lineeAutobus);
|
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();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
@ -170,7 +189,7 @@ class Program {
|
|||||||
Console.WriteLine("Opzione non valida.");
|
Console.WriteLine("Opzione non valida.");
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r++;
|
r++;
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("matrix_4")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("matrix_4")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[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.AssemblyProductAttribute("matrix_4")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("matrix_4")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("matrix_4")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
bed50ea4f11c788e1d8baa9bb78b38bfe5902dba3b657e8830dfc1654dab19d4
|
80491e960ab3c3ece613e74c8824978a6fa119e6468122d8e986f574efda6e8a
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user