Graficando letras en consola I (ABCDE) [ESP-ENG] | C++

PortadaABCDE.jpg

Programación c++.png

Saludos y bendiciones, acá me encuentro luego de un tiempo algo bloqueado respecto a qué subir sobre programación, luego de un tiempo dándole vueltas y repasando el contenido que recibí en 2019, decidí traer otra serie de post sobre graficados con caracteres, solo que esta vez no sobre números sino letras. En este caso A - B - C - D - E, 5 para empezar con un par de extras o alternativas.

En la parte superior del programa coloqué un par de comentarios que ayudan a guiarse mejor en cada una de las funciones, estos de hecho ya los había colocado en la serie de los números y como algunas formas eran sumamente parecidas reciclé un poco de código. La serie que menciono corresponde a los post número 18,19 y 20 que se encuentran mencionados en la tabla que coloco en la mayoría de las entregas.

No indagaré demasiado en las librerías ni en gotoxy porque ya es algo mencionado antes. Así pues la función A tiene tres parámetros, patrón que se verá en todas las funciones de este tipo, el primero para las coordenadas x, el segundo para las coordenadas en y y el tercero para el tamaño. Estos parámetros son tomados en cuenta para el posicionamiento y los límites de los bucles graficadores.

Las condiciones corresponden a "i==0" para la linea superior, "j==0" para la línea vertical izquierda, "j==n-1" para la línea vertical derecha y finalmente i==n/2 para la línea horizontal central.

Para la función "B_simple" usé el mismo patrón de condiciones que para el número 8, por su gran parecido y frecuente uso en algunas graficas simples de este tipo, sin embargo luego la mejoré un poco en la versión "B_mejorada", donde "i==0 && j<n-1" corresponde a la línea superior exceptuando el último caracter y "i==n-1 && j<n-1" corresponde a la línea inferior exceptuando el último caracter.

Luego está la condición "i>0 && i<n-1 && j==n-1" para la línea vertical derecha que parte desde la posición mayor que cero y menor que la final, de modo que se da un aspecto un poco más redondeado que recuerda más a una "B".

Greetings and blessings, here I am after a while somewhat blocked about what to upload about programming, after a while thinking about it and reviewing the content I received in 2019, I decided to bring another series of post about graphing with characters, only this time not about numbers but letters. In this case A - B - C - D - E, 5 to start with a couple of extras or alternatives.

In the upper part of the program I placed a couple of comments that help to guide better in each one of the functions, these in fact I had already placed them in the series of the numbers and as some forms were extremely similar I recycled a little of code. The series that I mention corresponds to the posts number 18,19 and 20 that are mentioned in the table that I place in most of the deliveries.

I will not dig too much into the libraries or gotoxy because it is already mentioned before. So function A has three parameters, a pattern that will be seen in all functions of this type, the first for the x-coordinates, the second for the y-coordinates and the third for the size. These parameters are taken into account for the positioning and limits of the graphing loops.

The conditions correspond to "i==0" for the top line, "j==0" for the left vertical line, "j==n-1" for the right vertical line and finally i==n/2 for the central horizontal line.

For the function "B_simple" I used the same pattern of conditions as for the number 8, because of its great resemblance and frequent use in some simple graphs of this type, however then I improved it a little in the version "B_improved", where "i==0 && j<n-1" corresponds to the upper line except the last character and "i==n-1 && j<n-1" corresponds to the lower line except the last character.

Then there is the condition "i>0 && i<n-1 && j==n-1" for the right vertical line starting from the position greater than zero and less than the end, so that it gives a slightly more rounded appearance more reminiscent of a "B".

image.png

image.png

Programación c++.png

Para la C realmente no hay condiciones que no haya mencionado antes, solo retiré la línea vertical derecha. En el caso de la función "D_diagonales" coloqué un comentario que dice "sólo 8 caracteres" porque con menos resulta menos apreciable la letra, pues su estructura se nota bastante delgada.

En la condición "j==0" grafica la línea vertical izquierda en la condición "i==j && i<=n/2" se asegura una diagonal hasta la mitad superior de la figura. Para la condición i==(n/2)+1 && j==(n/2)-1 se asegura un punto bajo la diagonal, este cambio extraño con respecto al resto fue porque asegurar una diagonal inferior semejante a la anterior en cuanto a sus limitantes, resultaba en una figura aún más rara. Algo parecido sucede con la condición que le sigue.

Para "D_simple" partí de la "B_mejorada" y retiré la línea central, resultando en una D más legible que la que está basada en diagonales centrales. Para "E_simple" partí de una figura muy parecida al "8" pero sin la línea vertical derecha. Finalmente para la "E_mejorada" tomé en cuenta la estructura de la "B_mejorada" y la "D_simple", solo que retirando la línea vertical derecha.

For the C there are really no conditions that I have not mentioned before, I just removed the right vertical line. In the case of the function "D_diagonals" I put a comment that says "only 8 characters" because with less the letter is less noticeable, because its structure is quite thin.

In the condition "j==0" graphs the left vertical line in the condition "i==j && i<=n/2" a diagonal up to the upper half of the figure is ensured. For the condition i==(n/2)+1 && j==(n/2)-1 a point under the diagonal is ensured, this strange change with respect to the rest was because ensuring a lower diagonal similar to the previous one in terms of its limiters, resulted in an even stranger figure. Something similar happens with the condition that follows.

For "D_simple" I started from "B_improved" and removed the central line, resulting in a more legible D than the one based on central diagonals. For "E_simple" I started from a figure very similar to "8" but without the right vertical line. Finally for the "E_improved" I took into account the structure of the "B_improved" and the "D_simple", only removing the right vertical line.


image.png

image.png

image.png

Programación c++.png

image.png

Programación c++.png

¡Y bueno... Eso es todo por hoy! Espero que este primer 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 first 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 postLINK
Calculador de datos para un triángulo rectángulo en C++1
Concecionario de autos, ejercicio en JAVA2
Calculador de edad básico C++3
Inversor de números de tres cifras4
¿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! JAVA9
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

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
4 comments
avatar

Saludos @gabrielr29, Gracias por venir a PROMUEVE TU PUBLICACIÓN queremos verte el próximo miércoles a la misma hora.

0
0
0.000
avatar

Hola amigo, muy interesante e útil esa grafica.
Saludos

0
0
0.000