Live data from Hacker News

Show HN: Brain Frog – Can you be random enough for 11 lines of JavaScript?

brainfrog.lol

41–48 of 48 posts

Re: Show HN: Brain Frog – Can you be random enough for 11 lines of JavaScript?

#42

Looks like the leaderboard was hacked unfortunately. Fun little concept.

Fixed it. The fun part is there is no real protection against bots/AI and the code works as expected - they EASILY score 100. It's the humans that are too predictable.

Re: Show HN: Brain Frog – Can you be random enough for 11 lines of JavaScript?

#44

Earlier quoted context omitted.

because it doesn't? practice mode requires no login. if you want to play a ranked match then you'll need an account, how else could it work?

> how else could it work? Username+password. There is zero reason to require e-mail for account creation.

well, it's a personal preference thing then. I'd rather enter my email quickly and click a link than generate and store a new password for each website in a password manager

Re: Show HN: Brain Frog – Can you be random enough for 11 lines of JavaScript?

#47
post #34
post #29

pure random player: (async function(punch, delay) { async function sleep(ms) { return new Promise((resolve, _) => { setTimeout(resolve, ms) }) } for (let i = 0; i "cheating" player: (async function(oracle, punch, delay) { async function sleep(ms) { return new Promise((resolve, _) => { setTimeout(resolve, ms) }) } for (let i = 0; i is it possible to do any better? i haven't fully read frog/oracle code

Less fancy hack here, intercept the prediction function on every punch and force the frog to take the opposite side. const realPunch = punch; punch = function(myMove) { oracle.predictNextPunch = function() { return myMove === 'L' ? 'R' : 'L'; }; realPunch(myMove); };

brilliant!
Post reply on HN