-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
150 lines (106 loc) · 6.16 KB
/
index.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./index.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<title>Monty Hall Simulator</title>
</head>
<body class="text-center overflow-visible"></body>
<!-- <h1 class="text-center">Monty Hall Problem</h1> -->
<h1 id="game-title" class="text-center my-3">Monty Hall Game</h1>
<h3 id="status" class="text-center my-2 h4 mx-2" style="height: 78px; display: flex; align-items: center; justify-content: center;">Let's Play a game?</h3>
<h5 id="doors-opened-count" class="text-center">Doors Opened: <span id="doors-opened">0</span></h5>
<div class="text-center">
<img class="mx-1 mx-lg-4 my-1 door" id="Door 1">
<img class="mx-1 mx-lg-4 my-1 door" id="Door 2">
<img class="mx-1 mx-lg-4 my-1 door" id="Door 3">
</div>
<div class="row jusity-content-center text-center my-3">
<div class="col-12">
<button id="start-button" class="btn btn-info fw-bold text-white">Start Game</button>
</div>
<div class="col-12">
<button class="btn btn-warning fw-bold text-white mt-3" type="button" data-bs-toggle="collapse" data-bs-target="#stats" aria-expanded="false" aria-controls="stats">STRATEGY STATS</button>
</div>
</div>
<div id="stats" class="collapse">
<div class="text-center mb-2">
<div class="d-flex justify-content-center flex-col">
<div class="mx-4 border border-dark"><p class="my-2 mx-2 d-inline fw-bold">Rounds Played</p> <span id="playcount" class="d-block bg-secondary fw-bold text-white fs-3">0</span></div>
<div class="mx-4 border border-dark"><p class="my-2 mx-2 d-inline fw-bold">Rounds Won</p> <span id="wincount" class="d-block bg-secondary fw-bold text-white fs-3">0</span></div>
</div>
<div class="d-flex justify-content-center mt-3">
<div class="border border-dark">
<p class="my-0 fw-bold d-inline mx-2">Win Percentage(%)</p>
<div class="bg-secondary">
<span id="winpercent" class="d-inline fw-bold text-white fs-3">0</span><span class="d-inline fw-bold text-white fs-3">%</span>
</div>
</div>
</div>
</div>
<div class="mb-2 d-flex flex-md-row flex-column justify-content-center text-center">
<div class="border border-dark mx-md-2 my-2">
<h4>SWITCH</h4>
<div class="d-flex justify-content-center flex-col">
<div class="mx-4 border border-dark bg-info"><p class="my-2 mx-2 d-inline fw-bold">Rounds Played</p> <span id="switchPlayCount" class="d-block bg-secondary fw-bold text-white fs-3">0</span></div>
<div class="mx-4 border border-dark bg-info"><p class="my-2 mx-2 d-inline fw-bold">Rounds Won</p> <span id="switchWinCount" class="d-block bg-secondary fw-bold text-white fs-3">0</span></div>
</div>
<div class="d-flex justify-content-center mt-3">
<div class="border border-dark bg-info mb-2">
<p class="my-0 fw-bold d-inline mx-2">Win Percentage(%)</p>
<div class="bg-secondary">
<span id="switchWinPercentage" class="d-inline fw-bold text-white fs-3">0</span><span class="d-inline fw-bold text-white fs-3">%</span>
</div>
</div>
</div>
</div>
<div class="border border-dark mx-md-2 my-2">
<h4>STAY</h4>
<div class="d-flex justify-content-center flex-col">
<div class="mx-4 border border-dark bg-info"><p class="my-2 mx-2 d-inline fw-bold">Rounds Played</p> <span id="stayPlayCount" class="d-block bg-secondary fw-bold text-white fs-3">0</span></div>
<div class="mx-4 border border-dark bg-info"><p class="my-2 mx-2 d-inline fw-bold">Rounds Won</p> <span id="stayWinCount" class="d-block bg-secondary fw-bold text-white fs-3">0</span></div>
</div>
<div class="d-flex justify-content-center mt-3">
<div class="border border-dark bg-info mb-2">
<p class="my-0 fw-bold d-inline mx-2">Win Percentage(%)</p>
<div class="bg-secondary">
<span id="stayWinPercentage" class="d-inline fw-bold text-white fs-3">0</span><span class="d-inline fw-bold text-white fs-3">%</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-center">
<div id="scatterplot"></div>
</div>
<h1>Simulator</h1>
<!-- Button trigger modal -->
<div class="mb-3" style="width: 300px; margin: auto">
<div>
<label for="numOfRounds" class="fw-bold text-black fs-3"># of Rounds: </label>
<input type="number" min="1" max="2000" name="numOfRounds" id="numOfRounds" value="100">
</div>
<div>
<label class= "fw-bold text-black fs-3" for="strategy-type">Strategy: </label>
<select name="strategy-type" id="strategy-type">
<option value="stay">Stay</option>
<option value="switch">Switch</option>
</select>
</div>
<div>
<label class="fw-bold text-black fs-3" for="animate-toggle">Animate: </label>
<input type="checkbox" id="animate-toggle">
</div>
<div>
<button class="btn btn-success fw-bold text-white" id="simulator" class="mt-4">Simulate</button>
<button class="btn btn-danger fw-bold text-white" id="stop-simulator">Stop simulation</button>
</div>
</div>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script defer type="text/javascript" src="./index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
</body>
</html>