Browse Source

Optimize `[` and `]`
Make `{` and `}` more readable. This does not affect lengths

Alexander I. Zaytsev 11 years ago
parent
commit
535ddde577
2 changed files with 5 additions and 5 deletions
  1. 3 3
      jsfuck.js
  2. 2 2
      output.txt

+ 3 - 3
jsfuck.js

@@ -101,15 +101,15 @@
     '>':   '("")["italics"]()[2]',
     '?':   '(RegExp()+"")[2]',
     '@':   USE_CHAR_CODE,
-    '[':   '(GLOBAL+"")[0]',
+    '[':   '(Function("return{}")()+"")[0]',
     '\\':  USE_CHAR_CODE,
-    ']':   '(GLOBAL+"")["slice"]((+(.+[0000000001])+"")[2]+1)',
+    ']':   '(Function("return{}")()+"")["slice"]("-1")',
     '^':   USE_CHAR_CODE,
     '_':   USE_CHAR_CODE,
     '`':   USE_CHAR_CODE,
     '{':   '(NaN+[]["filter"])[21]',
     '|':   USE_CHAR_CODE,
-    '}':   '([]["filter"]+"")["slice"]((+(.+[0000000001])+"")[2]+1)',
+    '}':   '([]["filter"]+"")["slice"]("-1")',
     '~':   USE_CHAR_CODE
   };
 

+ 2 - 2
output.txt

@@ -57,9 +57,9 @@
 `X` 6613
 `Y` 6618
 `Z` 6584
-`[` 2931
+`[` 1640
 `\` 6713
-`]` 3334
+`]` 2043
 `^` 6594
 `_` 6582
 ``` 6582