Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-open-source
/
BaseBallSimulator
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오진혁
2021-06-10 09:10:52 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
9f51a694cdce07550f1b71281b92c7c1ba246a8c
9f51a694
2 parents
3ef0c051
ec855c55
Modify README
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
553 additions
and
184 deletions
main.html
player.js
predict.js
server.js
simulation.css
simulation.html
temp_algorithm.js
main.html
View file @
9f51a69
...
...
@@ -25,10 +25,10 @@
</ul>
</nav>
<div
class=
"container2"
>
<a
href=
"https://sports.news.naver.com/kbaseball/record/index.nhn?category=kbo&year=2021"
><img
src=
"pngs/rank.
jpg
"
style=
"display:block; margin:0 auto; width:600px; height:400px;"
></a>
<a
href=
"https://sports.news.naver.com/kbaseball/record/index.nhn?category=kbo&year=2021"
><img
src=
"pngs/rank.
JPG
"
style=
"display:block; margin:0 auto; width:600px; height:400px;"
></a>
</div>
<div
class=
"container3"
>
<a
href=
"https://sports.news.naver.com/kbaseball/schedule/index.nhn"
><img
src=
"pngs/today.
jpg
"
style=
"display:block; margin:0 auto; width:655px; height:150px;"
></a>
<a
href=
"https://sports.news.naver.com/kbaseball/schedule/index.nhn"
><img
src=
"pngs/today.
JPG
"
style=
"display:block; margin:0 auto; width:655px; height:150px;"
></a>
</div>
<div
class=
"container4"
>
<img
src=
"pngs/1.jpg"
style=
"display:block; margin:0 auto; width:200px; height:100px;"
>
...
...
player.js
View file @
9f51a69
var
dusan_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'박건우'
,
0.356
,
47
,
9
,
0
,
2
],
[
'허경민'
,
0.345
,
49
,
6
,
0
,
3
],
[
'페르난데스'
,
0.336
,
48
,
5
,
0
,
6
],
[
'최용제'
,
0.308
,
8
,
2
,
0
,
0
],
[
'안재석'
,
0.304
,
14
,
1
,
2
,
0
],
[
'김인태'
,
0.298
,
25
,
3
,
0
,
1
],
[
'김재환'
,
0.285
,
37
,
4
,
1
,
9
],
[
'장승현'
,
0.284
,
23
,
1
,
0
,
1
],
[
'조수행'
,
0.278
,
10
,
1
,
1
,
0
],
[
'양석환'
,
0.277
,
38
,
8
,
0
,
5
],
[
'박계범'
,
0.266
,
21
,
5
,
0
,
2
],
[
'김재호'
,
0.243
,
18
,
1
,
0
,
1
],
[
'오재원'
,
0.22
,
11
,
2
,
0
,
0
],
[
'강승호'
,
0.212
,
7
,
0
,
0
,
2
],
[
'권민석'
,
0.167
,
2
,
1
,
0
,
0
],
[
'박세혁'
,
0.161
,
5
,
0
,
0
,
0
],
[
'안권수'
,
0.133
,
2
,
0
,
0
,
0
],
[
'정수빈'
,
0.125
,
4
,
1
,
0
,
0
]
[
'김재환'
,
0.268
,
48
,
4
,
1
,
13
],
[
'박건우'
,
0.340
,
52
,
10
,
0
,
2
],
[
'페르난데스'
,
0.333
,
66
,
7
,
0
,
8
],
[
'허경민'
,
0.330
,
63
,
9
,
0
,
4
],
[
'양석환'
,
0.269
,
52
,
10
,
0
,
12
],
[
'김인태'
,
0.267
,
36
,
5
,
1
,
4
],
[
'안재석'
,
0.316
,
25
,
4
,
2
,
0
],
[
'최용제'
,
0.311
,
14
,
3
,
0
,
0
],
[
'조수행'
,
0.277
,
13
,
1
,
1
,
0
],
[
'장승현'
,
0.248
,
27
,
3
,
0
,
2
],
[
'김재호'
,
0.262
,
28
,
5
,
0
,
1
],
[
'박계범'
,
0.266
,
21
,
5
,
0
,
2
],
[
'강승호'
,
0.247
,
19
,
2
,
1
,
2
],
[
'정수빈'
,
0.226
,
14
,
2
,
1
,
0
],
[
'박세혁'
,
0.182
,
6
,
0
,
0
,
0
],
[
'오재원'
,
0.175
,
11
,
2
,
0
,
0
],
]
var
dusan_pitcher
=
[
...
...
@@ -29,57 +27,67 @@ var dusan_pitcher = [
[
'곽빈'
,
16.7
,
0.256
],
[
'유희관'
,
7.6
,
0.409
],
[
'조제영'
,
16.7
,
0.367
],
[
'이영하'
,
1
2.8
,
0.388
],
[
'이영하'
,
1
6.0
,
0.393
],
]
var
hanhwa_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'하주석'
,
0.299
,
40
,
7
,
1
,
3
],
[
'장운호'
,
0.291
,
30
,
6
,
0
,
0
],
[
'노시환'
,
0.279
,
38
,
7
,
0
,
7
],
[
'정은원'
,
0.277
,
36
,
7
,
2
,
0
],
[
'힐리'
,
0.258
,
32
,
6
,
1
,
2
],
[
'정진호'
,
0.254
,
15
,
3
,
0
,
0
],
[
'최재훈'
,
0.247
,
20
,
1
,
0
,
2
],
[
'김민하'
,
0.246
,
14
,
4
,
0
,
1
],
[
'노수광'
,
0.238
,
10
,
1
,
0
,
0
],
[
'이해창'
,
0.231
,
9
,
3
,
0
,
0
],
[
'이성열'
,
0.207
,
12
,
3
,
0
,
1
],
[
'박정현'
,
0.196
,
19
,
3
,
0
,
0
],
[
'유장혁'
,
0.169
,
14
,
5
,
0
,
1
],
[
'임종찬'
,
0.163
,
16
,
5
,
0
,
1
],
[
'정은원'
,
0.284
,
54
,
10
,
4
,
1
],
[
'노시환'
,
0.266
,
49
,
8
,
0
,
11
],
[
'하주석'
,
0.283
,
53
,
10
,
1
,
4
],
[
'조한민'
,
0.308
,
8
,
1
,
2
,
2
],
[
'최재훈'
,
0.216
,
27
,
3
,
0
,
2
],
[
'김민하'
,
0.240
,
18
,
4
,
0
,
1
],
[
'장운호'
,
0.273
,
35
,
8
,
0
,
0
],
[
'노수광'
,
0.217
,
15
,
1
,
0
,
1
],
[
'강상원'
,
0.167
,
3
,
0
,
0
,
0
],
[
'강경학'
,
0.136
,
3
,
0
,
0
,
0
],
[
'이해창'
,
0.231
,
9
,
3
,
0
,
0
],
[
'허관회'
,
0.161
,
5
,
0
,
0
,
0
],
[
'이성열'
,
0.203
,
16
,
4
,
0
,
1
],
[
'힐리'
,
0.258
,
46
,
8
,
1
,
4
],
[
'정진호'
,
0.216
,
16
,
3
,
0
,
0
],
[
'박정현'
,
0.196
,
21
,
4
,
0
,
0
],
[
'유장혁'
,
0.143
,
14
,
5
,
0
,
1
],
[
'임종찬'
,
0.155
,
16
,
5
,
0
,
1
],
]
var
hanhwa_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'킹험'
,
6.4
,
0.211
],
[
'카펜터'
,
11.6
,
0.201
],
[
'김민우'
,
10.9
,
0.217
],
[
'강재민'
,
9.9
,
0.143
],
[
'김범수'
,
14.3
,
0.265
],
[
'장시환'
,
14.9
,
0.311
],
[
'정우람'
,
13.8
,
0.244
],
[
'윤대경'
,
15.3
,
0.222
],
[
'카펜터'
,
11.7
,
0.209
],
[
'김민우'
,
11.2
,
0.208
],
[
'김범수'
,
13.9
,
0.284
],
[
'장시환'
,
15.8
,
0.306
],
[
'윤대경'
,
15.0
,
0.208
],
[
'김기중'
,
5.6
,
0.353
],
[
'김이환'
,
16.7
,
0.283
],
[
'윤호솔'
,
10.8
,
0.222
],
[
'배동현'
,
12.5
,
0.244
],
[
'박주홍'
,
50.0
,
0.250
],
[
'이승관'
,
39.1
,
0.538
],
[
'배동현'
,
15.4
,
0.252
],
]
var
kia_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'김태진'
,
0.349
,
22
,
2
,
1
,
0
],
[
'최원준'
,
0.342
,
54
,
2
,
4
,
0
],
[
'이정훈'
,
0.293
,
12
,
2
,
0
,
1
],
[
'김선빈'
,
0.292
,
40
,
8
,
0
,
0
],
[
'터커'
,
0.265
,
40
,
9
,
1
,
2
],
[
'김민식'
,
0.261
,
18
,
2
,
0
,
2
],
[
'류지혁'
,
0.259
,
21
,
3
,
0
,
0
],
[
'한승택'
,
0.259
,
15
,
3
,
0
,
0
],
[
'이창진'
,
0.254
,
18
,
5
,
0
,
0
],
[
'박찬호'
,
0.237
,
28
,
5
,
2
,
0
],
[
'최형우'
,
0.2
,
18
,
0
,
0
,
4
],
[
'나지완'
,
0.184
,
9
,
1
,
0
,
0
],
[
'김호령'
,
0.163
,
7
,
2
,
0
,
1
],
[
'최원준'
,
0.324
,
71
,
5
,
5
,
1
],
[
'김민식'
,
0.247
,
22
,
3
,
0
,
2
],
[
'김선빈'
,
0.281
,
52
,
10
,
0
,
0
],
[
'이정훈'
,
0.298
,
25
,
5
,
0
,
2
],
[
'김태진'
,
0.336
,
41
,
3
,
1
,
0
],
[
'터커'
,
0.269
,
56
,
11
,
1
,
3
],
[
'이진영'
,
0.188
,
6
,
2
,
0
,
2
],
[
'한승택'
,
0.238
,
19
,
3
,
0
,
0
],
[
'김호령'
,
0.163
,
7
,
2
,
0
,
1
],
[
'류지혁'
,
0.259
,
21
,
3
,
0
,
0
],
[
'김규성'
,
0.133
,
2
,
1
,
0
,
0
],
[
'이창진'
,
0.218
,
22
,
5
,
0
,
0
],
[
'나지완'
,
0.184
,
9
,
1
,
0
,
0
],
[
'박찬호'
,
0.241
,
42
,
6
,
2
,
0
],
[
'이우성'
,
0.194
,
6
,
1
,
0
,
0
],
[
'유민상'
,
0.143
,
3
,
1
,
0
,
0
],
[
'최형우'
,
0.195
,
22
,
1
,
0
,
5
],
[
'황대인'
,
0.259
,
15
,
2
,
0
,
2
],
[
'나주환'
,
0.172
,
5
,
0
,
0
,
0
],
]
var
kia_pitcher
=
[
...
...
@@ -92,29 +100,32 @@ var kia_pitcher = [
[
'이민우'
,
7.9
,
0.346
],
[
'남재현'
,
27.8
,
0.208
],
[
'김유신'
,
16.2
,
0.269
],
[
'차명진'
,
8.0
,
0.273
],
]
var
kiwoom_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'이정후'
,
0.367
,
55
,
14
,
3
,
1
],
[
'서건창'
,
0.31
,
40
,
8
,
0
,
1
],
[
'이지영'
,
0.304
,
17
,
2
,
1
,
0
],
[
'박동원'
,
0.281
,
25
,
5
,
0
,
7
],
[
'김혜성'
,
0.268
,
41
,
7
,
1
,
3
],
[
'이용규'
,
0.258
,
32
,
2
,
4
,
0
],
[
'김웅빈'
,
0.256
,
32
,
8
,
0
,
3
],
[
'프레이타스'
,
0.25
,
25
,
7
,
0
,
1
],
[
'송우현'
,
0.248
,
28
,
5
,
1
,
1
],
[
'전병우'
,
0.222
,
14
,
3
,
0
,
2
],
[
'김수환'
,
0.22
,
9
,
2
,
0
,
2
],
[
'박병호'
,
0.212
,
22
,
5
,
0
,
5
],
[
'허정협'
,
0.179
,
5
,
0
,
0
,
0
],
[
'신준우'
,
0.167
,
1
,
1
,
0
,
0
],
[
'이정후'
,
0.346
,
71
,
21
,
4
,
1
],
[
'박동원'
,
0.281
,
34
,
7
,
0
,
9
],
[
'김혜성'
,
0.283
,
62
,
8
,
1
,
3
],
[
'서건창'
,
0.266
,
49
,
9
,
0
,
1
],
[
'김웅빈'
,
0.250
,
39
,
10
,
0
,
4
],
[
'이용규'
,
0.256
,
42
,
4
,
4
,
0
],
[
'송우현'
,
0.280
,
46
,
11
,
1
,
1
],
[
'박병호'
,
0.219
,
35
,
8
,
0
,
8
],
[
'전병우'
,
0.196
,
22
,
6
,
0
,
3
],
[
'박준태'
,
0.048
,
1
,
1
,
0
,
0
],
[
'프레이타스'
,
0.285
,
35
,
10
,
0
,
2
],
[
'김수환'
,
0.220
,
9
,
2
,
0
,
2
],
[
'허정협'
,
0.179
,
5
,
0
,
0
,
0
],
[
'박주홍'
,
0.143
,
4
,
2
,
0
,
0
],
[
'이지영'
,
0.253
,
22
,
2
,
1
,
0
],
[
'변상권'
,
0.105
,
2
,
0
,
0
,
0
],
]
var
kiwoom_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'요키시'
,
6.
6
,
0.27
],
[
'요키시'
,
6.
8
,
0.252
],
[
'한현희'
,
8.8
,
0.261
],
[
'최원태'
,
7.7
,
0.276
],
[
'안우진'
,
10.4
,
0.269
],
...
...
@@ -127,27 +138,29 @@ var kiwoom_pitcher = [
var
kt_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'강백호'
,
0.417
,
60
,
8
,
1
,
5
],
[
'김병희'
,
0.389
,
7
,
2
,
0
,
2
],
[
'배정대'
,
0.324
,
44
,
8
,
0
,
2
],
[
'황재균'
,
0.324
,
22
,
2
,
1
,
1
],
[
'심우준'
,
0.315
,
34
,
6
,
1
,
2
],
[
'김민혁'
,
0.306
,
19
,
0
,
2
,
0
],
[
'유한준'
,
0.288
,
19
,
5
,
0
,
0
],
[
'알몬테'
,
0.284
,
40
,
5
,
0
,
4
],
[
'조용호'
,
0.277
,
33
,
3
,
0
,
0
],
[
'문상철'
,
0.258
,
16
,
6
,
0
,
2
],
[
'장성우'
,
0.235
,
24
,
3
,
0
,
3
],
[
'신본기'
,
0.222
,
18
,
4
,
0
,
0
],
[
'박경수'
,
0.203
,
15
,
5
,
0
,
4
],
[
'이홍구'
,
0.184
,
7
,
0
,
0
,
1
],
[
'강백호'
,
0.407
,
81
,
12
,
1
,
7
],
[
'배정대'
,
0.295
,
57
,
13
,
0
,
3
],
[
'심우준'
,
0.306
,
49
,
11
,
1
,
3
],
[
'김병희'
,
0.300
,
12
,
3
,
0
,
3
],
[
'황재균'
,
0.316
,
31
,
3
,
1
,
1
],
[
'조용호'
,
0.281
,
47
,
7
,
0
,
0
],
[
'장성우'
,
0.234
,
36
,
6
,
0
,
6
],
[
'알몬테'
,
0.296
,
58
,
9
,
0
,
5
],
[
'김민혁'
,
0.302
,
19
,
0
,
2
,
0
],
[
'유한준'
,
0.280
,
30
,
6
,
0
,
1
],
[
'권동진'
,
0.182
,
6
,
3
,
0
,
0
],
[
'송민섭'
,
0.080
,
2
,
0
,
0
,
0
],
[
'문상철'
,
0.222
,
16
,
6
,
0
,
2
],
[
'신본기'
,
0.400
,
18
,
4
,
0
,
0
],
[
'박경수'
,
0.185
,
22
,
6
,
0
,
5
],
[
'이홍구'
,
0.178
,
8
,
0
,
0
,
1
],
]
var
kt_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'데스파이네'
,
11.3
,
0.213
],
[
'고영표'
,
3.9
,
0.243
],
[
'배제성'
,
1
4.0
,
0
,
224
],
[
'배제성'
,
1
3.8
,
0.226
],
[
'소형준'
,
12.3
,
0.269
],
[
'김민수'
,
11.8
,
0.299
],
[
'쿠에바스'
,
12.0
,
0.306
],
...
...
@@ -156,17 +169,21 @@ var kt_pitcher = [
var
lg_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'김현수'
,
0.316
,
42
,
7
,
0
,
6
],
[
'홍창기'
,
0.313
,
46
,
8
,
1
,
2
],
[
'채은성'
,
0.271
,
29
,
6
,
0
,
5
],
[
'문보경'
,
0.267
,
12
,
4
,
0
,
1
],
[
'정주현'
,
0.266
,
25
,
6
,
1
,
2
],
[
'라모스'
,
0.248
,
34
,
5
,
0
,
5
],
[
'유강남'
,
0.241
,
27
,
4
,
0
,
3
],
[
'오지환'
,
0.22
,
28
,
5
,
0
,
2
],
[
'이형종'
,
0.209
,
14
,
5
,
0
,
3
],
[
'이천웅'
,
0.202
,
17
,
5
,
0
,
1
],
[
'김민성'
,
0.192
,
23
,
8
,
0
,
2
],
[
'홍창기'
,
0.316
,
60
,
8
,
1
,
3
],
[
'김현수'
,
0.317
,
59
,
9
,
0
,
8
],
[
'채은성'
,
0.303
,
47
,
11
,
0
,
7
],
[
'문보경'
,
0.275
,
19
,
7
,
0
,
2
],
[
'유강남'
,
0.241
,
40
,
6
,
0
,
5
],
[
'오지환'
,
0.231
,
37
,
9
,
1
,
2
],
[
'이형종'
,
0.222
,
22
,
6
,
0
,
4
],
[
'한석현'
,
0.286
,
6
,
2
,
1
,
0
],
[
'라모스'
,
0.243
,
45
,
7
,
1
,
8
],
[
'김재성'
,
0.188
,
6
,
1
,
1
,
1
],
[
'신민재'
,
0.167
,
3
,
0
,
0
,
0
],
[
'정주현'
,
0.222
,
30
,
6
,
1
,
2
],
[
'구본혁'
,
0.150
,
3
,
2
,
0
,
0
],
[
'김민성'
,
0.207
,
34
,
9
,
0
,
3
],
[
'이천웅'
,
0.211
,
27
,
6
,
0
,
2
],
]
var
lg_pitcher
=
[
...
...
@@ -175,32 +192,40 @@ var lg_pitcher = [
[
'정찬헌'
,
5.6
,
0.271
],
[
'켈리'
,
9.6
,
0.228
],
[
'이민호'
,
11.5
,
0.234
],
[
'이우찬'
,
10.2
,
0.264
]
[
'배재준'
,
6.2
,
0.356
],
[
'차우찬'
,
9.5
,
0.211
],
[
'함덕주'
,
17.2
,
0.224
],
[
'김윤식'
,
1
7.2
,
0.254
],
[
'김윤식'
,
1
2.7
,
0.254
],
[
'임찬규'
,
25.8
,
0.476
],
[
'이상영'
,
1
2.0
,
0.258
],
[
'이상영'
,
1
1.1
,
0.257
],
]
var
lotte_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'전준우'
,
0.325
,
65
,
12
,
0
,
2
],
[
'정훈'
,
0.305
,
57
,
13
,
0
,
6
],
[
'마차도'
,
0.272
,
43
,
9
,
0
,
4
],
[
'안치홍'
,
0.310
,
54
,
11
,
2
,
3
],
[
'이대호'
,
0.328
,
44
,
3
,
0
,
8
],
[
'전준우'
,
0.316
,
43
,
8
,
0
,
2
],
[
'안치홍'
,
0.299
,
43
,
8
,
1
,
3
],
[
'정훈'
,
0.296
,
37
,
11
,
0
,
4
],
[
'마차도'
,
0.28
,
28
,
6
,
0
,
3
],
[
'추재현'
,
0.278
,
10
,
2
,
0
,
0
],
[
'손아섭'
,
0.255
,
40
,
3
,
0
,
0
],
[
'김준태'
,
0.25
,
21
,
5
,
0
,
3
],
[
'오윤석'
,
0.25
,
10
,
5
,
0
,
1
],
[
'한동희'
,
0.248
,
30
,
6
,
0
,
5
],
[
'한동희'
,
0.241
,
41
,
8
,
0
,
7
],
[
'추재현'
,
0.318
,
28
,
6
,
0
,
3
],
[
'김준태'
,
0.221
,
23
,
5
,
0
,
4
],
[
'김재유'
,
0.290
,
9
,
2
,
0
,
0
],
[
'배성근'
,
0.270
,
10
,
1
,
0
,
0
],
[
'이병규'
,
0.235
,
8
,
0
,
0
,
0
],
[
'지시완'
,
0.237
,
14
,
2
,
0
,
2
],
[
'오윤석'
,
0.245
,
13
,
7
,
0
,
1
],
[
'장두성'
,
0.214
,
6
,
2
,
0
,
0
],
[
'나승엽'
,
0.268
,
11
,
1
,
0
,
0
],
[
'김민수'
,
0.232
,
16
,
5
,
0
,
1
],
[
'강태율'
,
0.100
,
2
,
1
,
0
,
1
],
[
'손아섭'
,
0.271
,
57
,
6
,
0
,
0
],
]
var
lotte_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'스트레일리'
,
8.7
,
0.268
],
[
'스트레일리'
,
9.3
,
0.268
],
[
'박세웅'
,
8.3
,
0.230
],
[
'나균안'
,
9.4
,
0.274
],
[
'프랑코'
,
11.0
,
0.234
],
...
...
@@ -212,20 +237,25 @@ var lotte_pitcher = [
var
nc_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'양의지'
,
0.361
,
44
,
10
,
1
,
9
],
[
'알테어'
,
0.326
,
44
,
8
,
0
,
13
],
[
'박석민'
,
0.325
,
25
,
4
,
0
,
8
],
[
'박민우'
,
0.303
,
27
,
1
,
1
,
1
],
[
'김태군'
,
0.278
,
20
,
5
,
0
,
2
],
[
'나성범'
,
0.269
,
42
,
8
,
1
,
10
],
[
'이명기'
,
0.266
,
29
,
6
,
0
,
1
],
[
'노진혁'
,
0.265
,
30
,
3
,
0
,
4
],
[
'박준영'
,
0.26
,
19
,
2
,
1
,
4
],
[
'강진성'
,
0.239
,
16
,
5
,
0
,
1
],
[
'권희동'
,
0.233
,
20
,
3
,
0
,
5
],
[
'이원재'
,
0.196
,
10
,
2
,
0
,
0
],
[
'지석훈'
,
0.156
,
5
,
1
,
0
,
0
],
[
'양의지'
,
0.349
,
60
,
11
,
1
,
11
],
[
'알테어'
,
0.303
,
56
,
10
,
0
,
14
],
[
'박석민'
,
0.299
,
35
,
8
,
0
,
10
],
[
'나성범'
,
0.280
,
60
,
12
,
1
,
13
,]
[
'노진혁'
,
0.296
,
45
,
5
,
0
,
5
],
[
'이명기'
,
0.296
,
47
,
10
,
0
,
2
],
[
'박민우'
,
0.287
,
41
,
5
,
1
,
1
],
[
'권희동'
,
0.237
,
22
,
3
,
0
,
6
],
[
'김태군'
,
0.248
,
26
,
5
,
0
,
3
],
[
'윤형준'
,
0.400
,
10
,
0
,
0
,
3
],
[
'박준영'
,
0.238
,
24
,
2
,
1
,
5
],
[
'김찬형'
,
0.364
,
8
,
1
,
0
,
0
],
[
'정진기'
,
0.333
,
7
,
3
,
0
,
0
],
[
'전민수'
,
0.318
,
7
,
0
,
0
,
0
],
[
'강진성'
,
0.234
,
26
,
7
,
0
,
1
],
[
'지석훈'
,
0.147
,
5
,
1
,
0
,
0
],
[
'최정원'
,
0.158
,
3
,
0
,
0
,
0
],
[
'도태훈'
,
0.067
,
2
,
0
,
0
,
0
],
[
'이원재'
,
0.226
,
14
,
2
,
0
,
0
],
]
var
nc_pitcher
=
[
...
...
@@ -236,26 +266,27 @@ var nc_pitcher = [
[
'신민혁'
,
7.8
,
0.245
],
[
'강동연'
,
9.0
,
0.271
],
[
'김진호'
,
42.9
,
0.500
],
[
'김영규'
,
11.
5
,
0.309
],
[
'김영규'
,
11.
9
,
0.312
],
[
'이재학'
,
24.4
,
0.290
],
]
var
samsung_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'김민수'
,
0.4
,
12
,
4
,
0
,
2
],
[
'피렐라'
,
0.358
,
57
,
7
,
1
,
12
],
[
'강민호'
,
0.35
,
41
,
7
,
0
,
5
],
[
'박해민'
,
0.312
,
43
,
7
,
0
,
1
],
[
'구자욱'
,
0.299
,
43
,
9
,
3
,
5
],
[
'오재일'
,
0.257
,
18
,
4
,
0
,
3
],
[
'김지찬'
,
0.25
,
17
,
3
,
0
,
0
],
[
'강한울'
,
0.247
,
21
,
2
,
0
,
0
],
[
'송준석'
,
0.24
,
12
,
2
,
0
,
2
],
[
'이학주'
,
0.22
,
18
,
6
,
0
,
2
],
[
'김헌곤'
,
0.208
,
11
,
1
,
0
,
2
],
[
'이원석'
,
0.204
,
20
,
3
,
0
,
3
],
[
'김상수'
,
0.191
,
25
,
2
,
1
,
0
],
[
'김동엽'
,
0.125
,
4
,
0
,
0
,
0
],
[
'피렐라'
,
0.347
,
77
,
10
,
1
,
13
],
[
'강민호'
,
0.351
,
54
,
8
,
0
,
6
],
[
'박해민'
,
0.292
,
52
,
8
,
0
,
3
],
[
'구자욱'
,
0.287
,
58
,
10
,
4
,
6
],
[
'오재일'
,
0.295
,
36
,
8
,
0
,
8
],
[
'김헌곤'
,
0.310
,
31
,
2
,
0
,
3
],
[
'김민수'
,
0.313
,
15
,
4
,
0
,
2
],
[
'이원석'
,
0.241
,
33
,
8
,
0
,
3
],
[
'김지찬'
,
0.259
,
30
,
5
,
0
,
1
],
[
'이학주'
,
0.220
,
18
,
6
,
0
,
2
],
[
'김호재'
,
0.222
,
8
,
1
,
0
,
0
],
[
'송준석'
,
0.235
,
12
,
2
,
0
,
2
],
[
'강한울'
,
0.231
,
24
,
3
,
0
,
0
],
[
'김상수'
,
0.206
,
37
,
4
,
1
,
0
],
[
'김동엽'
,
0.157
,
8
,
1
,
0
,
0
],
]
var
samsung_pitcher
=
[
...
...
@@ -264,27 +295,32 @@ var samsung_pitcher = [
[
'원태인'
,
8.6
,
0.246
],
[
'라이블리'
,
9.3
,
0.190
],
[
'백정현'
,
10.5
,
0.250
],
[
'최채흥'
,
14.5
,
0.346
],
[
'최채흥'
,
9.7
,
0.346
],
[
'이승민'
,
10.2
,
0.294
],
[
'김윤수'
,
19.3
,
0.348
],
[
'김대우'
,
8.3
,
0.275
],
[
'구준범'
,
25.0
,
0.250
],
]
var
ssg_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'최주환'
,
0.365
,
27
,
6
,
0
,
4
],
[
'최정'
,
0.309
,
38
,
6
,
0
,
10
],
[
'이흥련'
,
0.295
,
13
,
0
,
0
,
0
],
[
'박성한'
,
0.287
,
25
,
6
,
0
,
1
],
[
'김성현'
,
0.286
,
22
,
3
,
0
,
1
],
[
'이재원'
,
0.277
,
26
,
7
,
0
,
2
],
[
'로맥'
,
0.254
,
33
,
4
,
0
,
9
],
[
'한유섬'
,
0.252
,
32
,
7
,
0
,
4
],
[
'김강민'
,
0.243
,
17
,
4
,
0
,
1
],
[
'정의윤'
,
0.241
,
14
,
0
,
0
,
4
],
[
'추신수'
,
0.228
,
29
,
1
,
0
,
8
],
[
'최지훈'
,
0.195
,
15
,
2
,
1
,
1
],
[
'오태곤'
,
0.193
,
11
,
2
,
0
,
2
],
[
'최정'
,
0.293
,
49
,
8
,
0
,
13
],
[
'추신수'
,
0.263
,
44
,
4
,
1
,
8
],
[
'로맥'
,
0.253
,
46
,
6
,
0
,
13
],
[
'박성한'
,
0.297
,
38
,
8
,
0
,
1
],
[
'최주환'
,
0.304
,
35
,
7
,
0
,
4
],
[
'최지훈'
,
0.237
,
32
,
4
,
1
,
3
],
[
'김성현'
,
0.278
,
27
,
4
,
0
,
2
],
[
'한유섬'
,
0.250
,
41
,
9
,
0
,
6
],
[
'이흥련'
,
0.281
,
16
,
1
,
0
,
0
],
[
'이재원'
,
0.258
,
34
,
9
,
0
,
2
],
[
'정현'
,
0.190
,
4
,
2
,
0
,
0
],
[
'김강민'
,
0.242
,
22
,
5
,
1
,
3
],
[
'김찬형'
,
0.174
,
4
,
1
,
0
,
0
],
[
'오태곤'
,
0.232
,
19
,
2
,
0
,
4
],
[
'오준혁'
,
0.207
,
6
,
1
,
0
,
1
],
[
'정의윤'
,
0.224
,
22
,
0
,
0
,
5
],
[
'고종욱'
,
0.250
,
13
,
0
,
0
,
0
],
]
var
ssg_pitcher
=
[
...
...
@@ -298,5 +334,5 @@ var ssg_pitcher = [
[
'양선률'
,
30.0
,
0.500
],
[
'정수민'
,
17.3
,
0.284
],
[
'김정빈'
,
19.4
,
0.304
],
[
'이건욱'
,
2
8.1
,
0.317
],
[
'이건욱'
,
2
6.4
,
0.333
],
]
\ No newline at end of file
...
...
predict.js
0 → 100644
View file @
9f51a69
function
add_predict
(){
var
s
=
""
;
s
+=
(
"<option value="
+
10
+
">"
+
10
+
"</option>"
);
s
+=
(
"<option value="
+
20
+
">"
+
20
+
"</option>"
);
s
+=
(
"<option value="
+
50
+
">"
+
50
+
"</option>"
);
s
+=
(
"<option value="
+
70
+
">"
+
70
+
"</option>"
);
s
+=
(
"<option value="
+
100
+
">"
+
100
+
"</option>"
);
s
+=
(
"<option value="
+
500
+
">"
+
500
+
"</option>"
);
s
+=
(
"<option value="
+
1000
+
">"
+
1000
+
"</option>"
);
s
+=
(
"<option value="
+
5000
+
">"
+
5000
+
"</option>"
);
s
+=
(
"<option value="
+
10000
+
">"
+
10000
+
"</option>"
);
s
+=
(
"<option value="
+
50000
+
">"
+
50000
+
"</option>"
);
s
+=
(
"<option value="
+
100000
+
">"
+
100000
+
"</option>"
);
document
.
getElementById
(
'pr'
).
innerHTML
=
s
;
}
function
predict
(
value
,
hitter_list1
,
hitter_list2
,
pitcher1
,
pitcher2
){
var
score
=
[
0
,
0
];
var
w
=
0
;
var
h
=
0
;
var
d
=
0
;
for
(
var
i
=
0
;
i
<
value
;
i
++
){
score
=
algorithms
(
hitter_list1
,
hitter_list2
,
pitcher1
,
pitcher2
);
if
(
score
[
0
]
>
score
[
1
]){
w
++
;
}
else
if
(
score
[
0
]
<
score
[
1
]){
h
++
;
}
else
{
d
++
;
}
}
document
.
getElementById
(
'jstest'
).
innerHTML
=
"예측 결과"
+
"<br\>"
+
"TEST "
+
value
+
"번"
+
"<br\><br\>"
+
"원정팀 승리 횟수 : "
+
w
+
"<br\>"
+
"홈팀 승리 횟수 : "
+
h
+
"<br\>"
+
"무승부 횟수 : "
+
d
+
"<br\><br\>"
+
"원정팀 승리 확률 : "
+
w
*
100
/
value
+
"%"
+
"<br\>"
+
"홈팀 승리 확률 : "
+
h
*
100
/
value
+
"%"
+
"<br\>"
;
}
function
algorithms
(
hitter_list1
,
hitter_list2
,
pitcher1
,
pitcher2
){
var
base1
=
0
;
var
base2
=
0
;
var
base3
=
0
;
//1이면 주자 있고 0이면 비어있는것
var
out
=
0
;
var
ining
=
1
;
var
home_away
=
1
;
//아웃카운트, 이닝, home이면 1이고 away이면 2.
var
score1
=
0
;
var
score2
=
0
;
var
hitter_num1
=
1
;
var
hitter_num2
=
1
;
var
hit
=
false
;
while
(
true
){
if
(
ining
==
9
&&
home_away
==
2
&&
score1
<
score2
){
//9회 초 후 home팀이 이기고 있을 때!
break
;
}
else
if
(
ining
==
10
&&
home_away
==
1
&&
score1
>
score2
&&
hit
==
false
){
//9회 말 후 home팀이 이기고 있을 때!
break
;
}
else
if
(
ining
>
9
&&
score1
<
score2
){
//9회 말 후 home팀이 이기고 있을 때!
break
;
}
else
if
(
ining
>=
11
&&
home_away
==
1
&&
hit
==
false
&&
score1
>
score2
){
//연장 이후 원정팀이 이기고 있을 때!
break
;
}
else
if
(
ining
>=
10
&&
home_away
==
2
&&
hit
==
true
&&
score1
<
score2
){
//끝내기
break
;
}
else
if
(
ining
==
13
&&
score1
==
score2
){
//무승부
break
;
}
if
(
home_away
==
1
){
var
hitter
=
hitter_list1
[
hitter_num1
];
//hitter = hitter_list1[hitter_number1%9]
var
pitcher
=
pitcher2
;
//pitcher = pitcher1
}
else
if
(
home_away
==
2
){
var
hitter
=
hitter_list2
[
hitter_num2
];
//hitter = hitter_list2[hitter_number2%9]
var
pitcher
=
pitcher1
;
//pitcher = pitcher2
}
var
num
=
Math
.
random
();
//hitter_number1 = hitter_number(kia); hitter_number2 = hitter_number(dusan);
var
one
=
0
;
var
two
=
0
;
var
three
=
0
;
var
homerun
=
0
;
one
=
pitcher
[
2
]
*
(
hitter
[
2
]
-
hitter
[
3
]
-
hitter
[
4
]
-
hitter
[
5
])
/
hitter
[
2
];
two
=
pitcher
[
2
]
*
hitter
[
3
]
/
hitter
[
2
];
three
=
pitcher
[
2
]
*
hitter
[
4
]
/
hitter
[
2
];
homerun
=
pitcher
[
2
]
*
hitter
[
5
]
/
hitter
[
2
];
hit
=
true
;
if
(
num
<=
one
){
//안타
var
num1
=
Math
.
random
();
if
(
num1
<=
0.5
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
;
break
;
case
2
:
score2
=
score2
+
base3
;
break
;
}
base3
=
base2
;
base2
=
base1
;
base1
=
1
;
}
else
{
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
;
break
;
}
base3
=
base1
;
base2
=
0
;
base1
=
1
;
}
}
else
if
((
one
<
num
)
&&
(
num
<=
one
+
two
)){
//2루타
var
num2
=
Math
.
random
();
if
(
num2
<=
0.4
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
;
break
;
}
base3
=
base1
;
base2
=
1
;
base1
=
0
;
}
else
if
(
0.4
<
num2
&&
num2
<=
0.7
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
+
base1
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
+
base1
;
break
;
}
base3
=
0
;
base2
=
1
;
base1
=
0
;
}
else
{
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
;
break
;
}
base3
=
0
;
base2
=
1
;
base1
=
0
;
}
}
else
if
((
one
+
two
<
num
)
&&
(
num
<=
one
+
two
+
three
)){
//3루타
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
+
base1
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
+
base1
;
break
;
}
base3
=
1
;
base2
=
0
;
base1
=
0
;
}
else
if
(
one
+
two
+
three
<
num
&&
num
<=
one
+
two
+
three
+
homerun
){
//홈런
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
+
base1
+
1
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
+
base1
+
1
;
break
;
}
base3
=
0
;
base2
=
0
;
base1
=
0
;
}
else
if
(
pitcher
[
2
]
<
num
&&
(
num
<=
pitcher
[
2
]
+
pitcher
[
1
]
*
0.01
)){
//볼넷
if
(
base1
==
1
&&
base2
==
1
&&
base3
==
1
){
//만루 밀어내기 득점 -> 스코어 ++
if
(
home_away
==
1
){
score1
++
;
}
else
{
score2
++
;
}
}
else
{
//스코어 추가되지 않는 경우
if
((
base2
==
1
&&
base1
==
0
)
||
(
base3
==
1
&&
base1
==
0
)
||
(
base2
==
1
&&
base3
==
1
&&
base1
==
0
)){
//2루만 채워져있거나 3루만 채워져있거나 2,3루만 채워져있거나
base1
=
1
;
}
else
if
(
base1
==
1
&&
base3
==
1
&&
base2
==
0
){
//1루 3루 채워져있고 2루 비워져있거나
base2
=
base1
;
base1
=
1
;
}
else
{
base3
=
base2
;
base2
=
base1
;
base1
=
1
;
}
}
}
else
{
//아웃
out
++
;
}
if
(
out
>=
3
){
switch
(
home_away
){
case
1
:
home_away
=
2
;
hit
=
false
;
break
;
case
2
:
home_away
=
1
;
ining
++
;
hit
=
false
;
break
;
}
out
=
0
;
base1
=
0
;
base2
=
0
;
base3
=
0
;
}
else
{
if
(
home_away
==
1
){
hitter_num1
++
;
if
(
hitter_num1
>=
10
){
hitter_num1
=
1
;
}
}
else
if
(
home_away
==
2
){
hitter_num2
++
;
if
(
hitter_num2
>=
10
){
hitter_num2
=
1
;
}
}
}
}
var
score
=
[
score1
,
score2
];
return
score
;
}
server.js
View file @
9f51a69
const
express
=
require
(
'express'
);
const
app
=
express
();
app
.
use
(
express
.
static
(
__dirname
));
app
.
listen
(
8080
,
function
(){
console
.
log
(
'listening on 8080'
);
});
app
.
get
(
'/'
,
function
(
req
,
res
){
res
.
send
File
(
__dirname
+
'/main.html'
);
app
.
get
(
'/
test
'
,
function
(
req
,
res
){
res
.
send
(
'test'
);
});
app
.
get
(
'/
main.html
'
,
function
(
req
,
res
){
app
.
get
(
'/'
,
function
(
req
,
res
){
res
.
sendFile
(
__dirname
+
'/main.html'
);
res
.
sendFile
(
__dirname
+
'/main.css'
);
});
\ No newline at end of file
app
.
get
(
'/introduction.html'
,
function
(
req
,
res
){
res
.
sendFile
(
__dirname
+
'/introduction.html'
);
});
app
.
get
(
'/calendar.html'
,
function
(
req
,
res
){
res
.
sendFile
(
__dirname
+
'/calendar.html'
);
});
app
.
get
(
'/simulation.html'
,
function
(
req
,
res
){
res
.
sendFile
(
__dirname
+
'/simulation.html'
);
});
...
...
simulation.css
View file @
9f51a69
...
...
@@ -78,6 +78,10 @@ body{
font-size
:
15px
;
border-radius
:
5px
;
}
.t1
:hover
{
color
:
#0053b3
;
background-color
:
#2E294E
;
}
.row
{
display
:
flex
;
justify-content
:
space-evenly
;
...
...
@@ -102,6 +106,10 @@ body{
font-size
:
15px
;
border-radius
:
5px
;
}
.t2
:hover
{
color
:
#be4209
;
background-color
:
#2E294E
;
}
.l
{
width
:
33%
;
height
:
200px
;
...
...
@@ -118,24 +126,26 @@ body{
text-align
:
center
;
}
.simul
{
width
:
50%
;
height
:
150px
;
display
:
flex
;
float
:
left
;
margin-top
:
50px
;
margin-left
:
250px
;
}
.but
{
height
:
150px
;
margin
:
0px
auto
;
margin
:
auto
;
text-align
:
center
;
}
.simulbtr
{
width
:
2
5
0px
;
width
:
2
0
0px
;
height
:
50px
;
color
:
#c9d6de
;
border
:
1px
solid
#c9d6de
;
background
:
black
;
font-size
:
30px
;
margin-top
:
50px
;
font-size
:
20px
;
border-radius
:
5px
;
margin-right
:
5px
;
}
.simulbtr
:hover
{
color
:
#7700ff
;
background-color
:
#2E294E
;
}
.tb
{
padding
:
10px
0px
0px
90px
;
...
...
@@ -156,3 +166,9 @@ td{
overflow-x
:
auto
;
background-color
:
white
;
}
#select_list
{
width
:
50%
;
margin
:
auto
;
text-align
:
center
;
margin-bottom
:
50px
;
}
\ No newline at end of file
...
...
simulation.html
View file @
9f51a69
...
...
@@ -6,6 +6,7 @@
<script
src =
"player.js"
></script>
<script
src =
"temp_algorithm.js"
></script>
<script
src =
"simulation.js"
></script>
<script
src =
"predict.js"
></script>
</head>
<body>
<div
class=
"container1"
>
...
...
@@ -125,12 +126,11 @@
<img
src=
"pngs/dusan.png"
id=
"home"
class=
"vs"
>
</div>
<div
class=
"simul"
>
<div
class=
"but"
>
<input
type=
"button"
onclick=
"pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2);"
class=
"simulbtr"
value=
"시뮬레이션"
>
<input
type=
"button"
onclick=
"add_predict();"
class=
"simulbtr"
value=
"승률예측"
>
</div>
<div
class=
"result"
>
</div>
<div
id=
"select_list"
>
<select
name=
"pr"
id=
"pr"
onclick=
"predict(this.value, hitter_list1, hitter_list2, pitcher1, pitcher2);"
></select>
</div>
<div
id=
"jstest"
></div>
</div>
...
...
temp_algorithm.js
View file @
9f51a69
...
...
@@ -193,8 +193,84 @@ function pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2){//algorit
}
else
{
//아웃
var
ran
=
Math
.
random
()
*
0.2
;
if
(
ran
>
0.197
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
+
base1
+
1
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
+
base1
+
1
;
break
;
}
base3
=
0
;
base2
=
0
;
base1
=
0
;
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"홈런!"
);
}
else
if
(
ran
>
0.1955
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
+
base1
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
+
base1
;
break
;
}
base3
=
1
;
base2
=
0
;
base1
=
0
;
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"3루타!"
);
}
else
if
(
ran
>
0.18
){
var
n
=
Math
.
random
();
if
(
n
<=
0.4
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
;
break
;
}
base3
=
base1
;
base2
=
1
;
base1
=
0
;
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"2루타!"
);
}
else
if
(
0.4
<
n
&&
n
<=
0.7
){
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
+
base1
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
+
base1
;
break
;
}
base3
=
0
;
base2
=
1
;
base1
=
0
;
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"2루타!"
);
}
else
{
switch
(
home_away
){
case
1
:
score1
=
score1
+
base3
+
base2
;
break
;
case
2
:
score2
=
score2
+
base3
+
base2
;
break
;
}
base3
=
0
;
base2
=
1
;
base1
=
0
;
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"2루타!"
);
}
}
else
{
out
++
;
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"아웃!"
);
}
}
...
...
@@ -234,4 +310,6 @@ function pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2){//algorit
}
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
"<br\><br\>"
+
"최종스코어 : "
+
score1
+
"vs"
+
score2
);
var
score
=
[
score1
,
score2
];
return
score
;
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment