Пример #1
0
        static void Main()
        {
            GameMoves   g          = new GameMoves();
            IEnumerator enumerator = g.Cross();

            while (enumerator.MoveNext())
            {
                enumerator = (IEnumerator)enumerator.Current;
            }

            MusicTitles titles = new MusicTitles();

            Console.WriteLine("Using GetEnumerator()");
            foreach (string title in titles)
            {
                Console.WriteLine(title);
            }
            Console.WriteLine();
            Console.WriteLine("reverse");
            foreach (string title in titles.Reverse())
            {
                Console.WriteLine(title);
            }
            Console.WriteLine();
            Console.WriteLine("subset");
            foreach (string title in titles.Subset(2, 2))
            {
                Console.WriteLine(title);
            }
        }
Пример #2
0
        static void MusicTitles()
        {
            var titles = new MusicTitles();
              foreach (var title in titles)
              {
            Console.WriteLine(title);
              }
              Console.WriteLine();

              Console.WriteLine("reverse");
              foreach (var title in titles.Reverse())
              {
            Console.WriteLine(title);
              }
              Console.WriteLine();

              Console.WriteLine("subset");
              foreach (var title in titles.Subset(2, 2))
              {
            Console.WriteLine(title);
              }
        }
Пример #3
0
        static void MusicTitles()
        {
            var titles = new MusicTitles();

            foreach (var title in titles)
            {
                Console.WriteLine(title);
            }
            Console.WriteLine();

            Console.WriteLine("reverse");
            foreach (var title in titles.Reverse())
            {
                Console.WriteLine(title);
            }
            Console.WriteLine();

            Console.WriteLine("subset");
            foreach (var title in titles.Subset(2, 2))
            {
                Console.WriteLine(title);
            }
        }