Ejemplo n.º 1
0
        public void TestAll(int size, string ops, int expectedCount)
        {
            var       force = new BinaryBruteForcerOld(ops.Split(' '));
            Stopwatch sw    = Stopwatch.StartNew();
            var       all   = force.Enumerate(size);

            Console.WriteLine("new calculated, size = {0}", all.Count());
            //Assert.AreEqual(expectedCount, all.Count());
            Console.WriteLine(sw.Elapsed);

            //            Console.WriteLine("All:");
            //            foreach (var ar in all)
            //                Console.WriteLine(ar.Printable());

            var force2 = new BinaryBruteForcer(ops.Split(' '));
            var all2   = force2.Enumerate(size);

            Console.WriteLine("new optim calculated, size = {0}", all2.Count());

            var setOfAll = new HashSet <string>(all2.Select(t => t.Printable()));
            var diff     = all.Where(t => !setOfAll.Contains(t.Printable()));

            foreach (var ar in diff.Take(50))
            {
                Console.WriteLine(ar.Printable());
            }
        }
Ejemplo n.º 2
0
        public void Test1()
        {
            IEnumerable <byte[]> items = new BinaryBruteForcerOld("xor", "not").Enumerate(13);

            Console.WriteLine(items.Count());
            //			foreach (var item in items)
            //			{
            //				Console.WriteLine(item.Printable());
            //			}
        }