-
Notifications
You must be signed in to change notification settings - Fork 116
Añadiendo arreglos con EsLint #80
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { | ||
| "parserOptions": { | ||
| "ecmaVersion": 6 | ||
| }, | ||
| "rules": { | ||
| "keyword-spacing": 1, | ||
| "space-before-function-paren": [1, "never"], | ||
| "eqeqeq": 1, | ||
| "space-infix-ops": 1, | ||
| "comma-spacing": 1, | ||
| "brace-style": 1, | ||
| "no-multiple-empty-lines": 1, | ||
| "camelcase": 1, | ||
| "func-call-spacing": 1, | ||
| "key-spacing": 1, | ||
| "semi": 1, | ||
| "no-floating-decimal": 1, | ||
| "no-multi-spaces": 1, | ||
| "object-property-newline": 1, | ||
| "padded-blocks": [1, "never"], | ||
| "space-before-blocks": 1, | ||
| "space-in-parens": 1, | ||
| "spaced-comment": 1, | ||
| "quotes": [1, "single"], | ||
| "id-length": [1, { "exceptions": ["i", "j", "x"] }], | ||
| "indent": [1, 2], | ||
| "no-array-constructor": 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| var phrase = prompt('Ingresa la frase a decodificar'); | ||
| var newarray = []; | ||
|
||
| var unicode = []; | ||
|
|
||
| function cipher(str) { | ||
|
||
| var array = phrase.split(''); | ||
| for (i = 0; i <= array.length - 1;i++) { | ||
|
||
| unicode.push(phrase.charCodeAt(i)); | ||
| } | ||
|
|
||
| for (i = 0; i <= unicode.length - 1; i++) { | ||
| newarray.push((unicode[i] - 65 + 33) % 26 + 65); | ||
|
||
| } | ||
| return newarray; | ||
|
||
| } | ||
|
||
| var arr = cipher(phrase); | ||
|
||
| function decipher(array2) { | ||
|
||
| var arr2 = []; | ||
| for (i = 0; i <= array2.length - 1; i++) { | ||
| arr2.push(String.fromCharCode(array2[i])); | ||
| return arr2; | ||
|
||
| } | ||
| if (isNaN(phrase) === false) { | ||
|
||
| 'Ingrese una frase por favor'; | ||
| } else { | ||
|
||
| } | ||
| } | ||
| decipher(arr); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Cifrado Cesar</title> | ||
| </head> | ||
| <body> | ||
| <script type="text/javascript" src="JS/app.js"></script> | ||
| </body> | ||
|
|
||
| </html> |
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.
newarray -> newArray
https://github.com/Laboratoria/js-style-guide#usa-nombres-descriptivos-en-inglés-y-en-el-formato-camelcase