/* 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); }
public void Draw(int x, int y, ASCIIPage page) { for (int row = 0; row < page.H; row++) { for (int col = 0; col < page.W; col++) { Set(col + x, row + y, page.Get(col, row)); SetColor(col + x, row + y, page.GetColor(col, row)); } } }
//15*8 public static ASCIIPage Monster() { ASCIIPage page = new ASCIIPage(15, 8); page.Draw(4, 3, Arm()); page.Draw(5, 5, Leg()); page.Draw(5, 0, Head()); page.Draw(5, 3, Body()); Console.WriteLine(page.Print()); //SaveString("d:/asciiArt", page.Print()); return(page); }
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); }
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); }