Imagen edited in Gimp.
Source 1.
Source 2.
Hace algunos post, mencioné de casualidad, que en algún momento de mi vida había adquirido algunos conocimientos en JavaScript, y con ello, programado un cajero automático para mi navegador.
Este aprendizaje básico no lo continue, tristemente, pero la buena noticia, es que este año pienso retomarlo y tomarme en serio comprender el lenguaje JavaScript.
Sin embargo, el conocimiento de aquel entonces (2018) me sirvio muchisimo para comprender algo de la lógica básica de programación. Gracias a un curso gratuito de platzi, realicé este cajero como parte de una de sus prácticas.
Si quieres mirar cómo funciona, sigue leyendo.
A few posts ago, I mentioned by chance, that at some point in my life I had acquired some knowledge in JavaScript, and with it, programmed an ATM for my browser.
This basic learning was not continued, sadly, but the good news is that this year I plan to take it up again and take seriously understanding the JavaScript language.
However, the knowledge of that time (2018) helped me a lot to understand some of the basic logic of programming. Thanks to a free course from platzi, I made this ATM as part of one of its practices.
If you want to see how it works, keep reading.
Acción Inicial. || Initial Action.
All gifs were made in PhotoScape.
El cajero inicia preguntando entre dos sencillas opciones:
¿Desea consultar saldo ó retirar dinero?
Por lo tanto, eligiendo el número dos, nos redirige a la visualización completa del cajero, dejando en claro que solo se puede sacar dinero a partir de 50 bs y que su saldo actual es: 6400bs
Si marcaramos al principio la opción 1, podríamos visualizar el cajero, pero también un mensaje preestablecido por mi, diciendo "esta opción no está disponible, intente más tarde" ya que mi interés residía en un cajero que diera efectivo, y no saldo.
The cashier starts by asking between two simple options:
Do you want to check your balance or withdraw money?
Therefore, choosing the number two, redirects us to the complete visualization of the ATM, making it clear that you can only withdraw money from 50 bs and that your current balance is: 6400bs
If we marked option 1 at the beginning, we could visualize the ATM, but also a message preset by me, saying "this option is not available, try later" since my interest was in a cash dispenser, and not in a balance.
¿Cómo sacar dinero? || How to get money out?
Sacar dinero es muy fácil, ya que solo debe colocarse la cantidad deseada sobre la casilla blanca, y presionar el botón "extraer".
Luego aparecerán los billetes en los que se nos ha entregado nuestro dinero, y la cantidad de ellos. También el restante de dinero actual en el cajero automático.
Taking out money is very easy, as you only need to place the desired amount on the white box, and press the "take out" button.
Then, the bills in which our money has been given to us will appear, and the amount of them. Also the remaining money in the ATM.
Errores por arreglar. || Mistakes to be fixed.
El cajero presenta varios problemas, que al momento de notarlos, deje para después, y que ahora que retomaré el aprendizaje de este lenguaje, intentaré arreglar.
Uno de ellos es el siguiente; cuando pongo una cantidad mucho más alta que la disponible en el cajero, este le responde con un mensaje un poco chistoso, refiriéndose de manera graciosa al poco dinero disponible para la cantidad exigida. Hasta ahí, todo bien.
Sin embargo, esto también sucede con las cantidades mucho más pequeñas, pero que son impar, ya que, los billetes disponibles, no las reúnen de manera exacta.
The cashier presents several problems, which when I notice them, I leave for later, and now that I will resume learning this language, I will try to fix them.
One of them is the following; when I put in a much higher amount than the one available at the ATM, the ATM responds with a slightly funny message, referring in a funny way to the little money available for the amount demanded. So far, so good.
However, this also happens with much smaller amounts, but which are odd, since the available bills do not gather them exactly.
El segundo error, sucede luego de hacer una acción; como un retiro, o pedido de saldo, o intentar retirar una cantidad de dinero impar. Ya que, al hacer otra transacción, debería borrarse el anterior mensaje, pero no, este permanece intacto.
Y bueno, eso ha sido todo, espero que les haya gustado, y poder traerles más contenido de este tipo, más interesante y avanzado, y agradezco eternamente a mi amigo @mvl2304 quién demostró interés en este tema, y la razón por la que me anime a realizar este post.
¡saludos y se les quiere!
The second error occurs after you take an action, such as a withdrawal or balance request, or attempt to withdraw an odd amount of money. Since, when you make another transaction, the previous message should be deleted, but no, it remains intact.
And well, that was all, I hope you liked it, and to be able to bring you more content of this kind, more interesting and advanced, and I am eternally grateful to my friend @mvl2304 who showed interest in this topic, and the reason why he encouraged me to make this post.
greetings and love to you!
Traducción hecha en: DeepL
Todos los gif fueron realizados en PhotoScape.
¡Se despide Laura QCh! / Laura QCh says goodbye!