This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Cifrado Cesar - Manuela Flores#81
Open
ManuelaFlores wants to merge 1 commit intoLaboratoria-learning:masterfrom
Open
Cifrado Cesar - Manuela Flores#81ManuelaFlores wants to merge 1 commit intoLaboratoria-learning:masterfrom
ManuelaFlores wants to merge 1 commit intoLaboratoria-learning:masterfrom
Conversation
|
@developerVilchez |
Collaborator
nicolethenerd
left a comment
There was a problem hiding this comment.
¡Gran trabajo! Solo tengo algunos pequeños comentarios.
| // convirtiendo la cadena de texto a mayúsculas | ||
| string = string.toUpperCase(); | ||
| // newPosition:almacenará las posiciones en el código ASCII de la cadena de texto | ||
| var newPosition = []; |
Collaborator
There was a problem hiding this comment.
Es posible combinar estos dos loops en uno:
var newString = '';
for (var i = 0; i < string.length; i++) {
// agregando las posiciones de las letras del string en codigo ASCII a newPosition
var newPosition = (string.charCodeAt(i) - 13 - 33) % 26 + 65);
newString += String.fromCharCode(newPosition);
}
| // concantenando las letras encriptadas a newString | ||
| newString += String.fromCharCode(newPosition[j]); | ||
| } | ||
| return alert('Su frase descifrada es ' + newString); |
Collaborator
There was a problem hiding this comment.
Es importante que la función devuelta una cadena. Si quieres usar un alert, usarlo antes del return:
alert('Su frase descifrada es ' + newString);
return newString;
| // convirtiendo la cadena de texto a mayúsculas | ||
| string = string.toUpperCase(); | ||
| // newPosition:almacenará las posiciones en el código ASCII de la cadena de texto | ||
| var newPosition = []; |
Collaborator
There was a problem hiding this comment.
Es posible combinar los dos loops en uno (vea abajo)
| newString += String.fromCharCode(newPosition[j]); | ||
| } | ||
| // retornando cadena de texto encriptada | ||
| return alert('Sufrase crifrada es ' + newString); |
Collaborator
There was a problem hiding this comment.
Es importante que la función devuelta una cadena. Si quieres usar un alert, usarlo antes del return:
alert('Su frase cifrada es ' + newString);
return newString;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Muchas gracias por revisar mi producto final , espero recibir feedback pronto :)