4 ms·
Or, do away with the whole "checking" nonsense: game.check = function (answer) { this.streak += 1; this.next_n(); } setInterval(function() { d
by mfoy_ 11y ago
Or, do away with the whole "checking" nonsense:
game.check = function (answer) {
this.streak += 1;
this.next_n();
}
setInterval(function() {
document.querySelector("#yes").click();
}, 0);
document.querySelector("#start").click();
(High score of 15,000!)
- malka 11y agothis. IF you cheat, you might as well take the easiest path of all :D
- rMBP 11y ago"Inspect Element"
- gfmio 11y ago24607 (with the cheat), 621 (without) :D Fun evening challenge :P function isPrime(n){ if ((n<=1) || (!n % 2)) { return false; } for (var k = 3; k < Math.round(Math.sqrt(n) + 0.5); k = k+2) { if (n % k == 0) { return false; } } return true; } var nSpan = $("span#n") var yesButton = $("button#yes"); var noButton = $("button#no"); var body = $("body"); function solve(){ if (isPrime(parseInt(nSpan.innerHTML)) { yesButton.click(); } else { noButton.click(); } if (body.className != "end") { setTimeout(solve,0); } } solve();
- andrewstuart2 11y agoWhy only add 1? Why add anything at all? game.check = function() { this.streak = Number.MAX_VALUE; this.next_n(); }; document.querySelector("#start").click(); document.querySelector("#yes").click();