The game Final Fantasy X has a fictional language called “Al Bhed” which is just a letter-swapped version of the english language. I think it would be fun if there was a command that could “translate” a user’s input text into Al Bhed by replacing each letter of the query, and maybe another command to translate text from Al Bhed into English as well.
I thought that that this might have been something that somebody has done before, because Final Fantasy is pretty popular, but I can’t find any such thing done using Nightbot. I did find some source code for a fancy program that translates both directions using JavaScript, but I’m not sure if it’s possible to make this work with Nightbot. Has anybody ever done something like this?
ooo, that sounds fun… it could go something like this…
$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]});output)
for english to al bhed… and to go the other way…
$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]});output)
um, actually… i found a bug in it with my own testing… here’s a fixed version…
$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]?a[e.indexOf(x)]:x});output)
for english to al bhed… and the other way…
$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjQqFfOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]?e[a.indexOf(x)]:x});output)
the original ones would only work for letters and spaces… if u added any symbols, like commas, questionmarks or exclamations it would replace them with “undefined”… this new version puts the symbols in place as they were
Small addendum in case any future travelers come across this thread:
A couple of (relatively unimportant) letters were swapped in the Al Bhed alphabet. Here is the corrected code:
English to Al Bhed:
$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]});output)
Al Bhed to English:
$(eval let input=`$(query)`.split(``),e=` AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=` YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]});output)
True!!! Whoops. I adjusted your original one on accident, I’ll sort that out today! Yeah i think that github had it wrong. It was just “W” and “X” (in English) that were swapped
$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=a[e.indexOf(x)]?a[e.indexOf(x)]:x});output)
Al Bhed to English:
$(eval let input=`$(query)`.split(``),e=`AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz`,a=`YyPpLlTtAaVvKkRrEeZzGgMmSsHhUuBbXxNnCcDdIiJjFfQqOoWw`,output=``;input.forEach(x=>{output+=e[a.indexOf(x)]?e[a.indexOf(x)]:x});output)