Skip to content

Instantly share code, notes, and snippets.

/.js

Created June 30, 2016 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7d046f1c5b207342c1ea041a7d2262d6 to your computer and use it in GitHub Desktop.
Save anonymous/7d046f1c5b207342c1ea041a7d2262d6 to your computer and use it in GitHub Desktop.
var a = "60o0749460o07134482";
//var b= parseInt(a, 10);
G = function(a, b) {
var c = function(a) {
for (var b, c = [], d = 3, e = function(a) {
return a >= "0" && "9" >= a ? parseInt(a, 10) : a.charCodeAt(0) - "a".charCodeAt(0) + 10
}, f = function(a, b) {
var c, d, f, g, h;
//c =e 函数
return c = e(a[b]), d = e(a[b + 1]), d = 15 & d, f = (12 & c) >> 2, g = (2 & c) > 0, h = (1 & c) > 0, {
value: d, //d=e 函数
winner: f, // f = (12 & c)
playerPair: g, //g=(2&c)
bankerPair: h // h = (1 & c) > 0
}
},
g = 0; g < a.length - 1; g += 2)
b = f(a, g), b.winner !== d ? c.push(b) : c = [];
return c
};
if (!a || void 0 === b) return [];
switch (a) {
case "7bal":
case "bal":
return c(b);
case "rol":
case "rofl":
return b.split(";").map(function(a) {
return {
result: a
}
});
default:
return b
}
}
document.write(G("bal", a));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment