pyengwoei
2016-06-30 16:22:55 +08:00
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));