generated from admin/template
доработка оформления
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
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}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab01", "lab01\lab01.csproj", "{3C40E087-928A-4E90-A084-D7D74CAF6EEA}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -8,9 +8,9 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{3C40E087-928A-4E90-A084-D7D74CAF6EEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{3C40E087-928A-4E90-A084-D7D74CAF6EEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{3C40E087-928A-4E90-A084-D7D74CAF6EEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{EBC5DA53-6234-4418-BE96-42D2151BA6EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{3C40E087-928A-4E90-A084-D7D74CAF6EEA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace lab01
|
||||||
|
{
|
||||||
|
class Lab01Tasks
|
||||||
|
{
|
||||||
|
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("****************************************");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<RootNamespace>Lab_02</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
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("****************************************");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,10 +16,10 @@ namespace lab02
|
|||||||
Console.WriteLine("=== Прокачка покемона ===");
|
Console.WriteLine("=== Прокачка покемона ===");
|
||||||
Console.Write($"Введите базовое значение атаки: ");
|
Console.Write($"Введите базовое значение атаки: ");
|
||||||
int baseAttack = int.Parse(Console.ReadLine());
|
int baseAttack = int.Parse(Console.ReadLine());
|
||||||
Console.WriteLine($"Базовое значение атаки:{baseAttack} ");
|
Console.WriteLine($"Базовое значение атаки: {baseAttack} ");
|
||||||
Console.Write($"Введите количество полученных уровней: ");
|
Console.Write($"Введите количество полученных уровней: ");
|
||||||
int levelGained = int.Parse(Console.ReadLine());
|
int levelGained = int.Parse(Console.ReadLine());
|
||||||
Console.WriteLine($"Количество полученных уровней:{levelGained}");
|
Console.WriteLine($"Количество полученных уровней: {levelGained}");
|
||||||
int finalDamage = baseAttack + (levelGained * 5);
|
int finalDamage = baseAttack + (levelGained * 5);
|
||||||
Console.WriteLine($"Итоговое значение аттаки: {finalDamage}");
|
Console.WriteLine($"Итоговое значение аттаки: {finalDamage}");
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-03", "lab-03\lab-03.csproj", "{7B515140-F7D5-450D-A672-9BB836357A9B}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab02", "lab02\lab02.csproj", "{1E624419-2DC4-4D4D-BC3F-BB2431A5947B}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -8,9 +8,9 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{7B515140-F7D5-450D-A672-9BB836357A9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{1E624419-2DC4-4D4D-BC3F-BB2431A5947B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7B515140-F7D5-450D-A672-9BB836357A9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1E624419-2DC4-4D4D-BC3F-BB2431A5947B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7B515140-F7D5-450D-A672-9BB836357A9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1E624419-2DC4-4D4D-BC3F-BB2431A5947B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7B515140-F7D5-450D-A672-9BB836357A9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1E624419-2DC4-4D4D-BC3F-BB2431A5947B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
namespace lab02
|
||||||
|
{
|
||||||
|
class Lab02Tasks
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("1 БЛОК 1 ЗАДАНИЕ");
|
||||||
|
Console.WriteLine("=== Прокачка покемона ===");
|
||||||
|
Console.Write($"Введите базовое значение атаки: ");
|
||||||
|
int baseAttack = int.Parse(Console.ReadLine());
|
||||||
|
Console.WriteLine($"Базовое значение атаки: {baseAttack} ");
|
||||||
|
Console.Write($"Введите количество полученных уровней: ");
|
||||||
|
int levelGained = int.Parse(Console.ReadLine());
|
||||||
|
Console.WriteLine($"Количество полученных уровней: {levelGained}");
|
||||||
|
int finalDamage = baseAttack + (levelGained * 5);
|
||||||
|
Console.WriteLine($"Итоговое значение аттаки: {finalDamage}");
|
||||||
|
|
||||||
|
Console.WriteLine("1 БЛОК 2 ЗАДАНИЕ");
|
||||||
|
Console.Write($"Введите баланс тренера: ");
|
||||||
|
int coachBalance = 1500;
|
||||||
|
Console.WriteLine($"Текущий баланс тренера: {coachBalance} ");
|
||||||
|
Console.Write($"Введите стоимость одного зелья: ");
|
||||||
|
int potionPrice = 200;
|
||||||
|
Console.WriteLine($"Стоимость одного зелья: {potionPrice}");
|
||||||
|
Console.Write($"Введите Количество приобретаемых зелий: ");
|
||||||
|
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.Write("Введите текущее количество 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 — Атака\n2 — Инвентарь\n3 — Сменить покемона\n4 — Побег");
|
||||||
|
Console.Write("Введите номер выбранного действия: ");
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<RootNamespace>lab_03</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-04", "lab-04\lab-04.csproj", "{18080816-4DAE-48ED-A577-92CEEBBD8890}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab03", "lab03\lab03.csproj", "{5E35FA7F-5464-469C-AB7A-6B4BAA9FDA97}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -8,9 +8,9 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{18080816-4DAE-48ED-A577-92CEEBBD8890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{5E35FA7F-5464-469C-AB7A-6B4BAA9FDA97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{18080816-4DAE-48ED-A577-92CEEBBD8890}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{5E35FA7F-5464-469C-AB7A-6B4BAA9FDA97}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{18080816-4DAE-48ED-A577-92CEEBBD8890}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5E35FA7F-5464-469C-AB7A-6B4BAA9FDA97}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{18080816-4DAE-48ED-A577-92CEEBBD8890}.Release|Any CPU.Build.0 = Release|Any CPU
|
{5E35FA7F-5464-469C-AB7A-6B4BAA9FDA97}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
namespace lab03
|
||||||
|
{
|
||||||
|
class Lab03Tasks
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
/*Console.WriteLine("1 ЗАДАНИЕ");
|
||||||
|
string pokemon1Name = "Пикачу";
|
||||||
|
int pokemon1Hp = 50;
|
||||||
|
int pokemon1Attack = 12;
|
||||||
|
string pokemon2Name = "Булбазавр";
|
||||||
|
int pokemon2Hp = 55;
|
||||||
|
int pokemon2Attack = 10;
|
||||||
|
int roundNumber = 1;
|
||||||
|
for (int i = 3; i > 0 ; i--)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{i}..");
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("=== БОЙ НАЧИНАЕТСЯ ===");
|
||||||
|
Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Attack}) VS {pokemon2Name} (HP: {pokemon2Hp} | Атака: {pokemon2Attack})"); */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine("2 ЗАДАНИЕ");
|
||||||
|
int choice;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
|
||||||
|
choice = int.Parse(Console.ReadLine());
|
||||||
|
|
||||||
|
if (choice != 1 && choice != 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Некорректная команда! Попробуйте снова.");
|
||||||
|
}
|
||||||
|
} while (choice != 1 && choice != 0);
|
||||||
|
|
||||||
|
if (choice == 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Вы отменили бой!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine("3 ЗАДАНИЕ");
|
||||||
|
string pokemon1Name = "Пикачу";
|
||||||
|
string pokemon2Name = "Булбазавр";
|
||||||
|
int pokemon1Attack = 12;
|
||||||
|
int pokemon2Attack = 10;
|
||||||
|
int pokemon1Hp = 50;
|
||||||
|
int pokemon2Hp = 55;
|
||||||
|
int roundNumber = 1;
|
||||||
|
|
||||||
|
while (pokemon1Hp > 0 && pokemon2Hp > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"--- Раунд {roundNumber} ---");
|
||||||
|
Console.WriteLine($"{pokemon1Name} наносит {pokemon1Attack} урона по {pokemon2Name}!");
|
||||||
|
pokemon2Hp -= pokemon1Attack;
|
||||||
|
if (pokemon2Hp <= 0)
|
||||||
|
{
|
||||||
|
pokemon2Hp = 0;
|
||||||
|
Console.WriteLine($"{pokemon2Name} потерял сознание!");
|
||||||
|
Console.WriteLine("=== БОЙ ОКОНЧЕН ===");
|
||||||
|
Console.WriteLine($"Победитель: {pokemon1Name}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Console.WriteLine($"{pokemon2Name} наносит {pokemon2Attack} урона по {pokemon1Name}!");
|
||||||
|
pokemon1Hp -= pokemon2Attack;
|
||||||
|
if (pokemon1Hp <= 0 )
|
||||||
|
{
|
||||||
|
pokemon1Hp = 0;
|
||||||
|
Console.WriteLine($"{pokemon1Name} потерял сознание!");
|
||||||
|
Console.WriteLine("=== БОЙ ОКОНЧЕН ===");
|
||||||
|
Console.WriteLine($"Победитель: {pokemon2Name}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
roundNumber++;
|
||||||
|
Console.WriteLine($"Итог раунда: Пикачу HP: {pokemon1Hp} | Булбазавр HP: {pokemon2Hp}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<RootNamespace>lab_01</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace lab03
|
|
||||||
{
|
|
||||||
class lab03
|
|
||||||
{
|
|
||||||
static void Main(string[] args)
|
|
||||||
{
|
|
||||||
/*Console.WriteLine("1 ЗАДАНИЕ");
|
|
||||||
string pokemon1Name = "Пикачу";
|
|
||||||
int pokemon1Hp = 50;
|
|
||||||
int pokemon1Attack = 12;
|
|
||||||
string pokemon2Name = "Булбазавр";
|
|
||||||
int pokemon2Hp = 55;
|
|
||||||
int pokemon2Attack = 10;
|
|
||||||
int roundNumber = 1;
|
|
||||||
for (int i = 3; i > 0 ; i--)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"{i}..");
|
|
||||||
}
|
|
||||||
|
|
||||||
Console.WriteLine("=== БОЙ НАЧИНАЕТСЯ ===");
|
|
||||||
Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Attack}) VS {pokemon2Name} (HP: {pokemon2Hp} | Атака: {pokemon2Attack})");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Console.WriteLine("2 ЗАДАНИЕ");
|
|
||||||
int choice;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
|
|
||||||
choice = int.Parse(Console.ReadLine());
|
|
||||||
|
|
||||||
if (choice != 1 && choice != 0)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Некорректная команда! Попробуйте снова.");
|
|
||||||
}
|
|
||||||
} while (choice != 1 && choice != 0);
|
|
||||||
|
|
||||||
if (choice == 0)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Вы отменили бой!");
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Console.WriteLine("3 ЗАДАНИЕ");
|
|
||||||
string pokemon1Name = "Пикачу";
|
|
||||||
string pokemon2Name = "Булбазавр";
|
|
||||||
int pokemon1Attack = 12;
|
|
||||||
int pokemon2Attack = 10;
|
|
||||||
int pokemon1Hp = 50;
|
|
||||||
int pokemon2Hp = 55;
|
|
||||||
int roundNumber = 1;
|
|
||||||
|
|
||||||
while (pokemon1Hp > 0 && pokemon2Hp > 0)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"--- Раунд {roundNumber} ---");
|
|
||||||
Console.WriteLine($"{pokemon1Name} наносит {pokemon1Attack} урона по {pokemon2Name}!");
|
|
||||||
pokemon2Hp -= pokemon1Attack;
|
|
||||||
if (pokemon2Hp <= 0)
|
|
||||||
{
|
|
||||||
pokemon2Hp = 0;
|
|
||||||
Console.WriteLine($"{pokemon2Name} потерял сознание!");
|
|
||||||
Console.WriteLine("=== БОЙ ОКОНЧЕН ===");
|
|
||||||
Console.WriteLine($"Победитель: {pokemon1Name}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Console.WriteLine($"{pokemon2Name} наносит {pokemon2Attack} урона по {pokemon1Name}!");
|
|
||||||
pokemon1Hp -= pokemon2Attack;
|
|
||||||
if (pokemon1Hp <= 0 )
|
|
||||||
{
|
|
||||||
pokemon1Hp = 0;
|
|
||||||
Console.WriteLine($"{pokemon1Name} потерял сознание!");
|
|
||||||
Console.WriteLine("=== БОЙ ОКОНЧЕН ===");
|
|
||||||
Console.WriteLine($"Победитель: {pokemon2Name}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
roundNumber++;
|
|
||||||
Console.WriteLine($"Итог раунда: Пикачу HP: {pokemon1Hp} | Булбазавр HP: {pokemon2Hp}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
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}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab04", "lab04\lab04.csproj", "{EFAC9CB6-ABBC-4D9B-AC63-AE7EA4EE8E36}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -8,9 +8,9 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{EFAC9CB6-ABBC-4D9B-AC63-AE7EA4EE8E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{EFAC9CB6-ABBC-4D9B-AC63-AE7EA4EE8E36}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{EFAC9CB6-ABBC-4D9B-AC63-AE7EA4EE8E36}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{5982AD7F-CDDC-4556-B8C9-4A1BA7EBE15B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{EFAC9CB6-ABBC-4D9B-AC63-AE7EA4EE8E36}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
namespace lab04
|
||||||
|
|
||||||
namespace lab04
|
|
||||||
{
|
{
|
||||||
class Tasks04
|
class Lab04Tasks
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
@@ -19,7 +17,7 @@ namespace lab04
|
|||||||
Console.WriteLine($"2. {activeTeam[1]}");
|
Console.WriteLine($"2. {activeTeam[1]}");
|
||||||
Console.WriteLine($"3. {activeTeam[2]}");
|
Console.WriteLine($"3. {activeTeam[2]}");
|
||||||
|
|
||||||
Console.WriteLine("2 ЗАДАНИЕ");
|
/*Console.WriteLine("2 ЗАДАНИЕ");
|
||||||
|
|
||||||
List<string> backpack = new List<string>();
|
List<string> backpack = new List<string>();
|
||||||
backpack.Add("Зелье HP");
|
backpack.Add("Зелье HP");
|
||||||
@@ -30,11 +28,11 @@ namespace lab04
|
|||||||
Console.WriteLine("Вы использовали один Покебол для поимки дикого покемона!");
|
Console.WriteLine("Вы использовали один Покебол для поимки дикого покемона!");
|
||||||
backpack.Remove("Покебол");
|
backpack.Remove("Покебол");
|
||||||
int count1 = backpack.Count;
|
int count1 = backpack.Count;
|
||||||
Console.WriteLine($"Обновленный инвентарь. Осталось предметов: {count1}");
|
Console.WriteLine($"Обновленный инвентарь. Осталось предметов: {count1}");*/
|
||||||
|
|
||||||
Console.WriteLine("3 ЗАДАНИЕ");
|
Console.WriteLine("3 ЗАДАНИЕ");
|
||||||
|
|
||||||
/*Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ===");
|
||||||
List<string> backpack = new List<string>();
|
List<string> backpack = new List<string>();
|
||||||
backpack.Add("Зелье HP");
|
backpack.Add("Зелье HP");
|
||||||
backpack.Add("Покебол");
|
backpack.Add("Покебол");
|
||||||
@@ -51,7 +49,7 @@ namespace lab04
|
|||||||
{
|
{
|
||||||
Console.WriteLine($"[Предмет] -> {item}");
|
Console.WriteLine($"[Предмет] -> {item}");
|
||||||
}
|
}
|
||||||
Console.WriteLine("=============================");*/
|
Console.WriteLine("=============================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<RootNamespace>lab_04</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
# Лабораторная работа №5
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ключевой код
|
||||||
|
```csharp
|
||||||
|
Console.WriteLine("=== ЗАДАНИЕ 1. ===");
|
||||||
|
int pokemonHp = 20;
|
||||||
|
Console.WriteLine("=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ===");
|
||||||
|
Console.WriteLine($"Здоровье до лечения: {pokemonHp}.");
|
||||||
|
static void HealPokemon(ref int pokemonHp)
|
||||||
|
{
|
||||||
|
pokemonHp += 80;
|
||||||
|
Console.WriteLine("[Покецентр] Покемон полностью здоров! Восстановлено 80 HP.");
|
||||||
|
}
|
||||||
|
HealPokemon(ref pokemonHp);
|
||||||
|
Console.WriteLine($"Здоровье после лечения: {pokemonHp}.");
|
||||||
|
|
||||||
|
Console.WriteLine("\n=== ЗАДАНИЕ 2. ===");
|
||||||
|
Console.WriteLine("=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ===");
|
||||||
|
Console.WriteLine($"Вы зашли в высокую траву...");
|
||||||
|
|
||||||
|
static void SearchBushes(out string foundPokemon, out int pokemonLevel)
|
||||||
|
{
|
||||||
|
foundPokemon = "Пикачу";
|
||||||
|
pokemonLevel = new Random().Next(1, 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchBushes(out string pokemonName, out int level);
|
||||||
|
Console.WriteLine($"Шорох! Из кустов появляется дикий {pokemonName}, (Уровень: {level})");
|
||||||
|
|
||||||
|
Console.WriteLine("\n=== ЗАДАНИЕ 3. ===");
|
||||||
|
static void RegisterTournament(in double difficulty, params string[] participants)
|
||||||
|
{
|
||||||
|
// difficulty = 2.0; // компилятор выдаст ошибку
|
||||||
|
|
||||||
|
Console.WriteLine($"Коэффициент стадиона: {difficulty}");
|
||||||
|
Console.WriteLine("Список участников:");
|
||||||
|
|
||||||
|
foreach (string pokemon in participants)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"* {pokemon}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Console.WriteLine("=== РЕГИСТРАЦИЯ НА ТУРНИР ===");
|
||||||
|
RegisterTournament(1.5, "Бульбазавр", "Чармандер");
|
||||||
|
Console.WriteLine("-----------------------------");
|
||||||
|
RegisterTournament(1.5, "Сквиртл", "Пикачу", "Псайдак", "Мяут");
|
||||||
|
Console.WriteLine("=============================");
|
||||||
|
```
|
||||||
|
|
||||||
|
## ВЫВОД:
|
||||||
|
|
||||||
|
=== ЗАДАНИЕ 1. ===
|
||||||
|
=== ПОКЕЦЕНТР: ЛЕЧЕНИЕ ===
|
||||||
|
Здоровье до лечения: 20.
|
||||||
|
[Покецентр] Покемон полностью здоров! Восстановлено 80 HP.
|
||||||
|
Здоровье после лечения: 100.
|
||||||
|
|
||||||
|
=== ЗАДАНИЕ 2. ===
|
||||||
|
=== ИССЛЕДОВАНИЕ ЛОКАЦИИ ===
|
||||||
|
Вы зашли в высокую траву...
|
||||||
|
Шорох! Из кустов появляется дикий Пикачу, (Уровень: 9)
|
||||||
|
|
||||||
|
=== ЗАДАНИЕ 3. ===
|
||||||
|
=== РЕГИСТРАЦИЯ НА ТУРНИР ===
|
||||||
|
Коэффициент стадиона: 1,5
|
||||||
|
Список участников:
|
||||||
|
* Бульбазавр
|
||||||
|
* Чармандер
|
||||||
|
-----------------------------
|
||||||
|
Коэффициент стадиона: 1,5
|
||||||
|
Список участников:
|
||||||
|
* Сквиртл
|
||||||
|
* Пикачу
|
||||||
|
* Псайдак
|
||||||
|
* Мяут
|
||||||
|
=============================
|
||||||
|
|
||||||
|
Process finished with exit code 0.
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab-05", "lab-05\lab-05.csproj", "{7FD82783-1125-4A16-9DA9-633C3F5D7B3C}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{7FD82783-1125-4A16-9DA9-633C3F5D7B3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{7FD82783-1125-4A16-9DA9-633C3F5D7B3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{7FD82783-1125-4A16-9DA9-633C3F5D7B3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{7FD82783-1125-4A16-9DA9-633C3F5D7B3C}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
|
||||||
<RootNamespace>lab_05</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lab05", "lab05\lab05.csproj", "{10E44936-CD7A-459C-ABBB-55E03B1151B2}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{10E44936-CD7A-459C-ABBB-55E03B1151B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{10E44936-CD7A-459C-ABBB-55E03B1151B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{10E44936-CD7A-459C-ABBB-55E03B1151B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{10E44936-CD7A-459C-ABBB-55E03B1151B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user