-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
277 lines (253 loc) · 12 KB
/
index.html
File metadata and controls
277 lines (253 loc) · 12 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
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE html>
<html lang="ko"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="./res.png">
<!-- 카카오톡 출력용 -->
<meta property="og:url" content="https://gfkeysytstem.github.io/">
<meta property="og:image" content="https://gfkeysystem.github.io/740X236.jpg">
<meta property="og:title" content="소녀전선 키이벤트 확률 계산">
<meta property="og:description" content="중복이라고 걱정하지 마세요">
<!-- 페이스북 출력 이미지 -->
<meta property="me2:image" content="https://gfkeysytstem.github.io/740X236.jpg">
<!-- 트위터 출력용 -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="핫산">
<meta name="twitter:site" content="키이벤트 확률 계산">
<meta name="twitter:title" content="소녀전선 키이벤트 확률 계산">
<meta name="twitter:image" content="https://gfkeysystem.github.io/740X236.jpg">
<meta name="twitter:description" content="중복이라고 걱정하지 마세요">
<title>소녀전선 키이벤트 확률 계산</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<style>
.container{
margin-top: 100px;
}
.mt10{ margin-top: 10px; }
.mt30{ margin-top: 30px; }
#bingo{
width: 320px;
height: 320px;
margin: auto;
}
#bingo td{
padding: 0;
}
.ary{
width: 100%;
height: 100%;
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55359566-6', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="/">소녀전선 키이벤트 확률 계산기</a>
</nav>
<div class="container">
<div class="alert alert-danger" role="alert">
주의! 확정해독은 마지막에 모든 빈 칸을 채울 수 있을 때 쓰세요.
</div>
<div class="jumbotron">
<h1></h1>
<p class="lead text-center">
<a href="http://cafe.naver.com/girlsfrontlinekr/408268"><img class="img-fluid" src="/740X236.jpg"></a>
<ol>
<li>현재 자신의 빙고판을 터치로 입력한다</li>
<li>숫자는 달라도 상관없고 모양만 같으면 된다.</li>
<li>시작!을 누른다.</li>
</ol>
</p>
<!-- Button trigger modal -->
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModal">
원리 및 결과에 대한 설명
</button>
</div>
<div class="col-12">
<table class="table table-inverse table-bordered text-center" id="bingo">
<thead>
<tr>
<th>#</th>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td><input type="checkbox" class="ary" value="1"></td>
<td><input type="checkbox" class="ary" value="2"></td>
<td><input type="checkbox" class="ary" value="3"></td>
<td><input type="checkbox" class="ary" value="4"></td>
<td><input type="checkbox" class="ary" value="5"></td>
<td><input type="checkbox" class="ary" value="6"></td>
</tr>
<tr>
<th scope="row">2</th>
<td><input type="checkbox" class="ary" value="7"></td>
<td><input type="checkbox" class="ary" value="8"></td>
<td><input type="checkbox" class="ary" value="9"></td>
<td><input type="checkbox" class="ary" value="10"></td>
<td><input type="checkbox" class="ary" value="11"></td>
<td><input type="checkbox" class="ary" value="12"></td>
</tr>
<tr>
<th scope="row">3</th>
<td><input type="checkbox" class="ary" value="13"></td>
<td><input type="checkbox" class="ary" value="14"></td>
<td><input type="checkbox" class="ary" value="15"></td>
<td><input type="checkbox" class="ary" value="16"></td>
<td><input type="checkbox" class="ary" value="17"></td>
<td><input type="checkbox" class="ary" value="18"></td>
</tr>
<tr>
<th scope="row">4</th>
<td><input type="checkbox" class="ary" value="19"></td>
<td><input type="checkbox" class="ary" value="20"></td>
<td><input type="checkbox" class="ary" value="21"></td>
<td><input type="checkbox" class="ary" value="22"></td>
<td><input type="checkbox" class="ary" value="23"></td>
<td><input type="checkbox" class="ary" value="24"></td>
</tr>
<tr>
<th scope="row">5</th>
<td><input type="checkbox" class="ary" value="25"></td>
<td><input type="checkbox" class="ary" value="26"></td>
<td><input type="checkbox" class="ary" value="27"></td>
<td><input type="checkbox" class="ary" value="28"></td>
<td><input type="checkbox" class="ary" value="29"></td>
<td><input type="checkbox" class="ary" value="30"></td>
</tr>
<tr>
<th scope="row">6</th>
<td><input type="checkbox" class="ary" value="31"></td>
<td><input type="checkbox" class="ary" value="32"></td>
<td><input type="checkbox" class="ary" value="33"></td>
<td><input type="checkbox" class="ary" value="34"></td>
<td><input type="checkbox" class="ary" value="35"></td>
<td><input type="checkbox" class="ary" value="36"></td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-12 col-sm-8 ml-sm-auto mr-sm-auto mt30">
<button id="run" type="button" class="btn btn-primary btn-lg btn-block">시작!</button>
<!-- Params -->
<div class="input-group mt10">
<span class="input-group-addon" id="basic-addon1">잔여 일수</span>
<input type="number" class="form-control" id="p-day" placeholder="14" aria-label="Username" aria-describedby="basic-addon1" value="14">
</div>
<div class="input-group mt10">
<span class="input-group-addon" id="basic-addon1">하루 해독 횟수</span>
<input type="number" class="form-control" id="p-ticket" placeholder="9" aria-label="Username" aria-describedby="basic-addon1" value="5">
</div>
<div class="input-group mt10">
<span class="input-group-addon" id="basic-addon1">현재 중복 포인트</span>
<input type="number" class="form-control" id="p-d" placeholder="300" aria-label="Username" aria-describedby="basic-addon1" value="300">
</div>
<div class="input-group mt10">
<span class="input-group-addon" id="basic-addon1">시행 횟수</span>
<input type="number" class="form-control" id="p-n" placeholder="10000" aria-label="Username" aria-describedby="basic-addon1" value="10000">
</div>
<div class="input-group mt10" style="display: none;">
<span class="input-group-addon" id="basic-addon1">결과 출력 주기</span>
<input type="number" class="form-control" id="p-show" placeholder="10000" aria-label="Username" aria-describedby="basic-addon1" value="2500">
</div>
</div>
</div>
<div class="col-xs-12 col-sm-8 ml-sm-auto mr-sm-auto mt30">
<div id="res">
<div class="alert alert-dark" role="alert">
결과는 여기에 출력됩니다.
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">설명충</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
앞으로 빙고가 어떻게 진행될지 n번 임의로 시행한다<br>
자세한 설명은 생략한다(<a href="https://ko.wikipedia.org/wiki/%EB%AA%AC%ED%85%8C%EC%B9%B4%EB%A5%BC%EB%A1%9C_%EB%B0%A9%EB%B2%95">몬테카를로 시뮬레이션</a>)<br><br>
</p>
<p>
<b>n번 수행</b> : 몇 번 수행한 결과인지 출력, 기본 2500회마다 출력<br><br>
<b>평균 빈칸 수</b> : 마지막까지 난수해독만 한 후 생기는 빈칸.<br><br>
<b>14빙고 실패 확률</b> : 확정해독을 포함해서 14빙고(모든 칸 채우기)를 실패하는지 계산한다.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">닫기</button>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<script>
$("#run").on( "click", function() {
console.log( $( this ).text() )
// get params
var day = $("#p-day")[0].value
var ticket = $("#p-ticket")[0].value
var n = $("#p-n")[0].value
var show = $("#p-show")[0].value
var d = $("#p-d")[0].value / 10
var sum = 0
var loser = 0
var sum_d = 0
var dp = 0
// run
for(t = 1; t <= n; t++){
var fail = 0
var cnt = 0
var ary = new Array(37)
for(i = 1; i <= 36; i++) { ary[i] = 0 }
$(".ary:checkbox:checked").each(function(){
ary[this.value] = 1
cnt++
})
for(i = 1; i <= day * ticket; i++){
if(cnt >= 36) break
var tmp = Math.floor((Math.random() * 36) + 1)
if(ary[tmp] == 1){ fail++ }
else { cnt ++ }
ary[tmp] = 1
}
fail = fail + d
if(cnt < 36 && (fail / 10) < (36 - cnt)) loser++
sum += cnt
sum_d += fail
// print
if(t % show == 0){
$("#res").prepend('<div class="alert alert-primary" role="alert">' + t + '번 수행<br>평균 빈칸 수 : ' + sum / t + '<br>14빙고 실패 확률 : ' + loser / t + '<br>앞으로 흭득하게 될 중복 포인트의 평균 : ' + ((sum_d) / t) * 10 + '</div>')
}
}
});
</script>
</body></html>