introduce new bugs
This commit is contained in:
parent
74283e6206
commit
aaf83ceea6
11
Program.cs
11
Program.cs
@ -1,8 +1,8 @@
|
|||||||
using Lab1;
|
using System.Text.Json;
|
||||||
using System.Text.Json;
|
using Lab1;
|
||||||
|
|
||||||
var rand = new Random();
|
var rand = new Random();
|
||||||
var value = rand.Next(1, 101);
|
var value = rand.Next(1, 100);
|
||||||
|
|
||||||
int guess;
|
int guess;
|
||||||
int trials = 0;
|
int trials = 0;
|
||||||
@ -17,8 +17,7 @@ do
|
|||||||
Console.WriteLine("Za mało!");
|
Console.WriteLine("Za mało!");
|
||||||
|
|
||||||
trials++;
|
trials++;
|
||||||
}
|
} while (guess != value);
|
||||||
while (guess != value);
|
|
||||||
|
|
||||||
Console.WriteLine($"Wygrana w {trials} próbie!");
|
Console.WriteLine($"Wygrana w {trials} próbie!");
|
||||||
Console.Write("Podaj swoje imię: ");
|
Console.Write("Podaj swoje imię: ");
|
||||||
@ -40,4 +39,4 @@ File.WriteAllText(FileName, JsonSerializer.Serialize(highScores));
|
|||||||
foreach (var item in highScores.OrderBy(x => x.Trials))
|
foreach (var item in highScores.OrderBy(x => x.Trials))
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{item.Name} -- {item.Trials} prób");
|
Console.WriteLine($"{item.Name} -- {item.Trials} prób");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user