Commit 0c4946a7 authored by samuel.boulton's avatar samuel.boulton

finished

parent bf9ffad1
...@@ -650,17 +650,17 @@ public static int Range (int[] input) { ...@@ -650,17 +650,17 @@ public static int Range (int[] input) {
} }
public static double GetProbabilityOfResultOrHigher(int dieSides, int rolls, int sum) { public static double GetProbabilityOfResultOrHigher(int dieSides, int rolls, int sum) {
double[] distribution = GenerateRandomDistribution(dieSides,rolls,100000); double[] distribution = GenerateRandomDistribution(dieSides,rolls,100000);
double result = 0; double result = 0;
for(int i = 0; i < distribution.length; i++)
{
if(i >= sum)
{
result += distribution[i];
}
}
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment