diff --git a/works/sharp/lab-05/Program.cs b/works/sharp/lab-05/Program.cs index 92a765f..0516e43 100644 --- a/works/sharp/lab-05/Program.cs +++ b/works/sharp/lab-05/Program.cs @@ -13,6 +13,14 @@ using System; Console.WriteLine($"Здоровье после лечения: {pokemonHP} HP."); Console.WriteLine(); + static void HealPokemon(ref int hp) + { + hp += 80; + + Console.WriteLine($"[Покецентр] Покемон полностью здоров! Восстановлено 80 HP."); + Console.WriteLine($"[Покецентр] Покемон полностью здоров! Восстановлено {healed} HP."); + } + // ЗАДАНИЕ 2 Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ==="); Console.WriteLine("Вы зашли в высокую траву..."); @@ -20,6 +28,13 @@ using System; Console.WriteLine($"Шорох! Из кустов появляется дикий {foundPokemon} (Уровень: {pokemonLevel})!"); Console.WriteLine(); + static void SearchBushes(out string foundPokemon, out int pokemonLevel) + { + Random rnd = new Random(); + foundPokemon = "Пикачу"; + pokemonLevel = rnd.Next(1, 16); + } + // ЗАДАНИЕ 3 Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ==="); double difficulty = 1.5; @@ -31,23 +46,6 @@ using System; Console.ReadLine(); } - // ЗАДАНИЕ 1 - static void HealPokemon(ref int hp) - { - int healed = 100 - hp; - hp = 100; - Console.WriteLine($"[Покецентр] Покемон полностью здоров! Восстановлено {healed} HP."); - } - - // ЗАДАНИЕ 2 - static void SearchBushes(out string foundPokemon, out int pokemonLevel) - { - Random rnd = new Random(); - foundPokemon = "Пикачу"; - pokemonLevel = rnd.Next(1, 16); - } - - // ЗАДАНИЕ 3 static void RegisterTournament(in double difficulty, params string[] participants) {