var minValue = 1E-8, maxLoss = 10000000000000, aimedProfit = 10, maxOps = 500000000000000, endResult = 0, ops = 0, bet = function (a, b, c) { var seed = window.document.getElementById('next_client_seed').value; $.get("?op=double_your_btc&m=" + (b ? "lo" : "hi") + "&stake=" + a + "&multiplier=2&jackpot=0&client_seed=" + seed, function (d) { d = d.split(":"); $("#balance").html(d[3]); c(a, b, "w" === d[1]) }) }, martingale = function (a, b, c) { c || a >= maxLoss && 0 !== maxLoss ? (b = !b, newValue = minValue) : newValue = 2 * a; endResult = c ? endResult + a : endResult - a; console.log((c ? "+" : "-") + a); ops++; (ops < maxOps || 0 === maxOps) && (endResult < aimedProfit || 0 === aimedProfit) ? bet(newValue, b, martingale) : (console.log("Martingale finished in " + ops + " operations!"), console.log("Result: " + endResult)) }; martingale(minValue, !1, !1);