forked from mouredev/retos-programacion-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b584c3b
commit 79ff705
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"githubPullRequests.ignoredPullRequestBranches": [ | ||
"main" | ||
] | ||
} |
49 changes: 49 additions & 0 deletions
49
Retos/Reto #15 - AUREBESH [Fácil]/javascript/giovanyosorio.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Crea una función que sea capaz de transformar Español al lenguaje básico del universo | ||
* Star Wars: el "Aurebesh". | ||
* - Puedes dejar sin transformar los caracteres que no existan en "Aurebesh". | ||
* - También tiene que ser capaz de traducir en sentido contrario. | ||
* | ||
* ¿Lo has conseguido? Nómbrame en twitter.com/mouredev y escríbeme algo en Aurebesh. | ||
* | ||
* ¡Que la fuerza os acompañe! | ||
*/ | ||
|
||
const aurebesh = { | ||
'A': 'Aurek', | ||
'B': 'Besh', | ||
'C': 'Cresh', | ||
'D': 'Dorn', | ||
'E': 'Esk', | ||
'F': 'Forn', | ||
'G': 'Grek', | ||
'H': 'Herf', | ||
'I': 'Isk', | ||
'J': 'Jenth', | ||
'K': 'Krill', | ||
'L': 'Leth', | ||
'M': 'Mern', | ||
'N': 'Nern', | ||
'O': 'Osk', | ||
'P': 'Peth', | ||
'Q': 'Qek', | ||
'R': 'Resh', | ||
'S': 'Senth', | ||
'T': 'Trill', | ||
'U': 'Usk', | ||
'V': 'Vev', | ||
'W': 'Wesk', | ||
'X': 'Xesh', | ||
'Y': 'Yirt', | ||
'Z': 'Zerek' | ||
} | ||
|
||
|
||
function translateToAurebesh(text) { | ||
return text.split('').map(char => aurebesh[char.toUpperCase()] || char).join(''); | ||
} | ||
|
||
|
||
|
||
console.log(translateToAurebesh('Hola Mundo')); | ||
|