We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I believe this algorithm is correct, and runs in constant average time
void openPlatonic( int amount, int* blessings ) { std::random_device rd; double const weights[] = { 13200.0, 13200.0, 13200.0, 13200.0, 396.0, 1.0, 1.0, 1.0, 1.0 }; double sum = 40000.0; for( int i = 0; i < 8; ++ i) { int n = std::binomial_distribution<int>( amount, weights[i] / sum)(rd); blessings[i] += n; amount -= n; sum -= weights[i]; } }
It would need to be ported from C++ to JS, including an implementation of binomial_distribution.
binomial_distribution
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I believe this algorithm is correct, and runs in constant average time
It would need to be ported from C++ to JS, including an implementation of
binomial_distribution
.The text was updated successfully, but these errors were encountered: