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

subiendo identación app.js #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZulemaAB
Copy link

@ZulemaAB ZulemaAB commented Nov 7, 2017

hola,
muchas gracias por revisar mi trabajo.

@RuthSalvador
Copy link
Member

Hola @ZulemaAB está pendiente un detalle para poder enviar tu pull request a los googlers,
te dejo tu código según la guía de estilo, recuerda usar el eslint.
Por favor actualiza el tuyo y me confirmas.

// Primero creamos un string asignandole el nombre de abecedario->'alphabet'
var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// transformaremos el string en un array.
var letter = alphabet.split('');
var newLetter = '';

// se creara  una nueva variable "word" donde se ingresara la frase o palabra.
do {
  var word = prompt('Ingrese texto');
} while (word.length === 0 || !isNaN(word));
for (var i = 0;i < word.length;i++) {
// word[i]- es el elemento de la posicion i
// charAt(i).- es para sacar un carecter de la palabra ingresada.
  num = (word.charAt(i)).charCodeAt();

  position = letter.indexOf(word.charAt(i));
  newposition = (position + num) % 26;
  newLetter += letter[newposition - 1];
}

// document.write(word[i]);
document.write(newLetter);
// document.write(letter) ;
function cipher(letter) {
}
function decipher(num) {
}

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.

None yet

2 participants