diff --git a/works/lab-01/MyDll.dll b/works/lab-01/MyDll.dll new file mode 100644 index 0000000..bfc7e44 Binary files /dev/null and b/works/lab-01/MyDll.dll differ diff --git a/works/lab-01/Program.cs b/works/lab-01/Program.cs new file mode 100644 index 0000000..367a0e5 --- /dev/null +++ b/works/lab-01/Program.cs @@ -0,0 +1,90 @@ +using System; +using HelpMethods; + +namespace Test +{ + internal class Program + { + static void Main(string[] args) + { + string + pokemonName = "Чармандер" + , elementType = "Огонь"; + + byte level = 1; + short hp = 95; + + GetInfo(pokemonName, elementType, level, hp); + CreatePassport(); + + } + + /// + /// Метод для задания №1. + /// + /// + /// + /// + /// + static void GetInfo(string name, string elType, byte lvl, short hp) + { + const sbyte margine = -10; + + string message = +$@" +====== INFO ====== +{"Pokemon:",margine}{name} +{"Element:",margine}{elType} +{"Level:",margine}{lvl} | HP: {hp} +==================== +"; + + Console.WriteLine(message); + SystemHelp.Waiting(); + } + + /// + /// Методы для задания №2. + /// + static void CreatePassport() + { + SetValues(); + + static void SetValues() + { + byte maxStringLength = 20; + + Console.Write("Fill out the forms.\t[20 chars]\n\nTrainer name: "); + string trainerName = StringHelp.CutString(Console.ReadLine(), maxStringLength); + + Console.Write("Pokemon name: "); + string pokemonName = StringHelp.CutString(Console.ReadLine(), maxStringLength); + + Console.Write("Element type: "); + string elementType = StringHelp.CutString(Console.ReadLine(), maxStringLength); + + Console.Write("Region name: "); + string regionName = StringHelp.CutString(Console.ReadLine(), maxStringLength); + + PrintPassport(trainerName, pokemonName, elementType, regionName); + } + static void PrintPassport(string trainer, string pokemon, string element, string region) + { + const sbyte + margine1 = -9 + , margine2 = -11; + + string message = +$@" +************************************************************* +POKEMON'S PASSPORT +{"Trainer:",margine1}{trainer}{" (Region:",margine2}{region}) +{"Pokemon:",margine1}{pokemon}{" (Element:",margine2}{element}) +************************************************************* +"; + + Console.WriteLine(message); + } + } + } +} \ No newline at end of file diff --git a/works/lab-01/Test.csproj b/works/lab-01/Test.csproj new file mode 100644 index 0000000..81f2966 --- /dev/null +++ b/works/lab-01/Test.csproj @@ -0,0 +1,58 @@ + + + + + Debug + AnyCPU + {0580ACC5-9C57-48B6-A97B-75103119F024} + Exe + Test + Test + v4.8 + latest + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + .\MyDll.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file