-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.html
84 lines (59 loc) · 2.27 KB
/
debug.html
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
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test debug Simulation</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="sim.js"></script>
</head>
<body>
<div class="container">
<div class="row col-lg-12 ">
</div>
</div>
<script>
var total=0;
var total_test = 100000000;
for (i = 0; i < total_test; i++) {
total = total + (Math.random()* 100 ) ;
}
console.log("moyenne " + total/total_test);
console.log("moyenne " + total/total_test);
console.log("moyenne " + total/total_test);
var tabtest = [];
var sim = new simulateur();
var units = sim.getUnit();
// flotte en lice
tabtest["FA"] = [0, 0, 70, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0 , 0];
tabtest["FD"] = [0, 0, 30, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
console.log("flotte attaquant");
console.log(tabtest["FA"]);
console.log("flotte attaquant valeur ");
console.log(sim.getFlottePrice(tabtest["FA"]));
console.log("flotte def");
console.log(tabtest["FD"]);
console.log("flotte defense valeur ");
console.log(sim.getFlottePrice(tabtest["FD"]));
var start = new Date();
sim.addFA(tabtest["FA"]);
sim.addFD(tabtest["FD"]);
sim.simulate(); // simulation rpoprement dite
var ResultFA = sim.ResultFA();
var ResultFD = sim.ResultFD();
var end = new Date();
var time = end.getTime() - start.getTime();
console.log("resultat attaquant");
console.log(ResultFA);
console.log("flotte attaque valeur resultat ");
console.log(sim.getFlottePrice(ResultFA));
console.log("resultat defenseur");
console.log(ResultFD);
console.log("flotte defense valeur resultat ");
console.log(sim.getFlottePrice(ResultFD));
console.log("Temps");
console.log(time);
</script>
</body>