Hacker News new | ask | show | jobs
by jayvanguard 4218 days ago
Re: first pick, right it doesn't affect things, but here is the code anyways using Ruby Array.sample().

  open_door = host_opts.sample
  choice2 = [0, 1, 2] - [choice1, open_door]  # switch
  if open_door == car then
As for the denominator, good point.