Skip to content

Instantly share code, notes, and snippets.

@brandonmack111
brandonmack111 / translate.js
Last active September 14, 2020 17:20 — forked from mgechev/translate.js
Translate.js
/*when I talk of 'efficiency' in the comments in this file, I just mean the shortest possible output. speed is not a factor as far as this code is concerned. */
const translate = (function () {
let symbols = {
A: '(([])[([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+!![])[+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]]+[])[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]',
a: '([]+![])[+!+[]]',
B: '((![])[([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+!![])[+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]]+[])[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]',
b: '([]+{})[+!+[]+!+[]]',
c: '([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]',