Browse Source

Optimize "j", "h", "p", "q", "x"

Alexander I. Zaytsev 11 years ago
parent
commit
0cd32d0923
2 changed files with 61 additions and 61 deletions
  1. 17 17
      jsfuck.js
  2. 44 44
      output.txt

+ 17 - 17
jsfuck.js

@@ -30,23 +30,23 @@
     'e':   '("true")[3]',
     'f':   '("false")[0]',
     'g':   '(+false+[false]+String)[20]',
-    'h':   '(+(17))["toString"](20)',
+    'h':   '(+(101))["toString"](21)[1]',
     'i':   '([false]+undefined)[10]',
-    'j':   '(+(19))["toString"](20)',
+    'j':   '(+(40))["toString"](21)[1]',
     'k':   '(+(20))["toString"](21)',
     'l':   '("false")[2]',
     'm':   '(Number+"")[11]',
     'n':   '("undefined")[1]',
     'o':   '(true+[]["filter"])[10]',
-    'p':   '(+(25))["toString"](30)',
-    'q':   '(+(26))["toString"](30)',
+    'p':   '(+(211))["toString"](31)[1]',
+    'q':   '(+(212))["toString"](31)[1]',
     'r':   '("true")[1]',
     's':   '("false")[3]',
     't':   '("true")[0]',
     'u':   '("undefined")[0]',
     'v':   '(+(31))["toString"](32)',
     'w':   '(+(32))["toString"](33)',
-    'x':   '(+(33))["toString"](34)',
+    'x':   '(+(101))["toString"](34)[1]',
     'y':   '(NaN+[Infinity])[10]',
     'z':   '(+(35))["toString"](36)',
 
@@ -196,12 +196,12 @@
       return done;
     }
 
-    function mappingReplacer(a, b){
+    function mappingReplacer(a, b) {
       return b.split("").join("+");
     }
 
     function valueReplacer(c) {
-      return missing[c] ? c : MAPPING[c];  
+      return missing[c] ? c : MAPPING[c];
     }
 
     for (all in MAPPING){
@@ -234,18 +234,18 @@
 
       var replacement = MAPPING[c];
 
-      if (replacement){
+      if (replacement) {
         output.push(MAPPING[c]); 
       } else {
-
-        replacement =
-          "([]+[])[" + encode("constructor") + "]" +
-          "[" + encode("fromCharCode") + "]" +
-          "(" + encode(c.charCodeAt(0) + "") + ")";
- 
-        output.push(replacement);
-        MAPPING[c] = replacement;
-      }
+     
+            replacement =
+              "([]+[])[" + encode("constructor") + "]" +
+              "[" + encode("fromCharCode") + "]" +
+              "(" + encode(c.charCodeAt(0) + "") + ")";
+     
+            output.push(replacement);
+            MAPPING[c] = replacement;
+          }
     });
 
     output = output.join("+");

+ 44 - 44
output.txt

@@ -1,14 +1,14 @@
 ` ` 186
-`!` 12956
+`!` 12952
 `"` 877
-`#` 12965
-`$` 12970
-`%` 6629
-`&` 12980
-`'` 12985
+`#` 12961
+`$` 12966
+`%` 6627
+`&` 12976
+`'` 12981
 `(` 185
 `)` 186
-`*` 12964
+`*` 12960
 `+` 75
 `,` 628
 `-` 178
@@ -24,45 +24,45 @@
 `7` 39
 `8` 44
 `9` 49
-`:` 10950
-`;` 15165
+`:` 10941
+`;` 15161
 `<` 368
 `=` 873
 `>` 374
-`?` 12967
-`@` 12964
+`?` 12963
+`@` 12960
 `A` 922
 `B` 923
-`C` 6635
-`D` 7140
-`E` 6641
+`C` 6633
+`D` 7138
+`E` 6639
 `F` 1075
-`G` 12995
-`H` 13000
+`G` 12991
+`H` 12996
 `I` 75
-`J` 12974
-`K` 15170
-`L` 13135
-`M` 12981
+`J` 12970
+`K` 15166
+`L` 13131
+`M` 12977
 `N` 21
-`O` 12972
-`P` 12969
-`Q` 12971
-`R` 12975
+`O` 12968
+`P` 12965
+`Q` 12967
+`R` 12971
 `S` 925
-`T` 12985
-`U` 12990
-`V` 12995
-`W` 13000
-`X` 13005
-`Y` 13010
-`Z` 12979
-`[` 3723
-`\` 13140
-`]` 12986
-`^` 12989
-`_` 12977
-``` 12974
+`T` 12981
+`U` 12986
+`V` 12991
+`W` 12996
+`X` 13001
+`Y` 13006
+`Z` 12975
+`[` 3716
+`\` 13136
+`]` 12982
+`^` 12985
+`_` 12973
+``` 12970
 `a` 20
 `b` 2216
 `c` 181
@@ -70,25 +70,25 @@
 `e` 30
 `f` 18
 `g` 935
-`h` 2245
+`h` 2238
 `i` 34
-`j` 2255
+`j` 2242
 `k` 2220
 `l` 24
 `m` 923
 `n` 23
 `o` 182
-`p` 2244
-`q` 2249
+`p` 2249
+`q` 2253
 `r` 21
 `s` 29
 `t` 19
 `u` 21
 `v` 2236
 `w` 2245
-`x` 2255
+`x` 2257
 `y` 91
 `z` 2275
 `{` 190
-`|` 13150
-`}` 12996
+`|` 13146
+`}` 12992