feat: выполнена лабораторная работа 2, внесены корректировки в лр 1

This commit is contained in:
2026-09-04 11:46:17 +03:00
parent 15933d4d9b
commit 49892687de
4 changed files with 175 additions and 9 deletions
+3 -3
View File
@@ -28,11 +28,11 @@ namespace lesson1
//задание 1.2
Console.Write("Введите имя тренера: ");
var trainerName = Console.ReadLine();
Console.Write("Введите имя покемона: ");
Console.Write("\nВведите имя покемона: ");
var pokemonName = Console.ReadLine();
Console.Write("Введите стихию: ");
Console.Write("\nВведите стихию: ");
var elementType = Console.ReadLine();
Console.Write("Введите регион: ");
Console.Write("\nВведите регион: ");
var regionName = Console.ReadLine();
Console.WriteLine();
Console.WriteLine("****************************************");
+34
View File
@@ -0,0 +1,34 @@
using System;
internal class Program
{
static void Main(string[] args)
{
//задание 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}");
//задание 1.2
Console.Write("Введите имя тренера: ");
var trainerName = Console.ReadLine();
Console.Write("\nВведите имя покемона: ");
var pokemonName = Console.ReadLine();
Console.Write("\nВведите стихию: ");
var elementType = Console.ReadLine();
Console.Write("\nВведите регион: ");
var regionName = Console.ReadLine();
Console.WriteLine();
Console.WriteLine("****************************************");
Console.WriteLine("ПАСПОРТ ПОКЕМОНА");
Console.WriteLine($"Тренер: {trainerName} (Регион: {regionName})");
Console.WriteLine($"Покемон: {pokemonName} [Стихия: {elementType}]");
Console.WriteLine("****************************************");
}
}
+63 -4
View File
@@ -1,6 +1,6 @@
# Лабораторная работа №2
* **Студент:** [ФИО]
* **Студент:** Прибыткова Елизавета Дмитриевна
* **Вариант / Карточка:** [Например: #025 Pikachu]
---
@@ -8,8 +8,67 @@
## Ключевой код
```csharp
// Самая важная часть реализации (методы, структуры, логика)
public class Card
internal class Program
{
public string Name { get; set; }
public int Hp { get; set; }
static void Main(string[] args)
{
//блок 1 задание 1
//Console.WriteLine("=== Прокачка покемона ===");
//Console.Write("Введите базовое значение атаки покемона: ");
//int attackBase = int.Parse(Console.ReadLine());
//Console.Write("\nВведите уровень покемона: ");
//int level = int.Parse(Console.ReadLine());
//Console.WriteLine($"\nИтоговая атака этого покемона: {attackBase + (level*5)}");
//блок 1 задание 2
//int trenerBalance = 1500;
//int potionPrice = 200;
//Console.WriteLine($"Текущий баланс тренера: {trenerBalance}");
//Console.Write("Введите количество приобретаемых зелий: ");
//var potionCount = int.Parse(Console.ReadLine());
//int potionCost = potionPrice * potionCount;
//trenerBalance -= potionCost;
//Console.WriteLine($"\nПокупка успешно совершена. Остаток монет на балансе: {trenerBalance}");
//БЛОК 2 задание 2.1
//Console.Write("Введите текущее количество HP покемона: ");
//int pokemonHealth = int.Parse(Console.ReadLine());
//Console.WriteLine();
//if (pokemonHealth <= 0)
// Console.WriteLine("Покемон потерял сознание! Верните его в покебол.");
//else if (pokemonHealth <= 20)
// Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
//else if (pokemonHealth <= 50)
// Console.WriteLine("Покемон ранен, будьте осторожны.");
//else
// Console.WriteLine("Покемон полон сил и готов к бою!");
//БЛОК задание 2.2
Console.WriteLine("=== МЕНЮ КОМАНД ===");
Console.WriteLine("1 — Атака\n2 — Инвентарь\n3 — Сменить покемона\n4 — Побег");
Console.Write("Введите номер выбранного действия: ");
int menuSelection = int.Parse(Console.ReadLine());
Console.WriteLine();
{
switch (menuSelection)
{
case 1:
Console.WriteLine("Покемон наносит быстрый удар!");
break;
case 2:
Console.WriteLine("Вы открыли сумку и применили Зелье Лечения.");
break;
case 3:
Console.WriteLine("Вы отозвали покемона и выпустили нового!");
break;
case 4:
Console.WriteLine("Вы успешно сбежали из боя!");
break;
default:
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
break;
}
}
}
}
+73
View File
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace lesson2
{
internal class Program
{
static void Main(string[] args)
{
//блок 1 задание 1
//Console.WriteLine("=== Прокачка покемона ===");
//Console.Write("Введите базовое значение атаки покемона: ");
//int attackBase = int.Parse(Console.ReadLine());
//Console.Write("\nВведите уровень покемона: ");
//int level = int.Parse(Console.ReadLine());
//Console.WriteLine($"\nИтоговая атака этого покемона: {attackBase + (level*5)}");
//блок 1 задание 2
//int trenerBalance = 1500;
//int potionPrice = 200;
//Console.WriteLine($"Текущий баланс тренера: {trenerBalance}");
//Console.Write("Введите количество приобретаемых зелий: ");
//var potionCount = int.Parse(Console.ReadLine());
//int potionCost = potionPrice * potionCount;
//trenerBalance -= potionCost;
//Console.WriteLine($"\nПокупка успешно совершена. Остаток монет на балансе: {trenerBalance}");
//БЛОК 2 задание 2.1
//Console.Write("Введите текущее количество HP покемона: ");
//int pokemonHealth = int.Parse(Console.ReadLine());
//Console.WriteLine();
//if (pokemonHealth <= 0)
// Console.WriteLine("Покемон потерял сознание! Верните его в покебол.");
//else if (pokemonHealth <= 20)
// Console.WriteLine("Критическое состояние! Срочно используйте зелье!");
//else if (pokemonHealth <= 50)
// Console.WriteLine("Покемон ранен, будьте осторожны.");
//else
// Console.WriteLine("Покемон полон сил и готов к бою!");
//БЛОК задание 2.2
Console.WriteLine("=== МЕНЮ КОМАНД ===");
Console.WriteLine("1 — Атака\n2 — Инвентарь\n3 — Сменить покемона\n4 — Побег");
Console.Write("Введите номер выбранного действия: ");
int menuSelection = int.Parse(Console.ReadLine());
Console.WriteLine();
{
switch (menuSelection)
{
case 1:
Console.WriteLine("Покемон наносит быстрый удар!");
break;
case 2:
Console.WriteLine("Вы открыли сумку и применили Зелье Лечения.");
break;
case 3:
Console.WriteLine("Вы отозвали покемона и выпустили нового!");
break;
case 4:
Console.WriteLine("Вы успешно сбежали из боя!");
break;
default:
Console.WriteLine("Неизвестная команда! Вы пропустили ход.");
break;
}
}
}
}
}