5 ms·
Show HN: Brain Frog – Can you be random enough for 11 lines of JavaScript?
- sscaryterry 4mo agoThat was fun, got up to 79 :)
- AlexanderZ 4mo agopractice mode? the record for ranked matches is 64
- sscaryterry 4mo agoYes
- momoraul 4mo ago46 and that was my ceiling. frogs smarter than me.
- AlexanderZ 3mo agoplot twist: there is no frog, it's all your internal biases (what you do after success/failure)
- uberex 4mo agoFree?!. Is there a "call us" SSO enabled plan?
- andai 4mo agoWoah, neat. Is this like, a Markov chain?
- AlexanderZ 3mo agoa variation of Aaronson Oracle
- jv22222 4mo agoHow many pixels wide is the hit zone?
- AlexanderZ 3mo agoyou don't have to aim
- vyrotek 3mo agoBam! 50 on the first try. Fun.
- AlexanderZ 3mo agonice! try playing it the first thing every morning, it really wakes up your brain
- digitalWestie 3mo agoJust wanted to give the little guy a hug
- ozyschmozy 3mo agoWhy does a silly little online game need my email to send a one-time login code? What a strange experience
- AlexanderZ 3mo agobecause 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?
- ozyschmozy 3mo agoPractice mode also has a popup telling you what to do which seems to negate the point of the game?
- AlexanderZ 3mo agoit's the coach mode telling you which biases you have so you can fix them in a ranked match
- applfanboysbgon 3mo ago> how else could it work? Username+password. There is zero reason to require e-mail for account creation.
- xorgun 3mo ago[dead]
- AlexanderZ 3mo agowell, 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
- hash0 3mo agoI 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.
- deleted 3mo ago[deleted]
- user- 3mo agoI am briefly in the top ten after completely misunderstanding the rules nicee
- thih9 3mo agoThe ultimate unpredictability.
- freakynit 3mo ago"To confuse your enemy, you must first confuse yourself" - Some reddit guy
- AlexanderZ 3mo agowhat's your score?
- brtkwr 3mo agoWould be fairer if the frog occasionally got to throw a punch or two...
- pjio 3mo agoIn 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.
- AlexanderZ 3mo agoOn my todo list: when the frog wins, it runs towards you and knocks you out, haha
- IdiotSavage 3mo agoIf 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.
- AlexanderZ 3mo agoWith 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).
- jmpavlec 3mo agoLooks like the leaderboard was hacked unfortunately. Fun little concept.
- AlexanderZ 3mo agoFixed 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.
- deleted 3mo ago[deleted]
- mike_hock 3mo agoYou should make one where you can play against the branch predictors of various processors.
- rllj 3mo agoI was just about to comment the same! Sadly, branch predictors are incredibly well guarded secrets, mostly.
- escanor 3mo agopure 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
- escanor 3mo agoit 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)
- emrtnn 3mo agoLess 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); };
- escanor 3mo agobrilliant!
- ramon156 3mo agoLeaderboard has been overtaken :(
- AlexanderZ 3mo agoFixed it. Elon Musk had too much time on his hands
- ramon156 3mo agoKudos!
- subarctic 3mo agoCurious how a couple people got >100 hits on 100 punches
- AlexanderZ 3mo agosome people went on to explore the code limits, hehe. it's been fixed
- krussikas 3mo agoI 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.
- AlexanderZ 3mo agoBy the way, there is an ios app: https://apps.apple.com/app/id6755528165 https://apps.apple.com/app/id6755528165