Changed the PrintMatches method to print it like in the provided video. Changed the input method to print it like in the provided video.
This commit is contained in:
parent
3af70b437a
commit
064de099f8
1 changed files with 15 additions and 3 deletions
|
|
@ -179,11 +179,17 @@ public static class QualData
|
|||
/// <param name="matches">Array of matches to print</param>
|
||||
private static void PrintMatches(Match[] matches)
|
||||
{
|
||||
Console.WriteLine($"{"Home",-15} {"Guest",-20}");
|
||||
for(int i = 0; i < 39; i++)
|
||||
{
|
||||
Console.Write("=");
|
||||
}
|
||||
Console.WriteLine();
|
||||
foreach (var match in matches)
|
||||
{
|
||||
TeamResult homeTeam = match.HomeTeam;
|
||||
TeamResult guestTeam = match.GuestTeam;
|
||||
Console.WriteLine($"{homeTeam.TeamName} {homeTeam.Goals} - {guestTeam.Goals} {guestTeam.TeamName}");
|
||||
Console.WriteLine($"{homeTeam.TeamName,-14} | {guestTeam.TeamName, -15} => {homeTeam.Goals}:{guestTeam.Goals}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -197,11 +203,17 @@ public static class QualData
|
|||
private static string AskForCountry(string[] possibleCountries)
|
||||
{
|
||||
string country;
|
||||
bool isContained;
|
||||
do
|
||||
{
|
||||
Console.Write("Enter country: ");
|
||||
Console.Write("Enter the name of a country to filter: ");
|
||||
country = Console.ReadLine()!;
|
||||
} while (!IsContained(country!, possibleCountries));
|
||||
isContained = IsContained(country, possibleCountries);
|
||||
if (!isContained)
|
||||
{
|
||||
Console.WriteLine("Invalid input, try again...");
|
||||
}
|
||||
} while (!isContained);
|
||||
|
||||
return country;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue