From d2af58b0f68ebfbba2be7e7679efec6c8c0af12f Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 9 Feb 2017 11:50:31 -0500 Subject: Update --- BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java b/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java index 419c787..24c2014 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcutils/NumberUtils.java @@ -26,8 +26,7 @@ public class NumberUtils { } else { int result = 1; - for (int currentSub = 0; currentSub < power + 1; - currentSub++) { + for (int currentSub = 0; currentSub < power + 1; currentSub++) { result *= value - currentSub; } @@ -38,16 +37,16 @@ public class NumberUtils { /** * Evaluates a linear probability distribution * - * @param topExp + * @param winning * The number of winning possibilities - * @param bottomExp + * @param total * The number of total possibilities * @param rng * The function to use to generate a random possibility * @return Whether or not a random possibility was a winning one */ - public static boolean isProbable(int topExp, int bottomExp, + public static boolean isProbable(int winning, int total, Function rng) { - return rng.apply(bottomExp) < topExp; + return rng.apply(total) < winning; } } -- cgit v1.2.3