Skip to content

Commit

Permalink
Merge pull request #3398 from edu2122/eduardo
Browse files Browse the repository at this point in the history
Reto #0 - JavaScript
  • Loading branch information
Roswell468 authored May 12, 2023
2 parents c1c5398 + 23a672f commit 5a23ab1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
*/

for(let i =1; i<=100;i++) {
if (i % 3 === 0) {
if (i % 3 === 0 && i % 5 ===0) {
console.log('fizz');
} else if (i % 5 === 0) {
} else if (i % 3 === 0) {
console.log('buzz');
} else if (i % 3 === 0 && i % 5 ===0){
} else if (i % 5 === 0){
console.log('fizzbuzz');
} else {console.log(i)};
}
};
62 changes: 62 additions & 0 deletions Retos/Reto #1 - EL LENGUAJE HACKER [Fácil]/javascript/edu2122.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Escribe un programa que reciba un texto y transforme lenguaje natural a
* "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje
* se caracteriza por sustituir caracteres alfanuméricos.
* - Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/)
* con el alfabeto y los números en "leet".
* (Usa la primera opción de cada transformación. Por ejemplo "4" para la "a")
*/

// Solución:

function transformToHackerLanguage(chain) {
const languageHacker = {
a: '4',
b: 'I3',
c: '[',
d: ')',
e: '3',
mi: '3',
f: '|=',
g: '&',
h: '#',
i: '1',
j: ',_l',
k: '>|',
l: '1',
m: "/\/\/",
n: '^/',
o: '0',
p: '|*',
q: '(_,)',
r: 'I2',
s: '5',
t: '7',
u: '(_)',
v: '\/',
w: '\/\/',
x: '><',
y: 'j',
z: '2',
1: 'L',
2: 'R',
3: 'E',
4: 'A',
5: 'S',
6: 'b',
7: 'T',
8: 'B',
9: 'g',
0: 'o'
};

let chainMinuscule = chain.toLowerCase();
chainMinuscule.split('').forEach((character) => {
if (languageHacker[character]) {
console.log(chainMinuscule);
chainMinuscule = chainMinuscule.replace(character, languageHacker[character]);
};
});
return (chainMinuscule);
};
console.log(transformToHackerLanguage('1231'));

0 comments on commit 5a23ab1

Please sign in to comment.