Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tried:

  let left = () => captureBtnLeftFunc($.Event())
  let right = () => captureBtnRightFunc($.Event())
  () => captureBtnRightFunc($.Event())
    setInterval(() => {
      console.log("Guessing");
      if (Math.random() < 0.5) {
          left()
      } else {
          right()
      }
  }, 1000)


The third line is a mispaste btw. You can delete it. ;)

Running this myself, the guesser is correct 46% of the time after 100 iterations.


What was the result? 50%?


Yes, when running over many iterations




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: