Skip to content

Commit

Permalink
Reto mouredev#15- js
Browse files Browse the repository at this point in the history
  • Loading branch information
giovanyosorio committed Nov 14, 2023
1 parent b584c3b commit 79ff705
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
49 changes: 49 additions & 0 deletions Retos/Reto #15 - AUREBESH [Fácil]/javascript/giovanyosorio.js
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'));

0 comments on commit 79ff705

Please sign in to comment.