¡Finalmente! Luego de pasar una leve pero fastidiosa enfermedad, les traigo la parte final de esta serie en la que las letras en consola son protagonistas, me parece que no omití ninguna, de todas maneras revisaré para corregir en caso de que me haya descuidado con alguna. En esta ocasión las líneas inclinadas han generado una pequeña diferencia que hace parecer que las letras que las incluyen sean alérgicas a los números pares... Esto porque el centrado se ve un poco afectado cuando estos números aparecen pues... en un tamaño n = 8 me posiciono en el número 4, dejando 1, 2, 3 de un lado, 5, 6,7... ¿8?
Para el 7 en cambio me posiciono en 4 y dejo 1,2,3 de un lado, 5,6,7 del otro ¿Ves por donde va la historia? La simetría resulta ser un poco exigente a veces.
Finally! After passing a slight but annoying illness, I bring you the final part of this series in which the letters in console are protagonists, it seems to me that I did not omit any, anyway I will check to correct in case I have neglected with any. This time the slanted lines have generated a small difference that makes it seem that the letters that include them are allergic to the even numbers... This because the centering is a bit affected when these numbers appear because... in a size n = 8 I position myself at number 4, leaving 1, 2, 3 on one side, 5, 6,7.... ¿8?
For the 7 on the other hand I position myself at 4 and leave 1,2,3 on one side, 5,6,7 on the other... See where the story goes? Symmetry turns out to be a bit demanding at times.
Para la letra "U" las limitaciones son simples "j0" para la línea izquierda, "in-1" para la inferior y "j==n-1" para la derecha. Se puede lograr un efecto un poco más circular en la parte inferior pero podría causar mayor confusión entre la "V" y la "U".
Para la letra "V" hice dos variantes, la primera con el mismo nombre de la letra y la segunda "V_mejor". Para la primera usé un par de condiciones en las que las líneas inclinadas "ij" e "i+jn-1" están limitadas ha la mitad de la figura + 1. Esto para lograr una figura a partir del centro (donde ambas lineas chocan) hasta arriba, en donde están en su máxima separación, de modo que logramos una letra "V". Aunque tenemos un problema y es que en comparación con las otras letras, esta cuenta solo con un poco más de la mitad del tamaño que se le ingresa en el eje "y", por lo que será muy ancha conforme se aumente para tratar de igualar el resto de las letras.
Para "V_mejor" tenemos "in-1 && j>=n/2-1 && j<n/2+2" para la línea inferior recortada, luego "in-2 && jn/2-2" junto a "in-2 && jn/2+2" para los puntos que anteceden a la final para que luego las condiciones en la que aparece "in-3" finalicen el efecto escalonado que elegí para lograr la base de la "V". Las líneas que la completan son las verticales que parten de j0 y jn-1 con su clara limitación en "i" para evitar que se sobreponga a la base.
La "W" cuenta con las dos verticales de siempre "j0" y "jn-1" pero también con "in/2 && jn/2" para un punto central y las dos líneas inclinadas que ya hemos visto pero limitadas a "i>n/2" para que aparezcan abajo y no arriba como en la "M". La "X" fue tan fácil como colocar las dos líneas inclinadas y no limitarlas en el eje Y, es decir en las coordenadas para "i".
For the letter "U" the constraints are simple "j0" for the left line, "in-1" for the bottom and "j==n-1" for the right. A slightly more circular effect can be achieved at the bottom but might cause more confusion between the "V" and the "U".
For the letter "V" I made two variants, the first with the same name of the letter and the second "V_better". For the first one I used a pair of conditions in which the slanted lines "ij" and "i+jn-1" are limited to half the figure + 1. This is to achieve a figure from the center (where both lines collide) to the top, where they are at their maximum separation, so that we achieve a letter "V". Although we have a problem and it is that in comparison with the other letters, this one has only a little more than half the size that is entered in the "y" axis, so it will be very wide as it is increased to try to match the rest of the letters.
For "V_better" we have "in-1 && j>=n/2-1 && j<n/2+2" for the trimmed bottom line, then "in-2 && jn/2-2" along with "in-2 && jn/2+2" for the points preceding the final one so that then the conditions where "in-3" appears finish the staggered effect I chose to achieve the base of the "V". The lines that complete it are the vertical lines that start from j0 and jn-1 with their clear limitation in "i" to avoid overlapping the base.
The "W" has the usual two verticals "j0" and "jn-1" but also "in/2 && jn/2" for a center point and the two slanted lines we have already seen but limited to "i>n/2" so that they appear below and not above as in the "M". The "X" was as easy as placing the two slanted lines and not limiting them on the Y-axis, i.e. on the coordinates for "i".
Para la "Y" usé las líneas inclinadas limitadas a la menos de la mitad y una línea central "jn/2 && i>=n/2". Finalmente para la "Z" usé "i0" y "i==n-1" para la línea superior e inferior y la línea inclinada que suelo llamar inversa para completar la figura, aunque a nivel matemático se trataría de una función lineal con pendiente positiva.
En el main no hago más que llamar a las funcione que incluyen a cada letra y coloco un comentario de tipo bloque mencionando lo que aclaraba al principio del post acerca de los números impares en los tamaños. También hice uno aparte en el que comparaba ambas versiones de la "V".
For the "Y" I used the inclined lines limited to the less than half and a central line "jn/2 && i>=n/2". Finally for the "Z" I used "i0" and "i==n-1" for the upper and lower line and the sloping line that I usually call inverse to complete the figure, although mathematically it would be a linear function with positive slope.
In the main I just call the functions that include each letter and I put a block comment mentioning what I clarified at the beginning of the post about the odd numbers in the sizes. I also made a separate one comparing both versions of the "V".
¡Y bueno... Eso es todo por hoy! Espero que esta serie en la que la consola se vuelve un lienzo otra vez, resulte de bendicion para ti. Ya he completado las letras "A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-Ñ-P-Q-R-S-T-U-V-W-X-Y-Z" y sí, me enrede un poco en el orden pero fue por ciertos problemas con la "Ñ"... Feliz navidad y que este año que viene puedas aprender mucho más que en este año que está por finalizar.
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 series where the console becomes a canvas again, will be a blessing for you. I have already completed the letters "A-B-C-D-E-F-G-G-H-I-J-K-L-M-N-O-Ñ-P-Q-R-S-S-T-T-U-V-W-W-X-Y-Z" and yes, I got a little bit tangled in the order but it was due to some problems with the "Ñ"... Merry Christmas and may you learn much more this coming year than in this year that is about to end.
If you are interested in another programming tutorial here are the links to the ones I have done until now:
Título/Tittle | LINK | Título/Tittle | LINK |
---|---|---|---|
Calculador de datos para un triángulo rectángulo en C++ | 1 | Graficando números en consola (0-3) C++ | 16 |
Concecionario de autos, ejercicio en JAVA | 2 | Graficando números en consola II (4-6) C++ | 17 |
Calculador de edad básico C++ | 3 | Graficando números en consola III (7-9) C++ | 18 |
Inversor de números de tres cifras | 4 | Calculadora de ecuaciones cuadráticas C++ | 19 |
¿Cuántos números de 3 cifras existen cuya suma sea 10? - ¡Respondiendo a otro usuario! C++ | 5 | Dados digitales C++ | 20 |
Calculadora simple, cifra menos significativa y portada simple C++ | 6 | Fichas biográficas de próceres C++ | 21 |
¡Vistazo a BeatUDO! JAVA | 7 | Calculadora de divisores C++ | 22 |
Comprobar si un número de dos cifras es primo C++ | 8 | Calculadora de divisores II C++ | 23 |
Conversor de pulgadas a 7 unidades distintas C++ | 9 | Graficando letras en consola I (ABCDE) C++ | 24 |
Comprobar si un número es capicúa (Máx 5 cifras) C++ | 10 | Graficando letras en consola II (FGHIJ) C++ | 25 |
Comprobador de caracteres C++ | 11 | Graficando letras en consola III (KLMNO) C++ | 26 |
Calculadora de índice de masa corporal C++ | 12 | Graficando letras en consola IV (ÑPQRST) C++ | 27 |
Calculadora de factoriales C++ | 13 | X | X |
Conversor (Grados Celsius - Fahrenheit - Kelvin) C++ | 14 | X | X |
Calculadora de longitud, diametro y área de una circunferencia C++ | 15 | X | X |