diff --git a/works/Program.cs b/works/Program.cs new file mode 100644 index 0000000..1526220 --- /dev/null +++ b/works/Program.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace lab_4 +{ + internal class Program + { + static void Main(string[] args) + { + //те самые массивы + printZnum(1); + string[] activeTeam = new string[3]; + Console.WriteLine("=== Регистрация команды ==="); + for (int i = 0; i < activeTeam.Length; i++) + { + Console.Write($"Введите имя покемона №{i + 1}: "); + activeTeam[i] = Console.ReadLine(); + } + + Console.WriteLine("\n=== Ваша команда на этот бой ==="); + Console.WriteLine($"1. {activeTeam[0]}"); + Console.WriteLine($"2. {activeTeam[1]}"); + Console.WriteLine($"3. {activeTeam[2]}"); + + //те самые листы + printZnum(2); + Console.WriteLine("=== ИНВЕНТАРЬ ТРЕНЕРА ==="); + List inventory = new List(); + inventory.Add("Покебол"); + inventory.Add("Зелье"); + inventory.Add("Яблоко"); + Console.WriteLine($"Вы положили вещи в сумку. Предметов в инвентаре: {inventory.Count}"); + inventory.RemoveAt(0); + Console.WriteLine($"Вы использовали один Покебол для поимки дикого покемона!"); + Console.WriteLine($"Обновленный инвентарь.Осталось предметов: {inventory.Count}"); + + //тот самый foreach + printZnum(3); + Console.WriteLine("=== Содержимое вашей сумки ==="); + foreach (string item in inventory) + { + Console.WriteLine($"[Предмет] -> {item}"); + } + + } + static void printZnum(int num) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"\n----- задание {num} -----"); + Console.ResetColor(); + } + } +}