Graficando letras en consola IV (ÑPQRST) [ESP-ENG] | C++

avatar
(Edited)

cc.jpg

¿Qué tal? Por acá continuamos con la cuarta parte de esta serie en la que graficamos en la consola hoy las letras protagonistas son -ÑPQRST-. Sí tenemos a la "ñ" porque lo prometido es deuda.

How are you doing? Here we continue with the fourth part of this series in which we plot on the console today the protagonist letters are -ÑPQRST-. Yes, we have the "ñ" because what we promised is a promise.

Programación c++.png

Comenzamos con la línea curva que va encima de la letra "ñ", mejor conocida como "virgulilla" o también "acento agudo". Como no me agradaba del todo el resultado curvo fui por una barra simple que cumpliera con el tamaño correcto al usar de limitante "j>n/2-3 && j<n/2+2" en "i==0" o traducido como: Una línea superior a partir de donde j es mayor que la mitad del tamaño ingresado menos tres hasta donde j es menor que la mitad del tamaño ingresado mas dos.

La siguiente función es la "N" que ya explicamos en el post anterior. Le sigue la "P" que cuenta con "j==0", "j==n-1&&i<=n/2), "i==0" y "j<=n-1 && i==n/2", esto para la línea izquierda, la línea derecha vertical que va hasta la mitad, la línea superior y la línea que va desde la mitad de la letra hasta encontrarse con la línea derecha vertical, esto para rellenar el "óvalo" de la "P", aunque para esta primera versión ese "óvalo" es bastante cuadrado.

Para la segunda versión parto de las limitantes usadas para la curvatura de la "O_2", función explicada en el post anterior, esto para lograr que se vea más ovalada la parte de la "P" que así lo requiere. Lo que resaltaría que es nuevo en este caso es la limitante "i>0 && i<n/2" que se traduciría como desde que i es mayor que cero hasta que sea menor que n/2, esta va acompañada de "j==n-1" porque es la línea vertical derecha. Sucede algo parecido con la línea central.

Para la Q si tuve ciertos problemas aunque una parte importante también parte de "O_2" para lograr ese efecto circular. La novedad estaría en "j==i && i>=n/2" o "donde j sea igual a i e i sea mayor o igual a la mitad del valor ingresado. Esto para la diagonal correspondiente a la letra Q, varias limitaciones están acompañadas de n/2 porque decidí recortar un poco un par de líneas para lograr que resalte la diagonal mencionada.

La letra "R" combina bastantes condiciones/limitantes con la P y una en particular con la "Q", esto porque si ojeamos detenidamente podemos lograr una "R" si le añadimos una diagonal a la "P" a partir de donde i>n/2. Se podría lograr un resultado más circular si se parte de "P_2".

We start with the curved line above the letter "ñ", better known as "virgulilla" or "acute accent". As I didn't like the curved result I went for a simple bar that complied with the correct size by using as limiting "j>n/2-3 && j<n/2+2" in "i==0" or translated as: An upper line from where j is greater than half of the entered size minus three to where j is less than half of the entered size plus two.

The next function is the "N" which we explained in the previous post. It is followed by the "P" which has "j==0", "j==n-1&&i<=n/2), "i==0" and "j<=n-1 && i==n/2", this for the left line, the vertical right line that goes to the middle, the top line and the line that goes from the middle of the letter to meet the vertical right line, this to fill the "oval" of the "P", although for this first version that "oval" is quite square.

For the second version, I use the constraints used for the curvature of the "O_2", function explained in the previous post, this to make it look more oval the part of the "P" that requires it. What would stand out that is new in this case is the constraint "i>0 && i<n/2" that would be translated as since i is greater than zero until it is less than n/2, this is accompanied by "j==n-1" because it is the right vertical line. Something similar happens with the central line.

For the Q I did have some problems, although an important part of it is also part of "O_2" to achieve that circular effect. The novelty would be in "j==i && i>=n/2" or "where j is equal to i and i is greater or equal to half the value entered. This for the diagonal corresponding to the letter Q, several limitations are accompanied by n/2 because I decided to trim a couple of lines to make the diagonal stand out.

The letter "R" combines quite a few conditions/constraints with P and one in particular with "Q", this because if we look closely we can achieve an "R" if we add a diagonal to "P" from where i>n/2. A more circular result could be achieved if we start from "P_2".

Programación c++.png

image.png

image.png

image.png

image.png

Programación c++.png

Para la S encontramos "i==0", "j<=n-1 && i==n/2", "i==n-1", "j==0&&i<n/2" y "j==n-1 && i>=n/2". Esto para la línea superior, la central, la inferior, la vertical izquierda que va hasta el centro y la vertical derecha que va desde el centro (en el lateral derecho) hasta abajo.

La versión "S_2" parte de lo explicado en "O_2" para definir un poco la forma circular. Hay una condición que incluye "i==n/2" y "j>0 && j<n-1", esto para la línea central que parte desde que j (eje x) es mayor que 0 hasta donde se cumpla j<n-1. Para la letra T hice dos intentos, uno donde "j==n/2" y "i==0", sin embargo este no me agradó del todo así que agregué "j==n/2-1" para hacer dos líneas centrales que la hicieran ver más firme.

A la hora de llamar a las funciones cabe destacar que la barra de la N para crear la "ñ" debe ir una posición por sobre esta en el eje Y. También que las separaciones en el eje X deben ser cambiadas si el tamaño aumenta.

For S we find "i==0", "j<=n-1 && i==n/2", "i==n-1", "j==0&&i<n/2" and "j==n-1 && i>=n/2". This for the top line, the center line, the bottom line, the left vertical going to the center and the right vertical going from the center (on the right side) to the bottom.

The "S_2" version starts from what was explained in "O_2" to define a little the circular shape. There is a condition that includes "i==n/2" and "j>0 && j<n-1", this for the center line starting from where j (x-axis) is greater than 0 to where j<n-1 is fulfilled. For the letter T I made two attempts, one where "j==n/2" and "i==0", however I didn't quite like this one so I added "j==n/2-1" to make two centerlines to make it look firmer.

When calling the functions it should be noted that the slash of the N to create the "ñ" must go one position above it on the Y-axis. Also that the separations on the X-axis must be changed if the size increases.

Programación c++.png

image.png

image.png

Programación c++.png

image.png

image.png

Programación c++.png

¡Y bueno... Eso es todo por hoy! Mientras actualizaba un poco la tabla de publicaciones noté que había cometido errores graves en el conteo, posiblemente porque varias veces publiqué en la madrugada y algunos errores se filtraron y no los noté porque suele ser una parte del formato que doy por sentado que está bien siempre. Aún así ya está corregida y mejorada para que no ocupe tanto espacio.

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! While I was updating the table of posts a bit I noticed that I had made some serious mistakes in the count, possibly because several times I posted in the wee hours of the morning and some errors got filtered out and I didn't notice them because it's usually a part of the formatting that I take for granted that it's always right. Still it is now corrected and improved so that it doesn't take up so much space.

If you are interested in another programming tutorial here are the links to the ones I have done until now:


Título/TittleLINKTítulo/TittleLINK
Calculador de datos para un triángulo rectángulo en C++1Graficando números en consola (0-3) C++16
Concecionario de autos, ejercicio en JAVA2Graficando números en consola II (4-6) C++17
Calculador de edad básico C++3Graficando números en consola III (7-9) C++18
Inversor de números de tres cifras4Calculadora de ecuaciones cuadráticas C++19
¿Cuántos números de 3 cifras existen cuya suma sea 10? - ¡Respondiendo a otro usuario! C++5Dados digitales C++20
Calculadora simple, cifra menos significativa y portada simple C++6Fichas biográficas de próceres C++21
¡Vistazo a BeatUDO! JAVA7Calculadora de divisores C++22
Comprobar si un número de dos cifras es primo C++8Calculadora de divisores II C++23
Conversor de pulgadas a 7 unidades distintas C++9Graficando letras en consola I (ABCDE) C++24
Comprobar si un número es capicúa (Máx 5 cifras) C++10Graficando letras en consola II (FGHIJ) C++25
Comprobador de caracteres C++11Graficando letras en consola III (KLMNO) C++26
Calculadora de índice de masa corporal C++12XX
Calculadora de factoriales C++13XX
Conversor (Grados Celsius - Fahrenheit - Kelvin) C++14XX
Calculadora de longitud, diametro y área de una circunferencia C++15XX

Programación c++.png


Redes actualizada.gif


Puedes seguirme por acá si lo deseas:
You can follow me here if you want:

Cuenta secundaria
(Dibujos, edición y juegos) | Secondary account (Drawings, editing and games)



0
0
0.000
1 comments