generated from admin/template
lab-02
This commit is contained in:
@@ -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
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<RootNamespace>Lab_02</RootNamespace>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Submodule
+1
Submodule works/CSharp/lab-02/Lesson2 added at 937709b2ae
Reference in New Issue
Block a user