Example #1
0
        static public void SelfTest()
        {
            List <int> testSet = new List <int>();

            for (int i = 0; i < 10; i++)
            {
                testSet.Add(i);
            }

            Console.WriteLine("test Set Val:");
            foreach (int i in testSet)
            {
                Console.WriteLine(i);
            }

            Console.WriteLine("Random Selected Val:");
            Console.WriteLine(RandomSelect <int> .Select(testSet));

            Console.WriteLine("Random Selected 3 Val:");
            List <int> testRes = RandomSelect <int> .Select(testSet, 3);

            foreach (int i in testRes)
            {
                Console.WriteLine(i);
            }
        }
Example #2
0
/*    05%20%10%
 *    05%99%80%
 *    00%50%99%
 *
 */
        public static ASCIIPage Head()//5*3 Size
        {
            List <char> bl = new List <char>();

            bl.AddRange(SymmetryPair.Keys);
            bl.AddRange(SymmetryPair.Values);
            char c1 = RandomSelect <char> .Select(bl);

            char c2 = RandomSelect <char> .Select(Symmetry);

            char m1 = RandomSelect <char> .Select(Symmetry);

            char m2 = RandomSelect <char> .Select(Symmetry);

            ASCIIPage page   = new ASCIIPage(5, 3);
            var       color  = ASCIIColor.RndColor();
            var       lcolor = color.Lighter();
            var       dcolor = color.Darker();

            page.Set(1, 0, c1); page.SetColor(1, 0, lcolor); page.Set(3, 0, SymmetryPair[c1]); page.SetColor(3, 0, lcolor);
            page.Set(1, 1, c2); page.SetColor(1, 1, color); page.Set(2, 1, m1); page.SetColor(2, 1, color); page.Set(3, 1, c2); page.SetColor(3, 1, color);
            page.Set(2, 2, m2); page.SetColor(2, 2, dcolor);

            //Console.WriteLine(page.Print());
            return(page);
        }
Example #3
0
        public static ASCIIPage Arm()//7*3 Size
        {
            List <char> bl = new List <char>();

            bl.AddRange(SymmetryPair.Keys);
            bl.AddRange(SymmetryPair.Values);
            char c1 = RandomSelect <char> .Select(bl);

            char c2 = RandomSelect <char> .Select(bl);

            char c3 = RandomSelect <char> .Select(bl);

            ASCIIPage page = new ASCIIPage(7, 3);

            page.Set(0, 0, c1); page.Set(6, 0, SymmetryPair[c1]);
            page.Set(0, 1, c2); page.Set(6, 1, SymmetryPair[c2]);
            page.Set(0, 2, c3); page.Set(6, 2, SymmetryPair[c3]);

            //Console.WriteLine(page.Print());
            return(page);
        }
Example #4
0
        public static ASCIIPage Body()//5*2 Size
        {
            List <char> bl = new List <char>();

            bl.AddRange(SymmetryPair.Keys);
            bl.AddRange(SymmetryPair.Values);
            char c1 = RandomSelect <char> .Select(bl);

            char c2 = RandomSelect <char> .Select(bl);

            char c3 = RandomSelect <char> .Select(bl);

            char m1 = RandomSelect <char> .Select(Symmetry);

            char m2 = RandomSelect <char> .Select(Symmetry);

            ASCIIPage page = new ASCIIPage(5, 2);

            page.Set(0, 0, c1); page.Set(1, 0, c2); page.Set(2, 0, m1); page.Set(3, 0, SymmetryPair[c2]); page.Set(4, 0, SymmetryPair[c1]);
            page.Set(1, 1, c3); page.Set(2, 1, m2); page.Set(3, 1, SymmetryPair[c3]);

            //Console.WriteLine(page.Print());
            return(page);
        }