Parcourir la source

Implement translator map in JS

close #2

A generator script will modify skript.js with spacebar and keys
Steve Thielemann il y a 6 mois
Parent
commit
65f692bd4b
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8 1
      skript.js

+ 8 - 1
skript.js

@@ -6,8 +6,15 @@
 // ==/UserScript==
 
 // Configure me!
-let card = {".": "", "a": "b", "b": "a", "c": "d", "d": "c", "e": "f", "f": "e", "g": "h", "h": "g", "i": "j", "j": "i", "l": "m", "m": "l", "n": "o", "o": "n", "p": "q", "q": "p", "r": "s", "s": "r", "t": "u", "u": "t", "v": "y", "y": "v", "x": "z", "z": "x", "0": "1", "1": "0", "2": "3", "3": "2", "4": "5", "5": "4", "6": "7", "7": "6", "8": "9", "9": "8"};
 let spacebar = "test";
+let keys = "ijklmnopqrstuvwxyz0123456789abcdefgh".split("");
+
+// Whoa, below this line is the code, change at your own peril
+const basic = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
+let card = basic.reduce((c, e, i) => {
+    c[[e]] = keys[i];
+    return c;
+}, {".": ""});
 
 addCSS = (css) => {
   var head, obj;