Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Woah, neat. Is this like, a Markov chain?by andai
- a variation of Aaronson Oracleby AlexanderZ
- 46 and that was my ceiling. frogs smarter than me.by momoraul
- plot twist: there is no frog, it's all your internal biases (what you do after success/failure)by AlexanderZ
- Curious how a couple people got >100 hits on 100 punchesby subarctic
- some people went on to explore the code limits, hehe. it's been fixedby AlexanderZ
- By the way, there is an ios app: https://apps.apple.com/app/id6755528165by AlexanderZ
- Would be fairer if the frog occasionally got to throw a punch or two...by brtkwr
- On my todo list: when the frog wins, it runs towards you and knocks you out, hahaby AlexanderZ
- 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.by pjio
- That was fun, got up to 79 :)by sscaryterry
- practice mode? the record for ranked matches is 64by AlexanderZ
- 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.by krussikas
- If you want to see what a random distribution looks like:
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.jot -r 100 0 1 | rs -t 10by IdiotSavage - 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).by AlexanderZ
- I am briefly in the top ten after completely misunderstanding the rules niceeby user-
- what's your score?by AlexanderZ
- The ultimate unpredictability.by thih9
- You should make one where you can play against the branch predictors of various processors.by mike_hock
- I was just about to comment the same! Sadly, branch predictors are incredibly well guarded secrets, mostly.by rllj
- pure random player:
"cheating" 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)
is it possible to do any better? i haven't fully read frog/oracle code(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)by escanor - it is:
(async function(oracle, punch, delay) { async function sleep(ms) { return new Promise((resolve, _) => { setTimeout(resolve, ms) }) } for (let i = 0; i < 100; i++) { const state = oracle._state const block = oracle.predictNextPunch() oracle._state = state punch(block === 'L' ? 'R' : 'L') await sleep(delay) } })(oracle, punch, 150)by escanor - 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);by emrtnn - 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.by hash0