News for hackers. Stuff that matters.
Re:Is this prime? by mfoy_ on Tuesday March 08, 2016 @02:54PM (#11248017)
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!)
Re:Is this prime? by andrewstuart2 on Tuesday March 08, 2016 @09:44PM (#11250525)
Why 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();
Re:Is this prime? by gfmio on Tuesday March 08, 2016 @05:36PM (#11249361)
24607 (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();
Re:Is this prime? by malka on Tuesday March 08, 2016 @05:14PM (#11249222)
this. IF you cheat, you might as well take the easiest path of all :D
Re:Is this prime? by rMBP on Tuesday March 08, 2016 @05:41PM (#11249378)
"Inspect Element"