Last active
August 29, 2015 13:57
-
-
Save MyGGaN/9829075 to your computer and use it in GitHub Desktop.
Code golf card position probability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By simulating one milion times you should determine the probability that two cards | |
of the same value lies directly next to each other one or more times in a shuffled | |
deck. You may only use standard libraries of the language of your choise. The | |
result should be printed, eg. "0.95", and then the program should end. You're not | |
allowed to start your program with any parameters. Eg. if you're using JavaScript | |
you may start your program like so: | |
> node mySolution.js | |
0.95 | |
It's not allowed to do | |
> node -p < mySolution.js | |
GLHF! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/oskarols/497a73f2d3001f401f38