diff --git a/works/lab-01/src/main.cs b/works/lab-01/src/main.cs new file mode 100644 index 0000000..665b93a --- /dev/null +++ b/works/lab-01/src/main.cs @@ -0,0 +1,23 @@ +namespace DefaultNamespace; + +public class main +{ + static void Main(string[] args) { + Console.Write("Введите имя тренера: "); + string trainerName = Console.ReadLine(); + Console.Write("Введите имя покемона: "); + string pokemonName = Console.ReadLine(); + Console.Write("Введите стихию: "); + string elementType = Console.ReadLine(); + Console.Write("Введите регион: "); + string regionName = Console.ReadLine(); + + Console.WriteLine(); + Console.WriteLine("****************************************"); + Console.WriteLine("ПАСПОРТ ПОКЕМОНА"); + Console.WriteLine($"Тренер: {trainerName} (Регион: {regionName})"); + Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]"); + Console.WriteLine("****************************************"); + + } +} \ No newline at end of file diff --git a/works/lab-05/Readme.md b/works/lab-05/Readme.md new file mode 100644 index 0000000..ee3a960 --- /dev/null +++ b/works/lab-05/Readme.md @@ -0,0 +1,63 @@ +# Техническое задание №1 + +* **Студент:** [Мастио Вячеслав Алексеевич] + +--- + +## Ключевой код +```csharp + static void Main(string[] args) + { + Console.Write("Введите, пожалуйста, стадию карточки: "); + string stage = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, имя покемона: "); + string name = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, вид покемона: "); + string category = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, название первой атаки: "); + string attack1Name = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, описание первой атаки: "); + string attack1Desc = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, название второй атаки: "); + string attacck2Name = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, описание второй атаки: "); + string attacck2Desc = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, слабость покемона: "); + string weakness = Console.ReadLine(); + + Console.Write("Введите, пожалуйста, сопротивление покемона: "); + string resistance = Console.ReadLine(); + + + int hp = 60; + int number = 25; + double height = 0.4; + double weight = 1.0; + int attack2Damage = 20; + int retreatCost = 1; + Console.Clear(); + + Console.WriteLine("======================================================================"); + Console.WriteLine($"[{stage}]{name} ОЖ: {hp}[⚡]" ); + Console.WriteLine("----------------------------------------------------------------------"); + Console.WriteLine($"№ {number} | Вид: {category} | Рост: {height} | Вес: {weight}"); + Console.WriteLine("----------------------------------------------------------------------"); + Console.WriteLine($"[Атака 1]{attack1Name}"); + Console.WriteLine($"Эффект: {attack1Desc}"); + Console.WriteLine(); + Console.WriteLine($"[Атака] {attacck2Name} Урон: {attack2Damage}+"); + Console.WriteLine($"Эффект: {attacck2Desc}"); + Console.WriteLine("----------------------------------------------------------------------"); + Console.WriteLine($"Слабость: {weakness}"); + Console.WriteLine($"Устойчиов: {resistance}"); + Console.WriteLine($"Отступление: {retreatCost} энергия"); + } +} +``` diff --git a/works/lab-05/src/ex1.cs b/works/lab-05/src/ex1.cs new file mode 100644 index 0000000..f5741e1 --- /dev/null +++ b/works/lab-05/src/ex1.cs @@ -0,0 +1,23 @@ +namespace DefaultNamespace; + +public class ex1 +{ + static void HealPokemon(ref int pokemonHP) + { + pokemonHP += 80; + Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP."); + } + + static void Main(string[] args) + { + Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ==="); + int pokemonHP = 20; + Console.WriteLine($"Здоровье до лечения: {pokemonHP} HP."); + + HealPokemon(ref pokemonHP); + + Console.WriteLine($"Здоровье после лечения: {pokemonHP} HP."); + + + } +} \ No newline at end of file diff --git a/works/lab-05/src/ex2.cs b/works/lab-05/src/ex2.cs new file mode 100644 index 0000000..f2e3a29 --- /dev/null +++ b/works/lab-05/src/ex2.cs @@ -0,0 +1,29 @@ +namespace DefaultNamespace; + +public class ex2 +{ + static void SearchBushes(out string foundPokemon, out int pokemonLevel) + { + foundPokemon = "Пикачу"; + + Random random = new Random(); + pokemonLevel = random.Next(1, 16); + } + + static void Main(string[] args) + { + Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ==="); + Console.WriteLine("Вы зашли в высокую траву..."); + + SearchBushes(out string foundPokemon, out int pokemonLevel); + + Console.WriteLine($"Шорох! Из кустов появляеться дикикй {foundPokemon} (Уровень: {pokemonLevel})"); + Console.WriteLine(); + + } + + + + + +} \ No newline at end of file diff --git a/works/lab-05/src/ex3.cs b/works/lab-05/src/ex3.cs new file mode 100644 index 0000000..3948d7f --- /dev/null +++ b/works/lab-05/src/ex3.cs @@ -0,0 +1,31 @@ +namespace DefaultNamespace; + +public class ex3 +{ + static void RegisterTourment(in double x, in double difficulty, params string[] participants) + { + Console.WriteLine($"Коэффициент стадиона: {difficulty}"); + Console.WriteLine("Список участников:"); + + foreach (string pokemon in participants) + { + Console.WriteLine($" * {pokemon}"); + } + } + + static void Main(string[] args) + { + Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ==="); + double stadiumDifficulty = 1.5; + + // Первый вызов: 2 покемона через params + RegisterTournament(in stadiumDifficulty, "Булбазавр", "Чармандер"); + Console.WriteLine("-----------------------------"); + + // Второй вызов: 4 покемона через params + RegisterTournament(in stadiumDifficulty, "Сквиртл", "Пикачу", "Псайдак", "Мяут"); + Console.WriteLine("============================="); + } + + +} \ No newline at end of file