4 ms·
If I click start, then paste some quick and dirty browser automation in the console: function c(){is_prime(document.getElementById('n').textContent)==="prime
by tyingq 5y ago
If I click start, then paste some quick and dirty browser automation in the console:
function c(){is_prime(document.getElementById('n').textContent)==="prime"?yes.click():no.click();window.setTimeout(c,1)};c()
My old laptop can guess right 16k times and get up to 4172973243025599, but then the http post to do the stats (record.php) bombs with a MySql error "Out of range value for column 'end' at row 1" :)
- standyro 5y agoI guess it wouldn’t be HN if your side project’s database didn’t crash because you didn’t choose the right data type, haha. Looks like it gracefully failed though, could be worse. I’m afraid that the stats page is too easy to DDOS though.
- dexterhaslem 5y agolook at the entries lol, looks like it had an injection heyday back when first released
- lifthrasiir 5y agoThat made me wonder how the game determines if the number is a prime or not. Turns out it's the Miller-Rabin test with a deterministic variant used for the range (up to 2^53) the game supports. I don't know why the game internally uses a bigint implementation while only supporting numbers up to 2^53 though...