HNHacker News
TopNewBestAskShowJobs

emrtnn

1 karma · joined June 24, 2026

submissionscomments
emrtnn··on Show HN: Brain Frog – Can you be random enough for 11 lines of JavaScript?
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);
};