private static void pintarPartida(List <Point> serpiente, Point manzana) { String buffer = ""; ConsolaUtils.limpiarPantalla(); buffer += "+"; buffer += StringUtils.RepetirCaracterNVeces('-', TamañoMapa * 2); buffer += "+" + Environment.NewLine; for (int i = TamañoMapa - 1; i >= 0; i--) { buffer += "|"; for (int j = 0; j < TamañoMapa; j++) { buffer += (serpiente.Any(p => p.X == j && p.Y == i)) ? "O " : manzana.X == j && manzana.Y == i ? "X " : " "; } buffer += "|" + Environment.NewLine; } buffer += "+"; buffer += StringUtils.RepetirCaracterNVeces('-', TamañoMapa * 2); buffer += "+" + Environment.NewLine; buffer += "Tamaño: " + serpiente.Distinct().Count() + Environment.NewLine; Console.Write(buffer); }
private static void imprimirMenu() { ConsolaUtils.limpiarPantalla(); Console.WriteLine(); Console.WriteLine(@"+------------------------------------------------+"); Console.WriteLine(@"| |"); Console.WriteLine(@"| |"); Console.WriteLine(@"| _________ __ |"); Console.WriteLine(@"| / _____ / ____ _____ | | __ ____ |"); Console.WriteLine(@"| \_____ \ / \\__ \ | |/ // __ \ |"); Console.WriteLine(@"| / \ | \/ __ \| <\ ___ / |"); Console.WriteLine(@"| / _______ /___| (____ / __|_ \\___ > |"); Console.WriteLine(@"| \/ \/ \/ \/ \/ |"); Console.WriteLine(@"| |"); Console.WriteLine(@"| |"); Console.WriteLine(@"+------------------------------------------------+"); Console.WriteLine(@"| 1.Jugar |"); Console.WriteLine(@"| 2.Instrucciones |"); Console.WriteLine(@"| 3.Salir |"); Console.WriteLine(@"+------------------------------------------------+"); }