lauravelarde-caesar-cipher#77
lauravelarde-caesar-cipher#77lauraVelarde wants to merge 1 commit intoLaboratoria-learning:masterfrom
Conversation
|
@developerVilchez eslint OK |
nicolethenerd
left a comment
There was a problem hiding this comment.
¡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.
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.
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.
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.
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.
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.
indenta esta línea - los comentarios debe estar alineados con el código
No description provided.