generated from admin/template
Практическая 1
This commit is contained in:
@@ -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>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lab1", "Lab1\Lab1.csproj", "{3D7DF60E-81A6-47B5-9123-A52C30868874}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{3D7DF60E-81A6-47B5-9123-A52C30868874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3D7DF60E-81A6-47B5-9123-A52C30868874}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3D7DF60E-81A6-47B5-9123-A52C30868874}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3D7DF60E-81A6-47B5-9123-A52C30868874}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
/*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("=== Интерактивный ввод и динамическое формирование документов ===");
|
||||||
|
|
||||||
|
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("****************************************");*/
|
||||||
|
|
||||||
|
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 attack2Name = Console.ReadLine();
|
||||||
|
|
||||||
|
Console.Write("Введите эффект второй атаки " );
|
||||||
|
string attack2Desc = Console.ReadLine();
|
||||||
|
|
||||||
|
Console.Write("Введите уязвимость ");
|
||||||
|
string weakness = Console.ReadLine();
|
||||||
|
|
||||||
|
Console.Write("Введите устойчивость ");
|
||||||
|
string resistance = Console.ReadLine();
|
||||||
|
string elementSymbol = "⚡";
|
||||||
|
|
||||||
|
int hp = 60;
|
||||||
|
int number = 25;
|
||||||
|
double height = 0.4;
|
||||||
|
double weight = 6.0;
|
||||||
|
int attack2Damage = 20;
|
||||||
|
int retreatCost = 1;
|
||||||
|
|
||||||
|
Console.Clear();
|
||||||
|
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
|
||||||
|
|
||||||
|
string headerLeft = $"[{stage}] {name}";
|
||||||
|
string headerRight = $"ОЖ: {hp} [{elementSymbol}]";
|
||||||
|
|
||||||
|
Console.WriteLine(headerLeft.PadRight(70 - headerRight.Length) + headerRight);
|
||||||
|
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"№ {number} | Вид: {category} | Рост: {height} м | Вес: {weight} кг");
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
|
||||||
|
|
||||||
|
Console.WriteLine($"[{attack1Name}]");
|
||||||
|
Console.WriteLine($"Эффект: {attack1Desc}");
|
||||||
|
Console.WriteLine();
|
||||||
|
|
||||||
|
|
||||||
|
string attack2Left = $"[{attack2Name}]";
|
||||||
|
string attack2Right = $"Урон: {attack2Damage}";
|
||||||
|
Console.WriteLine(attack2Left.PadRight(70 - attack2Right.Length) + attack2Right);
|
||||||
|
Console.WriteLine($"Эффект: {attack2Desc}");
|
||||||
|
|
||||||
|
Console.WriteLine("----------------------------------------------------------------------");
|
||||||
|
Console.WriteLine($"Слабость: {weakness}");
|
||||||
|
Console.WriteLine($"Устойчивость: {resistance}");
|
||||||
|
Console.WriteLine($"Отступление: {retreatCost}");
|
||||||
|
Console.WriteLine("======================================================================");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user