From 243f6d96bf8c471f6ab5539e63e236ec90dc1dab Mon Sep 17 00:00:00 2001 From: Rulet13 Date: Wed, 30 Sep 2026 10:59:12 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Program.cs diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..a27970d --- /dev/null +++ b/Program.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace lab_5 +{ + internal class Program + { + static void Main(string[] args) + { + //z1 + int pokemonHp = 20; + Console.WriteLine("\n=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ==="); + Console.WriteLine("Текущее здоровье покемона: " + pokemonHp); + HealPokemon(ref pokemonHp); + Console.ReadKey(); + + //z2 + Console.WriteLine("\n=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ==="); + Console.WriteLine("Вы зашли в траву............."); + string pkmnName; + int pkmnLevel; + SearchBushes(out pkmnName, out pkmnLevel); + Console.ReadKey(); + + //z3 + Console.WriteLine("\n=== РЕГИСТРАЦИЯ НА ТУРНИР ==="); + string[] pokemons1 = { "Бульбазавр", "Чармандер" }; + string[] pokemons2 = { "Сквиртл", "Пикачу", "Псайдак", "Мяут" }; + double difficultyReg = 1.5; + RegisterTournament(in difficultyReg, pokemons1); + Console.WriteLine("--------------------------------------"); + RegisterTournament(in difficultyReg, pokemons2); + Console.ReadKey(); + } + static void HealPokemon(ref int pkmnHp) + { + pkmnHp += 80; + if (pkmnHp > 100) + { + pkmnHp = 100; + Console.WriteLine($"[Покецентр] Покемон полностью здоров. Текущее хп: {pkmnHp}"); + } + else + { + Console.WriteLine("[Покецентр] Текущее хп после лечения " + pkmnHp); + } + } + static void SearchBushes(out string foundPokemon, out int pokemonlevel) + { + Random randomnum = new Random(); + pokemonlevel = randomnum.Next(1, 15); + foundPokemon = "Пикачу"; + Console.WriteLine($"Шорох!! Из кустов появляется дикий {foundPokemon} (Уровень: {pokemonlevel})!"); + + } + static void RegisterTournament(in double difficulty, params string[] participants) + { + //difficulty = 1,3; + Console.WriteLine("Коэффициент стадиона: " + difficulty); + Console.WriteLine("Список участников: "); + foreach (string pokemon in participants) + { + Console.WriteLine($"* {pokemon}"); + } + } + } +}