Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Conversation

@lauraVelarde
Copy link

No description provided.

@Gabx04
Copy link

Gabx04 commented Nov 10, 2017

@developerVilchez eslint OK

Copy link
Collaborator

@nicolethenerd nicolethenerd left a 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>
Copy link
Collaborator

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);
Copy link
Collaborator

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;
Copy link
Collaborator

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 = ' ';
Copy link
Collaborator

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);
Copy link
Collaborator

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//
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants