Beispiel #1
0
        static void Main()
        {
            // 1.
            string test = "Fallout";

            ForString instanceString = new ForString(test);

            Console.WriteLine(instanceString.ShavString(5));
            Console.WriteLine(instanceString.ShavString(3, 5));
            Console.WriteLine(instanceString.Concating("New", "Vegas", "Is", "Best", "3D", "Fallot", "Ever"));
            Console.WriteLine(instanceString.ToSomthing('U'));
            Console.WriteLine(instanceString.ToSomthing('L'));

            // 2.
            int someNum = 1377;

            Console.WriteLine("Byte Array: " + string.Join(" ", ToByteArray(someNum)));

            // 3.
            Vector First  = new Vector(4, 8, 16);
            Vector Second = new Vector(2, 4, 8);
            Vector Third  = Vector.MathVector(First, Second, '+');

            Console.WriteLine($"New Vector : x={Third.x}, y={Third.y}, z={Third.z}");

            // 4.
            Console.WriteLine("Type: " + Typing(First));
            Console.WriteLine("Type: " + Typing(test));

            // 5.

            Library limb = new Library(4);

            Book orwell = new Book("1984");

            limb.AddBook(orwell);
            limb.AddBook("It's me - Edichka");

            limb.ShowBooks();

            Console.WriteLine("Book found status: " + limb.IsBookExist(orwell));
            Console.WriteLine("Book found status: " + limb.IsBookExist("The Catcher in the Rye"));

            limb.RemoveBook("It's me - Edichka");

            limb.AddBook("Tractatus Logico-Philosophicus");
            limb.AddBook("Critique of Pure Reason");
            limb.AddBook("Critique of Practical Reason");
            limb.ShowBooks();

            limb.RemoveBook(orwell);
            limb.RemoveBook("Critique of Practical Reason");

            Book hegel = new Book("Wissenschaft der Logik");

            limb.RemoveBook(hegel);

            limb.ShowBooks();

            //6.

            long  big     = long.MaxValue;
            float small   = 23.84F;
            int   gig     = 1024;
            int   _gig_   = 1_000_380;
            int   gigchec = 1_000_000;

            Console.WriteLine(big.Abb());
            Console.WriteLine(small.Abb());
            Console.WriteLine(gig.Abb());
            Console.WriteLine(_gig_.Abb());
            Console.WriteLine(gigchec.Abb());


            Console.Read();
        }