diff --git a/Readme.md b/Readme.md index 60882ca..b37abe2 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ -# Студент: [ФИО] -* **Группа:** [Номер] -* **Курс:** [Название дисциплины] +# Студент: [Беляев] +* **Группа:** [228] +* **Курс:** [2] ## Список работ * [Лабораторная работа №1](./works/lab-01) diff --git a/works/CSharp/lab-01/Readme.md b/works/CSharp/lab-01/Readme.md new file mode 100644 index 0000000..170c414 --- /dev/null +++ b/works/CSharp/lab-01/Readme.md @@ -0,0 +1,70 @@ +# Лабораторная работа №1 + +* **Студент:** [Беляев Антон Сергеевич] +* **Вариант / Карточка:** [Например: #025 Pikachu] + +--- + +## Ключевой код +```csharp + +using System; + +namespace lesson1 +{ + class lesson1 + { + static void Main(string[] args) + { + // Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ"); + // string pokemonName = "Чармандер" ; + // string elementType ="Огонь" ; + // int level = 1 ; + // int hp = 95; + // Console.WriteLine("=== БАЗА ДАННЫХ ПОКЕМОНОВ ==="); + // Console.WriteLine($"Покемон: {pokemonName}"); + // Console.WriteLine($"Стихия: {elementType}"); + // Console.WriteLine($"Уровень: {level} | HP: {hp}"); + + Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ"); + 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($"Тренер: {trainerName} (Регион: {regionName})"); + Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]"); + Console.WriteLine("****************************************"); + + + } + } +} + +Ответ: + +1 БЛОК 1 ЗАДАНИЕ +=== БАЗА ДАННЫХ ПОКЕМОНОВ === +Покемон: Чармандер +Стихия: Огонь +Уровень: 1 | HP: 95 + +1 БЛОК 2 ЗАДАНИЕ +Введите имя тренера: Эш +Введите имя покемона: Булбазавр +Введите стихию: Трава +Введите регион: Канто +**************************************** +ПАСПОРТ ПОКЕМОНА +Тренер: Эш (Регион: Канто) +Покемон: Булбазавр [Стихия: Трава] +**************************************** + +Process finished with exit code 0. + + diff --git a/works/CSharp/lab-01/lab-01/lab-01.sln b/works/CSharp/lab-01/lab-01/lab-01.sln new file mode 100644 index 0000000..1856ca5 --- /dev/null +++ b/works/CSharp/lab-01/lab-01/lab-01.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-01", "lab-01\lab-01.csproj", "{EBC5DA53-6234-4418-BE96-42D2151BA6EE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/works/CSharp/lab-01/lab-01/lab-01/Program.cs b/works/CSharp/lab-01/lab-01/lab-01/Program.cs new file mode 100644 index 0000000..3aa22fe --- /dev/null +++ b/works/CSharp/lab-01/lab-01/lab-01/Program.cs @@ -0,0 +1,37 @@ +using System; + +namespace lesson1 +{ + class lesson1 + { + static void Main(string[] args) + { + // Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ"); + // string pokemonName = "Чармандер" ; + // string elementType ="Огонь" ; + // int level = 1 ; + // int hp = 95; + // Console.WriteLine("=== БАЗА ДАННЫХ ПОКЕМОНОВ ==="); + // Console.WriteLine($"Покемон: {pokemonName}"); + // Console.WriteLine($"Стихия: {elementType}"); + // Console.WriteLine($"Уровень: {level} | HP: {hp}"); + + Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ"); + 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($"Тренер: {trainerName} (Регион: {regionName})"); + Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]"); + Console.WriteLine("****************************************"); + + + } + } +} \ No newline at end of file diff --git a/works/CSharp/lab-01/lab-01/lab-01/lab-01.csproj b/works/CSharp/lab-01/lab-01/lab-01/lab-01.csproj new file mode 100644 index 0000000..c5a245f --- /dev/null +++ b/works/CSharp/lab-01/lab-01/lab-01/lab-01.csproj @@ -0,0 +1,11 @@ + + + + Exe + net10.0 + lab_01 + enable + enable + + + diff --git a/works/CSharp/lab-02/Lab-02/Lab-02.sln b/works/CSharp/lab-02/Lab-02/Lab-02.sln new file mode 100644 index 0000000..03ecd07 --- /dev/null +++ b/works/CSharp/lab-02/Lab-02/Lab-02.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lab-02", "Lab-02\Lab-02.csproj", "{5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/works/CSharp/lab-02/Lab-02/Lab-02/Lab-02.csproj b/works/CSharp/lab-02/Lab-02/Lab-02/Lab-02.csproj new file mode 100644 index 0000000..33e3d43 --- /dev/null +++ b/works/CSharp/lab-02/Lab-02/Lab-02/Lab-02.csproj @@ -0,0 +1,11 @@ + + + + Exe + net10.0 + Lab_02 + enable + enable + + + diff --git a/works/CSharp/lab-02/Lab-02/Lab-02/Program.cs b/works/CSharp/lab-02/Lab-02/Lab-02/Program.cs new file mode 100644 index 0000000..0fff0b2 --- /dev/null +++ b/works/CSharp/lab-02/Lab-02/Lab-02/Program.cs @@ -0,0 +1,81 @@ +using System; +namespace Lesson2 +{ + class Lesson2Tasks + { + static void Main(string[] args) + { + Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ"); + Console.WriteLine("=== Прокачка покемона ==="); + Console.WriteLine($"Введите базовое значение атаки: "); + int baseAttack = int.Parse(Console.ReadLine()); + Console.WriteLine($"Базовое значение атаки:{baseAttack} "); + Console.WriteLine($"Введите количество полученных уровней:"); + int levelGained = int.Parse(Console.ReadLine()); + Console.WriteLine($"Количество полученных уровней:{levelGained}"); + int finalDamage = baseAttack + (levelGained * 5); + Console.WriteLine($"Итоговое значение аттаки: {finalDamage}"); + + Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ"); + int coachBalance = 1500; + Console.WriteLine($"Текущий баланс тренера: {coachBalance} "); + int potionPrice = 200; + Console.WriteLine($"Стоимость одного зелья: {potionPrice}"); + Console.WriteLine($"Введите Количество приобретаемых зелий:"); + int potionCount = int.Parse(Console.ReadLine()); + Console.WriteLine($"Количество приобретаемых зелий: {potionCount}"); + int priceTotal = potionCount * potionPrice; + int remainBalance = coachBalance - priceTotal; + Console.WriteLine ($"Успешная покупка! Остаток средств: {remainBalance}"); + + Console.WriteLine("2 БЛОК 1 ЗАДАНИЕ"); + Console.WriteLine("Введите текущее количество HP"); + int HP = int.Parse(Console.ReadLine()); + if (HP <= 0) + { + Console.WriteLine("Покемон потерял сознание! Верните его в покебол."); + } + else if (HP > 0 & HP < 21) + { + Console.WriteLine("Критическое состояние! Срочно используйте зелье!"); + } + else if (HP >= 21 & HP <= 50) + { + Console.WriteLine("Покемон ранен, будьте осторожны."); + } + else + { + Console.WriteLine("Покемон полон сил и готов к бою!"); + } + + Console.WriteLine("2 БЛОК 2 ЗАДАНИЕ"); + Console.WriteLine("Выберите действие тренера:"); + Console.WriteLine("1 — Атака"); + Console.WriteLine("2 — Инвентарь"); + Console.WriteLine("3 — Сменить покемона"); + Console.WriteLine("4 — Побег"); + int action = int.Parse(Console.ReadLine()); + Console.WriteLine(); + Console.WriteLine($"Вы выбрали: {action}"); + switch (action) + { + case 1: + Console.WriteLine("Покемон наносит быстрый удар!"); + break; + case 2: + Console.WriteLine("Вы открыли сумку и применили Зелье Лечения."); + break; + case 3: + Console.WriteLine("Вы отозвали покемона и выпустили нового!"); + break; + case 4: + Console.WriteLine("Вы успешно сбежали из боя!"); + break; + default: + Console.WriteLine("Неизвестная команда! Вы пропустили ход."); + break; + } + + } + } +} \ No newline at end of file diff --git a/works/CSharp/lab-02/Lesson2 b/works/CSharp/lab-02/Lesson2 new file mode 160000 index 0000000..937709b --- /dev/null +++ b/works/CSharp/lab-02/Lesson2 @@ -0,0 +1 @@ +Subproject commit 937709b2ae8abf82da1f3570411976e9e940a6ed diff --git a/works/CSharp/lab-02/Program.cs b/works/CSharp/lab-02/Program.cs new file mode 100644 index 0000000..25637a6 --- /dev/null +++ b/works/CSharp/lab-02/Program.cs @@ -0,0 +1,82 @@ +using System; +namespace Lesson2 +{ + class Lesson2Tasks + { + static void Main(string[] args) + { + /* + Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ"); + Console.WriteLine("=== Прокачка покемона ==="); + Console.WriteLine($"Введите базовое значение атаки: "); + int baseAttack = int.Parse(Console.ReadLine()); + Console.WriteLine($"Базовое значение атаки:{baseAttack} "); + Console.WriteLine($"Введите количество полученных уровней:"); + int levelGained = int.Parse(Console.ReadLine()); + Console.WriteLine($"Количество полученных уровней:{levelGained}"); + int finalDamage = baseAttack + (levelGained * 5); + Console.WriteLine($"Итоговое значение аттаки: {finalDamage}"); + + Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ"); + int coachBalance = 1500; + Console.WriteLine($"Текущий баланс тренера: {coachBalance} "); + int potionPrice = 200; + Console.WriteLine($"Стоимость одного зелья: {potionPrice}"); + int potionCount = int.Parse(Console.ReadLine()); + Console.WriteLine($"Количество приобретаемых зелий: {potionCount}"); + int priceTotal = potionCount * potionPrice; + int remainBalance = coachBalance - priceTotal; + Console.WriteLine ($"Успешная покупка! Остаток средств: {remainBalance}"); + */ + + Console.WriteLine("2 БЛОК 1 ЗАДАНИЕ"); + Console.WriteLine("Введите текущее количество HP"); + int HP = int.Parse(Console.ReadLine()); + if (HP <= 0) + { + Console.WriteLine("Покемон потерял сознание! Верните его в покебол."); + } + else if (HP > 0 & HP < 21) + { + Console.WriteLine("Критическое состояние! Срочно используйте зелье!"); + } + else if (HP >= 21 & HP <= 50) + { + Console.WriteLine("Покемон ранен, будьте осторожны."); + } + else + { + Console.WriteLine("Покемон полон сил и готов к бою!"); + } + + Console.WriteLine("2 БЛОК 2 ЗАДАНИЕ"); + Console.WriteLine("Выберите действие тренера:"); + Console.WriteLine("1 — Атака"); + Console.WriteLine("2 — Инвентарь"); + Console.WriteLine("3 — Сменить покемона"); + Console.WriteLine("4 — Побег"); + int action = int.Parse(Console.ReadLine()); + Console.WriteLine(); + Console.WriteLine($"Вы выбрали: {action}"); + switch (action) + { + case 1: + Console.WriteLine("Покемон наносит быстрый удар!"); + break; + case 2: + Console.WriteLine("Вы открыли сумку и применили Зелье Лечения."); + break; + case 3: + Console.WriteLine("Вы отозвали покемона и выпустили нового!"); + break; + case 4: + Console.WriteLine("Вы успешно сбежали из боя!"); + break; + default: + Console.WriteLine("Неизвестная команда! Вы пропустили ход."); + break; + } + + } + } +} \ No newline at end of file diff --git a/works/CSharp/lab-02/Readme.md b/works/CSharp/lab-02/Readme.md new file mode 100644 index 0000000..a331e2c --- /dev/null +++ b/works/CSharp/lab-02/Readme.md @@ -0,0 +1,133 @@ +# Лабораторная работа №2 + +* **Студент:** [Беляев Антон Сергеевич] +* **Вариант / Карточка:** [Например: #025 Pikachu] + +--- + +## Ключевой код +```csharp +// Самая важная часть реализации (методы, структуры, логика) +public class Card +{ + public string Name { get; set; } + public int Hp { get; set; } +} + +using System; +namespace Lesson2 +{ + class Lesson2Tasks + { + static void Main(string[] args) + { + Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ"); + Console.WriteLine("=== Прокачка покемона ==="); + Console.WriteLine($"Введите базовое значение атаки: "); + int baseAttack = int.Parse(Console.ReadLine()); + Console.WriteLine($"Базовое значение атаки:{baseAttack} "); + Console.WriteLine($"Введите количество полученных уровней:"); + int levelGained = int.Parse(Console.ReadLine()); + Console.WriteLine($"Количество полученных уровней:{levelGained}"); + int finalDamage = baseAttack + (levelGained * 5); + Console.WriteLine($"Итоговое значение аттаки: {finalDamage}"); + + Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ"); + int coachBalance = 1500; + Console.WriteLine($"Текущий баланс тренера: {coachBalance} "); + int potionPrice = 200; + Console.WriteLine($"Стоимость одного зелья: {potionPrice}"); + Console.WriteLine($"Введите Количество приобретаемых зелий:"); + int potionCount = int.Parse(Console.ReadLine()); + Console.WriteLine($"Количество приобретаемых зелий: {potionCount}"); + int priceTotal = potionCount * potionPrice; + int remainBalance = coachBalance - priceTotal; + Console.WriteLine ($"Успешная покупка! Остаток средств: {remainBalance}"); + + Console.WriteLine("2 БЛОК 1 ЗАДАНИЕ"); + Console.WriteLine("Введите текущее количество HP"); + int HP = int.Parse(Console.ReadLine()); + if (HP <= 0) + { + Console.WriteLine("Покемон потерял сознание! Верните его в покебол."); + } + else if (HP > 0 & HP < 21) + { + Console.WriteLine("Критическое состояние! Срочно используйте зелье!"); + } + else if (HP >= 21 & HP <= 50) + { + Console.WriteLine("Покемон ранен, будьте осторожны."); + } + else + { + Console.WriteLine("Покемон полон сил и готов к бою!"); + } + + Console.WriteLine("2 БЛОК 2 ЗАДАНИЕ"); + Console.WriteLine("Выберите действие тренера:"); + Console.WriteLine("1 — Атака"); + Console.WriteLine("2 — Инвентарь"); + Console.WriteLine("3 — Сменить покемона"); + Console.WriteLine("4 — Побег"); + int action = int.Parse(Console.ReadLine()); + Console.WriteLine(); + Console.WriteLine($"Вы выбрали: {action}"); + switch (action) + { + case 1: + Console.WriteLine("Покемон наносит быстрый удар!"); + break; + case 2: + Console.WriteLine("Вы открыли сумку и применили Зелье Лечения."); + break; + case 3: + Console.WriteLine("Вы отозвали покемона и выпустили нового!"); + break; + case 4: + Console.WriteLine("Вы успешно сбежали из боя!"); + break; + default: + Console.WriteLine("Неизвестная команда! Вы пропустили ход."); + break; + } + + } + } +} + +ВЫВОД: + +D:/Пузанова/CSHARP/Lesson2/Lesson2/bin/Debug/net10.0/Lesson2.exe +1 БЛОК 1 ЗАДАНИЕ +=== Прокачка покемона === +Введите базовое значение атаки: +4 +Базовое значение атаки:4 +Введите количество полученных уровней: +5 +Количество полученных уровней:5 +Итоговое значение аттаки: 29 +1 БЛОК 2 ЗАДАНИЕ +Текущий баланс тренера: 1500 +Стоимость одного зелья: 200 +Введите Количество приобретаемых зелий: +8 +Количество приобретаемых зелий: 8 +Успешная покупка! Остаток средств: -100 +2 БЛОК 1 ЗАДАНИЕ +Введите текущее количество HP +34 +Покемон ранен, будьте осторожны. +2 БЛОК 2 ЗАДАНИЕ +Выберите действие тренера: +1 - Атака +2 - Инвентарь +3 - Сменить покемона +4 - Побег +5 + +Вы выбрали: 5 +Неизвестная команда! Вы пропустили ход. + +Process finished with exit code 0. diff --git a/works/Kotlin/.gitignore b/works/Kotlin/.gitignore new file mode 100644 index 0000000..12cba71 --- /dev/null +++ b/works/Kotlin/.gitignore @@ -0,0 +1,55 @@ +# ========================================== +# IDE & Editors (JetBrains: Rider, IDEA, Android Studio) +# ========================================== +.idea/ +*.iml +*.iws +*.ipr +.vscode/ +*.suo +*.user +*.userosscache +*.sln.docstates + +# ========================================== +# Database Tools (DBeaver) +# ========================================== +.dbeaver/ +.eclipse/ +*.dbeaver-data/ + +# ========================================== +# C# / .NET / Visual Studio / Rider builds +# ========================================== +bin/ +obj/ +out/ +[D-d]ebug/ +[R-r]elease/ +*.userprefs +*.pidb +*.versioncontrol +*.csproj.user + +# ========================================== +# Android Studio / Gradle / Kotlin +# ========================================== +.gradle/ +build/ +local.properties +.navigation/ +captures/ +.externalNativeBuild +.cxx/ +*.apk +*.aab +*.keystore +*.jks + +# ========================================== +# OS Generated Files & Logs +# ========================================== +.DS_Store +Thumbs.db +*.log +*.tmp diff --git a/works/Kotlin/Readme.md b/works/Kotlin/Readme.md new file mode 100644 index 0000000..230626a --- /dev/null +++ b/works/Kotlin/Readme.md @@ -0,0 +1,7 @@ +# Студент: [Беляев Антон Сергеевич] +* **Группа:** [228] +* **Курс:** [2] + +## Список работ +* [Лабораторная работа №1](./works/lab-01) +* [Лабораторная работа №2](./works/lab-02) diff --git a/works/Kotlin/works/lab-01/.gitignore b/works/Kotlin/works/lab-01/.gitignore new file mode 100644 index 0000000..3ddbf4c --- /dev/null +++ b/works/Kotlin/works/lab-01/.gitignore @@ -0,0 +1,32 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Kotlin ### +.kotlin + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/works/Kotlin/works/lab-01/Readme.md b/works/Kotlin/works/lab-01/Readme.md new file mode 100644 index 0000000..2c11b43 --- /dev/null +++ b/works/Kotlin/works/lab-01/Readme.md @@ -0,0 +1,61 @@ +# Лабораторная работа №1 + +* **Студент:** [Беляев Антон Сергеевич] +* **Вариант / Карточка:** [Например: #025 Pikachu] + +--- + +## Ключевой код +```kotlin + +fun main() { + println("=== 1 ЗАДАНИЕ ===") + val trainerName = "Эш Кетчум" + val homeRegion = "Канто" + val badges = 8 + val pokedexCount = 150 + println("=== БАЗА ДАННЫХ ТРЕНЕРОВ ===") + println("Тренер: ${trainerName}") + println("Родной регион: ${homeRegion}") + println("Значков:${badges} | Покемонов в Покедексе:${pokedexCount}") + + println("=== 2 ЗАДАНИЕ ===") + print("Введите имя инспектора:") + val inspectorName = readln() + print("Введите имя тренера:") + val trainerName = readln() + print("Введите стартового покемона:") + val starterPokemon = readln() + print("Введите целевой стадион:") + val targetGym = readln() + println("****************************************") + println("ЛИЦЕНЗИЯ ТРЕНЕРА") + println("Инспектор:: ${inspectorName}") + println("Тренер: ${trainerName}[Стартер: ${starterPokemon}]") + println("Следующая цель: ${targetGym}") + println("****************************************") + +} + +ВЫВОД: +=== 1 ЗАДАНИЕ === +=== БАЗА ДАННЫХ ТРЕНЕРОВ === +Тренер: Эш Кетчум +Родной регион: Канто +Значков:8 | Покемонов в Покедексе:150 + +Process finished with exit code 0 + +=== 2 ЗАДАНИЕ === +Введите имя инспектора: Профессор Оук +Введите имя тренера: Ред +Введите стартового покемона: Чармандер +Введите целевой стадион: Стадион Вермилион Сити +**************************************** +ЛИЦЕНЗИЯ ТРЕНЕРА +Инспектор: Профессор Оук +Тренер: Ред [Стартер: Чармандер] +Следующая цель: Стадион Вермилион Сити +**************************************** + +Process finished with exit code 0 diff --git a/works/Kotlin/works/lab-01/src/Main.kt b/works/Kotlin/works/lab-01/src/Main.kt new file mode 100644 index 0000000..2c918cd --- /dev/null +++ b/works/Kotlin/works/lab-01/src/Main.kt @@ -0,0 +1,28 @@ +fun main() { + println("=== 1 ЗАДАНИЕ ===") + val trainerName = "Эш Кетчум" + val homeRegion = "Канто" + val badges = 8 + val pokedexCount = 150 + println("=== БАЗА ДАННЫХ ТРЕНЕРОВ ===") + println("Тренер: ${trainerName}") + println("Родной регион: ${homeRegion}") + println("Значков:${badges} | Покемонов в Покедексе:${pokedexCount}") + + println("=== 2 ЗАДАНИЕ ===") + print("Введите имя инспектора:") + val inspectorName = readln() + print("Введите имя тренера:") + val trainerName = readln() + print("Введите стартового покемона:") + val starterPokemon = readln() + print("Введите целевой стадион:") + val targetGym = readln() + println("****************************************") + println("ЛИЦЕНЗИЯ ТРЕНЕРА") + println("Инспектор:: ${inspectorName}") + println("Тренер: ${trainerName}[Стартер: ${starterPokemon}]") + println("Следующая цель: ${targetGym}") + println("****************************************") + +} \ No newline at end of file diff --git a/works/Kotlin/works/lab-02/.gitignore b/works/Kotlin/works/lab-02/.gitignore new file mode 100644 index 0000000..3ddbf4c --- /dev/null +++ b/works/Kotlin/works/lab-02/.gitignore @@ -0,0 +1,32 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Kotlin ### +.kotlin + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/works/Kotlin/works/lab-02/Readme.md b/works/Kotlin/works/lab-02/Readme.md new file mode 100644 index 0000000..973968a --- /dev/null +++ b/works/Kotlin/works/lab-02/Readme.md @@ -0,0 +1,90 @@ +# Лабораторная работа №2 + +* **Студент:** [Беляев Антон Сергеевич] +* **Вариант / Карточка:** [Например: #025 Pikachu] + +--- + +## Ключевой код +```csharp +// Самая важная часть реализации (методы, структуры, логика) +public class Card +{ + public string Name { get; set; } + public int Hp { get; set; } +} + +fun main() { + println("Задание 1. Явное приведение типов (Casting)") + print ("Текущий ход: ") + val currentTurnInputString: String = readln() + val currentTurnInput: Int = currentTurnInputString.toInt() + print ("Количество энергии на столе: ") + val energyInputString: String = readln() + val energyInput: Int = energyInputString.toInt() + print ("Коэффициент усиления атаки : ") + val multiplierInputString: String = readln() + val multiplierInput: Double = multiplierInputString.toDouble() + println("=== ИНИЦИАЛИЗАЦИЯ ПАРАМЕТРОВ ХОДА ===") + println("Текущий ход: $currentTurnInput") + println("Доступно энергии: $energyInput") + println("Множитель урона: $multiplierInput") + + println("Задание 2. Математические операции и расчет эффективности хода") + var cardsPlayed = 0 + println("Вывод Покемона на активную позицию!") + cardsPlayed++ + print("Введите базовый урон покемона: ") + val baseDamage: Int = readln().toInt() + println("Применение карты Тренера 'Леди из Центра Покемонов'!") + cardsPlayed += 1 + print("Сколько карт энергии прикрепить к Покемону? ") + val energyAttached = readln().toInt() + cardsPlayed += energyAttached + val finalDamage = baseDamage * multiplierInput + val turnCheck = currentTurnInput % 2 + println("=== ХОД № 4 ===") + println("Игрок выводит Покемона на активную позицию!") + println("Введен базовый урон покемона: ${baseDamage}") + println("Применена карта Тренера 'Леди из Центра Покемонов'!") + println("Сколько карт энергии прикрепить к Покемону: ${cardsPlayed} ") + println("\n****************************************") + println("ОТЧЕТ О БОЕВОЙ ЭФФЕКТИВНОСТИ") + println("Тип хода ${turnCheck}: 0 (Четный) или 1 (Нечетный)") + println("Всего сыграно карт за ход: ${cardsPlayed}") + println("Базовый урон: ${baseDamage}") + println("Коэффициент: ${multiplierInput}") + println("Итоговый урон по противнику: ${finalDamage}") + println("****************************************") + } + +ВЫВОД: +Задание 1. Явное приведение типов (Casting) +Текущий ход: 5 +Количество энергии на столе: 7 +Коэффициент усиления атаки : 3 +=== ИНИЦИАЛИЗАЦИЯ ПАРАМЕТРОВ ХОДА === +Текущий ход: 5 +Доступно энергии: 7 +Множитель урона: 3.0 +Задание 2. Математические операции и расчет эффективности хода +Вывод Покемона на активную позицию! +Введите базовый урон покемона: 40 +Применение карты Тренера 'Леди из Центра Покемонов'! +Сколько карт энергии прикрепить к Покемону? 2 +=== ХОД № 4 === +Игрок выводит Покемона на активную позицию! +Введите базовый урон покемона: 40 +Применена карта Тренера 'Леди из Центра Покемонов'! +Сколько карт энергии прикрепить к Покемону 4? + +**************************************** +ОТЧЕТ О БОЕВОЙ ЭФФЕКТИВНОСТИ +Тип хода 1: 0 (Четный) +Всего сыграно карт за ход: 4 +Базовый урон: 40 +Коэффициент: 3.0 +Итоговый урон по противнику: 120.0 +**************************************** + +Process finished with exit code 0 \ No newline at end of file diff --git a/works/Kotlin/works/lab-02/src/Main.kt b/works/Kotlin/works/lab-02/src/Main.kt new file mode 100644 index 0000000..1031f31 --- /dev/null +++ b/works/Kotlin/works/lab-02/src/Main.kt @@ -0,0 +1,43 @@ +fun main() { + println("Задание 1. Явное приведение типов (Casting)") + print ("Текущий ход: ") + val currentTurnInputString: String = readln() + val currentTurnInput: Int = currentTurnInputString.toInt() + print ("Количество энергии на столе: ") + val energyInputString: String = readln() + val energyInput: Int = energyInputString.toInt() + print ("Коэффициент усиления атаки : ") + val multiplierInputString: String = readln() + val multiplierInput: Double = multiplierInputString.toDouble() + println("=== ИНИЦИАЛИЗАЦИЯ ПАРАМЕТРОВ ХОДА ===") + println("Текущий ход: $currentTurnInput") + println("Доступно энергии: $energyInput") + println("Множитель урона: $multiplierInput") + + println("Задание 2. Математические операции и расчет эффективности хода") + var cardsPlayed = 0 + println("Вывод Покемона на активную позицию!") + cardsPlayed++ + print("Введите базовый урон покемона: ") + val baseDamage: Int = readln().toInt() + println("Применение карты Тренера 'Леди из Центра Покемонов'!") + cardsPlayed += 1 + print("Сколько карт энергии прикрепить к Покемону? ") + val energyAttached = readln().toInt() + cardsPlayed += energyAttached + val finalDamage = baseDamage * multiplierInput + val turnCheck = currentTurnInput % 2 + println("=== ХОД № 4 ===") + println("Игрок выводит Покемона на активную позицию!") + println("Введен базовый урон покемона: ${baseDamage}") + println("Применена карта Тренера 'Леди из Центра Покемонов'!") + println("Сколько карт энергии прикрепить к Покемону: ${cardsPlayed} ") + println("\n****************************************") + println("ОТЧЕТ О БОЕВОЙ ЭФФЕКТИВНОСТИ") + println("Тип хода ${turnCheck}: 0 (Четный) или 1 (Нечетный)") + println("Всего сыграно карт за ход: ${cardsPlayed}") + println("Базовый урон: ${baseDamage}") + println("Коэффициент: ${multiplierInput}") + println("Итоговый урон по противнику: ${finalDamage}") + println("****************************************") +} \ No newline at end of file diff --git a/works/lab-01/Readme.md b/works/lab-01/Readme.md deleted file mode 100644 index 388f028..0000000 --- a/works/lab-01/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# Лабораторная работа №1 - -* **Студент:** [ФИО] -* **Вариант / Карточка:** [Например: #025 Pikachu] - ---- - -## Ключевой код -```csharp -// Самая важная часть реализации (методы, структуры, логика) -public class Card -{ - public string Name { get; set; } - public int Hp { get; set; } -} diff --git a/works/lab-02/Readme.md b/works/lab-02/Readme.md deleted file mode 100644 index 9756237..0000000 --- a/works/lab-02/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# Лабораторная работа №2 - -* **Студент:** [ФИО] -* **Вариант / Карточка:** [Например: #025 Pikachu] - ---- - -## Ключевой код -```csharp -// Самая важная часть реализации (методы, структуры, логика) -public class Card -{ - public string Name { get; set; } - public int Hp { get; set; } -}