Comment

Comment by tlrobinson

It had to be done:

    setInterval(function() {
      var n = parseInt(document.querySelector("#n").textContent);
      document.querySelector(is_prime(n) === "prime" ? "#yes" : "#no").click();
    }, 0);
    
    document.querySelector("#start").click();
EDIT: replaced my isPrime with the one already in the game.

EDIT 2: There appears to be some sort of increasing delay (pretty sure it's not just `is_prime` being slow) starting around 500 points. Maybe the game itself trying to compute primes?

parent tlrobinson 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton