-
Notifications
You must be signed in to change notification settings - Fork 0
/
mlkml.java
83 lines (68 loc) · 1.58 KB
/
mlkml.java
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
public class mlkml {
public static void main(String[] args) {
double health = 100;
int count = 0;
int maxnum = 2000;
double attack = 15;
int defence = 3;
int strength = 15;
double[] average = new double[maxnum];
for (int i = 0; i < maxnum; i++) {
double hit = Math.random() * (attack / defence);
hit += hit * ((strength + 60) / 100);
//System.out.println(hit);
average[i] = hit;
}
double total = 0;
for (double a : average) {
total += a;
}
System.out.println(total / average.length);
}
}
// //double strMulti = (1 / (15 - strength));
// for (int i = 0; i < maxnum; i++) {
// while (health > 0) {
// //double percentage = Math.random() + strMulti;
//
// if (accuracy == 0) {
// accuracy = 1;
// }
// if (accuracy < 0) {
// accuracy = - (1 / accuracy);
// }
//
// double maxHit = 1 + (accuracy * ((strength + 620) / 640));
// double hit = Math.random() * maxHit;
// //double hit = (health * (percentage * accuracy));
// if (hit > .5) {
// hit = (int) (hit + 1);
// } else {
// hit = 0;
// }
// health = (health - hit);
// // if (health < 1) {
// // health = 0;
// // }
// count++;
//// System.out.println(count);
//// System.out.println("hit:" + hit);
//// System.out.println("health:" + health);
// }
// health = 7;
//
// average[i] = count;
// count = 0;
// //System.out.println(i);
// }
//
// double total = 0;
// for (int poo : average) {
// total += poo;
//
// }
// System.out.println(total / maxnum);
//
//
//
// }