Skip to content

Instantly share code, notes, and snippets.

@niinpatel
Created June 13, 2018 06:00
Show Gist options
  • Save niinpatel/cd911b23bcf86cda434b54a1515f4b92 to your computer and use it in GitHub Desktop.
Save niinpatel/cd911b23bcf86cda434b54a1515f4b92 to your computer and use it in GitHub Desktop.
console.log(simulateGame(1000, toSwitch = true)); // play 1000 times, switch the door. Print how many times won.
console.log(simulateGame(1000, toSwitch = false)); // play 1000 times, don't switch the door. Print how many times won.
/* Output of first line will be close to 666 while that of second will be close to 333. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment