-
Notifications
You must be signed in to change notification settings - Fork 116
lauravelarde-caesar-cipher #77
base: master
Are you sure you want to change the base?
Conversation
|
@developerVilchez eslint OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¡Gran trabajo! Solo tengo algunos pequeños comentarios.
| <title>Cipher Cesar</title> | ||
| </head> | ||
| <body> | ||
| <h2 style='font-family:Tahoma;color:blueviolet'>The first word is encrypted and the second word is decrypted </h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Es mejor usar un archivo .css que un atributo style
| // Iteramos cada caracter del string | ||
| for (var i = 0; i < word.length; i++) { | ||
| // Almacenamos el codigo ASCII de cada caracter | ||
| var encrypter = word.charCodeAt(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El nombre 'encrypter' no describe que hace esta variable. Algo como letter o oldLetter sería un poco mejor.
| // Verificamos si las letras son mayusculas. | ||
| if (encrypter >= 65 && encrypter <= 90) { | ||
| // Aplicamos la formula para obtener el codigo ASCII | ||
| var letters = (encrypter - 65 + 33) % 26 + 65; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esta variable también sería nombrado mejor - como letter o newLetter (letters es plural, pero solo hay una letra en esta cadena)
| var word = prompt('Write a word to decode'); | ||
| function decipher(string) { | ||
| // Creamos una variable vacia para almacenar el string encriptado | ||
| var newString = ' '; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eliminar el espacio blanco dentro de las comillas
var newString = '';
| // Iteramos cada caracter del string | ||
| for (var i = 0; i < word.length; i++) { | ||
| // Almacenamos el codigo ASCII de cada caracter | ||
| var encrypter = word.charCodeAt(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tengo los mismos comentarios que los anteriores sobre los nombres de las variables en esta función
| @@ -0,0 +1,53 @@ | |||
| var word = prompt('Write a word to encrypt'); | |||
| function cipher(string) { | |||
| // Creamos una variable vacia para almacenar el string encriptado// | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indenta esta línea - los comentarios debe estar alineados con el código
No description provided.