38 comments

[ 3.7 ms ] story [ 77.4 ms ] thread
46 and that was my ceiling. frogs smarter than me.
plot twist: there is no frog, it's all your internal biases (what you do after success/failure)
Free?!. Is there a "call us" SSO enabled plan?
Woah, neat. Is this like, a Markov chain?
How many pixels wide is the hit zone?
Bam! 50 on the first try. Fun.
nice! try playing it the first thing every morning, it really wakes up your brain
Why does a silly little online game need my email to send a one-time login code? What a strange experience
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
I got 50 hits in 100 tries. That being said, I did not particularly like hitting that poor frog :'( Yes, I am the kind of player who would never choose the rude option when talking to an NPC.
(comment deleted)
I am briefly in the top ten after completely misunderstanding the rules nicee
The ultimate unpredictability.
"To confuse your enemy, you must first confuse yourself"

  - Some reddit guy
Would be fairer if the frog occasionally got to throw a punch or two...
On my todo list: when the frog wins, it runs towards you and knocks you out, haha
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.
With Brain Frog I went even further - it doesn't actually check L/R. Instead, it checks what you do after a landed/blocked punch (some people tend to switch after a block, others insist on hitting the same side until they land a hit).
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.
(comment deleted)
You should make one where you can play against the branch predictors of various processors.
pure random player:

  (async function(punch, delay) {
    async function sleep(ms) {
      return new Promise((resolve, _) => {
        setTimeout(resolve, ms)
      })
    }
    
    for (let i = 0; i < 100; i++) {
      punch(['L', 'R'][(Math.random() * 2) | 0])
      await sleep(delay)
    }
  })(punch, 150)
  
"cheating" player:

  (async function(oracle, punch, delay) {
    async function sleep(ms) {
      return new Promise((resolve, _) => {
        setTimeout(resolve, ms)
      })
    }
    
    for (let i = 0; i < 100; i++) {
      punch((i + 1) < oracle.minForPrediction ? ['L', 'R'][(Math.random() * 2) | 0] : oracle.predictNextPunch() === 'L' ? 'R' : 'L')
      
      await sleep(delay)
    }
  })(oracle, punch, 150)

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);
};
Leaderboard has been overtaken :(
Fixed it. Elon Musk had too much time on his hands
Curious how a couple people got >100 hits on 100 punches
some people went on to explore the code limits, hehe. it's been fixed
I once coded a rock-paper-scissors game that you can play against a tree based matcher/learner, with symmetry between the options accounted for. Pretty similar idea-wise. To be honest, it was pretty hard to get a better than random score.