Live data from Hacker News

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

brainfrog.lol

21–30 of 48 posts

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

#21

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.

[dead]

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

#23
If you want to see what a random distribution looks like:

  jot -r 100 0 1 | rs -t 10
I noticed my "fake randomness" is lacking long sequences of the same key. I feel like I'm "predictable" when I press the same key 5 times in a row, yet that happens a lot in a truly random distribution.

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

#28
post #22

Would be fairer if the frog occasionally got to throw a punch or two...

In the first round I struggled to notice if I missed. The frog punching back would be a good indicator. And I wouldn't feel so guilty for punching a pacifist frog.

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

#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
Post reply on HN