Skip to content

Commit

Permalink
Merge pull request #3559 from aldogodoy/main
Browse files Browse the repository at this point in the history
Reto #1 - javascript
  • Loading branch information
Roswell468 authored May 24, 2023
2 parents 465f54e + cb3195d commit 388e75d
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function alphabet (letter) {
const alfabeto = {
a: "4",
b: "I3",
c: "©",
d: "|)",
e: "€",
f: "ƒ",
g: "9",
h: "#",
i: "1",
j: "]",
k: "1<",
l: "£",
m: "IVI",
n: "И",
o: "ø",
p: "|*",
q: "ℚ",
r: "Я",
s: "$",
t: "7",
u: "µ",
v: "▼",
w: "ω",
x: "×",
y: "¥",
z: "2",
' ': ' '
};
return letter in alfabeto ? alfabeto[letter] : ' ';
}
function leet(word) {
const words = [...(word).trim().toLowerCase()]
let auxWords = [];
for(let i = 0; i < words.length; i++ ){
auxWords.push(alphabet(words[i]))
}
return auxWords.join(' ')
}
leet('El lenguaje hacker');

0 comments on commit 388e75d

Please sign in to comment.