-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMasters.java
More file actions
65 lines (57 loc) · 1.84 KB
/
Copy pathMasters.java
File metadata and controls
65 lines (57 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import java.util.*;
// for fangsie and / or petcord
class Masters {
int droprate = 1000;
int killCount = 0;
double totalHours = 0;
boolean hasBloodhound = false;
int passiveClues = 1212;
double zerotime = 0;
double zeroTimeCluesPerHour = 4;
double notZerotime = 0;
double notZeroTimeCluesPerHour = 1.56;
Random rand = new Random(System.nanoTime());
Masters() {
}
public void getBloodhound() {
while (!hasBloodhound) {
killCount ++;
if (killCount < passiveClues) {
zerotime ++;
} else {
notZerotime ++;
}
int roll = rand.nextInt(droprate + 1);
if (roll == droprate) {
hasBloodhound = true;
}
totalHours = zerotime / zeroTimeCluesPerHour + notZerotime / notZeroTimeCluesPerHour;
}
}
public static void main(String[] args) {
int completions;
int runs = 1000000;
ArrayList<Double> completionTime = new ArrayList<Double>();
ArrayList<Integer> completionKC = new ArrayList<Integer>();
Masters masters;
for (int i = 0; i < runs; i++) {
masters = new Masters();
masters.getBloodhound();
completionTime.add(masters.totalHours);
completionKC.add(masters.killCount);
}
Collections.sort(completionKC);
long totalKills = 0;
long totalHours = 0;
for (int i = 0; i < runs; i++) {
totalKills += completionKC.get(i);
totalHours += completionTime.get(i);
}
double averageKills = (double) totalKills / (double) runs;
double averageHours = (double) totalHours / (double) runs;
System.out.println("Average KC: " + averageKills);
System.out.println("Average hours: " + averageHours);
System.out.println("Lowest kc: " + completionKC.get(0));
System.out.println("Highest kc: " + completionKC.get(runs - 1));
}
}