Hola, vengo de vuelta con más de esta pequeña serie en la que las letras en consola son protagonistas, sumando 5 para avanzar en la meta de completar el abecedario. En este caso F - G - H - I - J, con algunas alternativas.
Recordando que evitaré repetir algunas cosas ya explicadas en el primer post de esta serie y en la serie anterior en la que los números fueron el centro, los links para leer dichos artículos están al final.
Iniciando con la F, "i0" para la línea superior, "j0" para la línea vertical izquierda, "j<n-2 && i==n/2" para la línea central que reduje un poco para que quedara un poco mejor.
Para la letra G, vemos nuevamente la línea superior e izquierda y también la inferior, como si se tratara de la C. Esto porque de hecho son muy parecidas, sin embargo hay dos líneas que dan la diferencia, estas son "jn-1 && i>=n/2" para la línea derecha que parte de la mitad hasta abajo y "in/2 &&j>=n/2" para la línea central que termina de definir la letra "G".
Para la tercera función "H", las condiciones son un poco más simples. La central "in/2", la izquierda vertical "j0" y la derecha vertical "j==n-1". Recordando que los parámetros representan las coordenadas de posicionamiento X,Y y el tamaño n.
Hello, I'm back with more of this little series in which the console letters are the protagonists, adding 5 to advance in the goal of completing the alphabet. In this case F - G - H - I - J, with some alternatives.
Remembering that I will avoid repeating some things already explained in the first post of this series and in the previous series in which the numbers were the focus, the links to read those articles are at the end.
Starting with F, "i0" for the top line, "j0" for the left vertical line, "j<n-2 && i==n/2" for the center line which I reduced a bit to make it look a little better.
For the letter G, we see again the upper and left line and also the lower one, as if it were the C. This because in fact they are very similar, however there are two lines that give the difference, these are "jn-1 && i>=n/2" for the right line that starts from the middle to the bottom and "in/2 &&j>=n/2" for the central line that finishes defining the letter "G".
For the third function "H", the conditions are a little simpler. The central "in/2", the left vertical "j0" and the right vertical "j==n-1". Recalling that the parameters represent the X,Y positioning coordinates and the size n.
Continuando con la I esta solo tiene una condición en el parámetro del if, es decir una línea vertical central, esto puede resultar muy simple y traer problemas de confusión por su parecido con la "L" minúscula. Por lo que también añadí una versión "I_2" con dos condiciones más que hace que se asemeje a una letra "I" mayúscula. Estas dos condiciones son "i0", "in-1" para la línea superior e inferior.
Para la J se repiten las condiciones para la línea inferior y también la línea derecha. Varía con "i==0 && j>n/2" que añade una línea superior recortada que representa ese detalle de la "J" que aparece en algunas fuentes.
Finalmente en el main llamo a todas las funciones para mostrar en pantalla las letras, todas a la misma altura y con el mismo tamaño pero con una separación en X para que no se sobrepusiesen. El getch lo usé para aprovechar la pausa. El system("cls") realmente no es necesario en este caso.
Continuing with the I this one has only one condition in the if parameter, that is to say a central vertical line, this can be very simple and bring confusion problems because of its resemblance to the lowercase "L". So I also added a version "I_2" with two more conditions that makes it resemble a capital letter "I". These two conditions are "i0", "in-1" for the top and bottom line.
For J, the conditions are repeated for the bottom line and also the right line. It varies with "i==0 && j>n/2" which adds a cropped top line representing that "J" detail that appears in some fonts.
Finally in the main I call all the functions to display the letters on the screen, all at the same height and with the same size but with a separation in X so that they do not overlap. I used the getch to take advantage of the pause. The system("cls") is not really necessary in this case.
¡Y bueno... Eso es todo por hoy! Espero que este segundo post sobre cómo graficar letras te sea de ayuda, pronto continuaré con esta serie, espero cubrir el abecedario.
Si te interesa otro tutorial de programación acá te dejo los links a los que he realizado hasta ahora:
And well... That's all for today! I hope this second post on how to graph letters will be helpful, soon I will continue with this series, I hope to cover the alphabet.
If you are interested in another programming tutorial here are the links to the ones I have done until now:
Nombre de la publicación / Name of the post | LINK |
---|---|
Calculador de datos para un triángulo rectángulo en C++ | 1 |
Concecionario de autos, ejercicio en JAVA | 2 |
Calculador de edad básico C++ | 3 |
Inversor de números de tres cifras | 4 |
¿Cuántos números de 3 cifras existen cuya suma sea 10? - ¡Respondiendo a otro usuario! C++ | 6 |
Calculadora simple, cifra menos significativa y portada simple C++ | 7 |
¡Vistazo a BeatUDO! JAVA | 9 |
Comprobar si un número de dos cifras es primo C++ | 10 |
Conversor de pulgadas a 7 unidades distintas C++ | 11 |
Comprobar si un número es capicúa (Máx 5 cifras) C++ | 12 |
Comprobador de caracteres C++ | 13 |
Calculadora de índice de masa corporal C++ | 14 |
Calculadora de factoriales C++ | 15 |
Conversor (Grados Celsius - Fahrenheit - Kelvin) C++ | 16 |
Calculadora de longitud, diametro y área de una circunferencia C++ | 17 |
Graficando números en consola (0-3) C++ | 18 |
Graficando números en consola II (4-6) C++ | 19 |
Graficando números en consola III (7-9) C++ | 20 |
Calculadora de ecuaciones cuadráticas C++ | 21 |
Dados digitales C++ | 22 |
Fichas biográficas de próceres C++ | 23 |
Calculadora de divisores C++ | 24 |
Calculadora de divisores II C++ | 25 |
Graficando letras en consola I (ABCDE) C++ | 26 |