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 codeI am briefly in the top ten after completely misunderstanding the rules nicee
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.Would be fairer if the frog occasionally got to throw a punch or two...
46 and that was my ceiling. frogs smarter than me.
Looks like the leaderboard was hacked unfortunately. Fun little concept.
Just wanted to give the little guy a hug
Leaderboard has been overtaken :(
Why does a silly little online game need my email to send a one-time login code? What a strange experience
Free?!. Is there a "call us" SSO enabled plan?
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.