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-09 06:53:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e06743c1f39324b74f295b10d6b9875e445376f8
e06743c1
1 parent
d90fdead
complete(except introduction)
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1183 additions
and
143 deletions
player.js
simulation.css
simulation.html
simulation.js
temp_algorithm.js
player.js
0 → 100644
View file @
e06743c
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
]
]
var
dusan_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'로켓'
,
7.4
,
0.251
],
[
'미란다'
,
12.5
,
0.243
],
[
'최원준'
,
5.6
,
0.237
],
[
'박정수'
,
10.2
,
0.302
],
[
'곽빈'
,
16.7
,
0.256
],
[
'유희관'
,
7.6
,
0.409
],
[
'조제영'
,
16.7
,
0.367
],
[
'이영하'
,
12.8
,
0.388
],
]
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
],
]
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
],
[
'김이환'
,
16.7
,
0.283
],
[
'윤호솔'
,
10.8
,
0.222
],
[
'배동현'
,
12.5
,
0.244
],
]
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
],
]
var
kia_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'브룩스'
,
5.3
,
0.307
],
[
'멩덴'
,
10
,
0.243
],
[
'이의리'
,
14
,
0.223
],
[
'임기영'
,
7.1
,
0.254
],
[
'김현수'
,
14.5
,
0.243
],
[
'이민우'
,
7.9
,
0.346
],
[
'남재현'
,
27.8
,
0.208
],
[
'김유신'
,
16.2
,
0.269
],
]
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
],
]
var
kiwoom_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'요키시'
,
6.6
,
0.27
],
[
'한현희'
,
8.8
,
0.261
],
[
'최원태'
,
7.7
,
0.276
],
[
'안우진'
,
10.4
,
0.269
],
[
'브리검'
,
13.3
,
0.243
],
[
'이승호'
,
18
,
0.263
],
[
'스미스'
,
11.6
,
0.237
],
[
'장재영'
,
26.5
,
0.217
],
[
'김정인'
,
12.5
,
0.246
],
]
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
],
]
var
kt_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'데스파이네'
,
11.3
,
0.213
],
[
'고영표'
,
3.9
,
0.243
],
[
'배제성'
,
14.0
,
0
,
224
],
[
'소형준'
,
12.3
,
0.269
],
[
'김민수'
,
11.8
,
0.299
],
[
'쿠에바스'
,
12.0
,
0.306
],
[
'이정현'
,
12.0
,
0.318
],
]
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
],
]
var
lg_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'수아레즈'
,
9.6
,
0.208
],
[
'정찬헌'
,
5.6
,
0.271
],
[
'켈리'
,
9.6
,
0.228
],
[
'이민호'
,
11.5
,
0.234
],
[
'배재준'
,
6.2
,
0.356
],
[
'차우찬'
,
9.5
,
0.211
],
[
'함덕주'
,
17.2
,
0.224
],
[
'김윤식'
,
17.2
,
0.254
],
[
'임찬규'
,
25.8
,
0.476
],
[
'이상영'
,
12.0
,
0.258
],
]
var
lotte_hitter
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
'이대호'
,
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.235
,
8
,
0
,
0
,
0
],
]
var
lotte_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'스트레일리'
,
8.7
,
0.268
],
[
'박세웅'
,
8.3
,
0.230
],
[
'나균안'
,
9.4
,
0.274
],
[
'프랑코'
,
11.0
,
0.234
],
[
'김진욱'
,
20.0
,
0.261
],
[
'서준원'
,
13.9
,
0.299
],
[
'이승헌'
,
19.6
,
0.325
],
[
'노경은'
,
10.7
,
0.344
],
]
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.067
,
2
,
0
,
0
,
0
],
]
var
nc_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'루친스키'
,
9.0
,
0.235
],
[
'파슨스'
,
11.9
,
0.219
],
[
'송명기'
,
7.2
,
0.348
],
[
'신민혁'
,
7.8
,
0.245
],
[
'강동연'
,
9.0
,
0.271
],
[
'김진호'
,
42.9
,
0.500
],
[
'김영규'
,
11.5
,
0.309
],
[
'이재학'
,
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
],
]
var
samsung_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'뷰캐넌'
,
8.5
,
0.228
],
[
'원태인'
,
8.6
,
0.246
],
[
'라이블리'
,
9.3
,
0.190
],
[
'백정현'
,
10.5
,
0.250
],
[
'최채흥'
,
14.5
,
0.346
],
[
'이승민'
,
10.2
,
0.294
],
[
'김윤수'
,
19.3
,
0.348
],
[
'구준범'
,
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
],
]
var
ssg_pitcher
=
[
[
'선수명'
,
'볼넷%'
,
'피안타율'
],
[
'폰트'
,
7.1
,
0.206
],
[
'박종훈'
,
7.2
,
0.205
],
[
'문승원'
,
8.5
,
0.220
],
[
'오원석'
,
13.6
,
0.251
],
[
'르위키'
,
3.6
,
0.278
],
[
'조영우'
,
9.5
,
0.321
],
[
'양선률'
,
30.0
,
0.500
],
[
'정수민'
,
17.3
,
0.284
],
[
'김정빈'
,
19.4
,
0.304
],
[
'이건욱'
,
28.1
,
0.317
],
]
\ No newline at end of file
simulation.css
View file @
e06743c
...
...
@@ -138,7 +138,7 @@ body{
border-radius
:
5px
;
}
.tb
{
padding
:
10px
0px
0px
135
px
;
padding
:
10px
0px
0px
90
px
;
}
table
{
border
:
1px
solid
#444444
;
...
...
simulation.html
View file @
e06743c
...
...
@@ -3,103 +3,9 @@
<head>
<title>
Simulation
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"simulation.css"
>
<script
src =
"kia.js"
></script>
<script
src =
"dusan.js"
></script>
<script
src =
"algorithm.js"
></script>
<script
src =
"shuffle_list.js"
></script>
<script
src =
"aaaa.js"
></script>
<script
src =
"player.js"
></script>
<script
src =
"temp_algorithm.js"
></script>
<script>
var
wonjung
=
8
;
var
home
=
6
;
function
imgchange1
(
a
){
var
img
=
document
.
getElementById
(
"wonjung"
);
if
(
a
==
1
){
wonjung
=
1
;
img
.
setAttribute
(
"src"
,
"pngs/samsung.png"
);
}
else
if
(
a
==
2
){
wonjung
=
2
;
img
.
setAttribute
(
"src"
,
"pngs/nc.png"
);
}
else
if
(
a
==
3
){
wonjung
=
3
;
img
.
setAttribute
(
"src"
,
"pngs/LG.png"
);
}
else
if
(
a
==
4
){
wonjung
=
4
;
img
.
setAttribute
(
"src"
,
"pngs/kt.png"
);
}
else
if
(
a
==
5
){
wonjung
=
5
;
img
.
setAttribute
(
"src"
,
"pngs/ssg.png"
);
}
else
if
(
a
==
6
){
wonjung
=
6
;
img
.
setAttribute
(
"src"
,
"pngs/dusan.png"
);
}
else
if
(
a
==
7
){
wonjung
=
7
;
img
.
setAttribute
(
"src"
,
"pngs/kiwoom.png"
);
}
else
if
(
a
==
8
){
wonjung
=
8
;
img
.
setAttribute
(
"src"
,
"pngs/kia.png"
);
}
else
if
(
a
==
9
){
wonjung
=
9
;
img
.
setAttribute
(
"src"
,
"pngs/hanhwa.png"
);
}
else
if
(
a
==
10
){
wonjung
=
10
;
img
.
setAttribute
(
"src"
,
"pngs/Lotte.png"
);
}
}
function
imgchange2
(
a
){
var
img
=
document
.
getElementById
(
"home"
);
if
(
a
==
1
){
home
=
1
;
img
.
setAttribute
(
"src"
,
"pngs/samsung.png"
);
}
else
if
(
a
==
2
){
home
=
2
;
img
.
setAttribute
(
"src"
,
"pngs/nc.png"
);
}
else
if
(
a
==
3
){
home
=
3
;
img
.
setAttribute
(
"src"
,
"pngs/LG.png"
);
}
else
if
(
a
==
4
){
home
=
4
;
img
.
setAttribute
(
"src"
,
"pngs/kt.png"
);
}
else
if
(
a
==
5
){
home
=
5
;
img
.
setAttribute
(
"src"
,
"pngs/ssg.png"
);
}
else
if
(
a
==
6
){
home
=
6
;
img
.
setAttribute
(
"src"
,
"pngs/dusan.png"
);
}
else
if
(
a
==
7
){
home
=
7
;
img
.
setAttribute
(
"src"
,
"pngs/kiwoom.png"
);
}
else
if
(
a
==
8
){
home
=
8
;
img
.
setAttribute
(
"src"
,
"pngs/kia.png"
);
}
else
if
(
a
==
9
){
home
=
9
;
img
.
setAttribute
(
"src"
,
"pngs/hanhwa.png"
);
}
else
if
(
a
==
10
){
home
=
10
;
img
.
setAttribute
(
"src"
,
"pngs/Lotte.png"
);
}
}
</script>
<script
src =
"simulation.js"
></script>
</head>
<body>
<div
class=
"container1"
>
...
...
@@ -127,52 +33,82 @@
</div>
<div
class=
"selection"
>
<div
class=
"row row1"
>
<button
type=
"submit"
onclick=
"imgchange1(1)"
class=
"t1"
>
삼성
</button>
<button
type=
"submit"
onclick=
"imgchange1(2)"
class=
"t1"
>
NC
</button>
<button
type=
"submit"
onclick=
"imgchange1(3)"
class=
"t1"
>
LG
</button>
<button
type=
"submit"
onclick=
"imgchange1(4)"
class=
"t1"
>
KT
</button>
<button
type=
"submit"
onclick=
"imgchange1(5)"
class=
"t1"
>
SSG
</button>
<button
type=
"submit"
onclick=
"imgchange1(1)
; w(1);
"
class=
"t1"
>
삼성
</button>
<button
type=
"submit"
onclick=
"imgchange1(2)
; w(2);
"
class=
"t1"
>
NC
</button>
<button
type=
"submit"
onclick=
"imgchange1(3)
; w(3);
"
class=
"t1"
>
LG
</button>
<button
type=
"submit"
onclick=
"imgchange1(4)
; w(4);
"
class=
"t1"
>
KT
</button>
<button
type=
"submit"
onclick=
"imgchange1(5)
; w(5);
"
class=
"t1"
>
SSG
</button>
</div>
<div
class=
"row row2"
>
<button
type=
"submit"
onclick=
"imgchange1(6)"
class=
"t1"
>
두산
</button>
<button
type=
"submit"
onclick=
"imgchange1(7)"
class=
"t1"
>
키움
</button>
<button
type=
"submit"
onclick=
"imgchange1(8)"
class=
"t1"
>
KIA
</button>
<button
type=
"submit"
onclick=
"imgchange1(9)"
class=
"t1"
>
한화
</button>
<button
type=
"submit"
onclick=
"imgchange1(10)"
class=
"t1"
>
롯데
</button>
<button
type=
"submit"
onclick=
"imgchange1(6)
; w(6);
"
class=
"t1"
>
두산
</button>
<button
type=
"submit"
onclick=
"imgchange1(7)
; w(7);
"
class=
"t1"
>
키움
</button>
<button
type=
"submit"
onclick=
"imgchange1(8)
; w(8);
"
class=
"t1"
>
KIA
</button>
<button
type=
"submit"
onclick=
"imgchange1(9)
; w(9);
"
class=
"t1"
>
한화
</button>
<button
type=
"submit"
onclick=
"imgchange1(10)
; w(10);
"
class=
"t1"
>
롯데
</button>
</div>
</div>
<div
class=
"tb"
>
<table>
<tbody>
<tr>
<td>
1번 타자
</td><td>
-
</td>
<td>
1번 타자
</td>
<td><select
name=
"won"
id=
"won1"
onclick=
"hitter1list_append(1,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
2번 타자
</td><td>
-
</td>
<td>
2번 타자
</td>
<td><select
name=
"won"
id=
"won2"
onclick=
"hitter1list_append(2,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
3번 타자
</td><td>
-
</td>
<td>
3번 타자
</td>
<td><select
name=
"won"
id=
"won3"
onclick=
"hitter1list_append(3,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
4번 타자
</td><td>
-
</td>
<td>
4번 타자
</td>
<td><select
name=
"won"
id=
"won4"
onclick=
"hitter1list_append(4,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
5번 타자
</td><td>
-
</td>
<td>
5번 타자
</td>
<td><select
name=
"won"
id=
"won5"
onclick=
"hitter1list_append(5,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
6번 타자
</td><td>
-
</td>
<td>
6번 타자
</td>
<td><select
name=
"won"
id=
"won6"
onclick=
"hitter1list_append(6,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
7번 타자
</td><td>
-
</td>
<td>
7번 타자
</td>
<td><select
name=
"won"
id=
"won7"
onclick=
"hitter1list_append(7,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
8번 타자
</td><td>
-
</td>
<td>
8번 타자
</td>
<td><select
name=
"won"
id=
"won8"
onclick=
"hitter1list_append(8,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
9번 타자
</td><td>
-
</td>
<td>
9번 타자
</td>
<td><select
name=
"won"
id=
"won9"
onclick=
"hitter1list_append(9,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
선발 투수
</td><td>
-
</td>
<td>
선발 투수
</td>
<td><select
name=
"won"
id=
"won"
onclick=
"pitcher1list_append(this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
</tbody>
</table>
...
...
@@ -190,7 +126,7 @@
</div>
<div
class=
"simul"
>
<div
class=
"but"
>
<input
type=
"button"
onclick=
pre_algorithm()
class=
"simulbtr"
value=
"시뮬레이션"
>
<input
type=
"button"
onclick=
"pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2);"
class=
"simulbtr"
value=
"시뮬레이션"
>
</div>
<div
class=
"result"
>
...
...
@@ -204,52 +140,82 @@
</div>
<div
class=
"selection"
>
<div
class=
"row row1"
>
<button
type=
"submit"
onclick=
"imgchange2(1)"
class=
"t2"
>
삼성
</button>
<button
type=
"submit"
onclick=
"imgchange2(2)"
class=
"t2"
>
NC
</button>
<button
type=
"submit"
onclick=
"imgchange2(3)"
class=
"t2"
>
LG
</button>
<button
type=
"submit"
onclick=
"imgchange2(4)"
class=
"t2"
>
KT
</button>
<button
type=
"submit"
onclick=
"imgchange2(5)"
class=
"t2"
>
SSG
</button>
<button
type=
"submit"
onclick=
"imgchange2(1)
;
"
class=
"t2"
>
삼성
</button>
<button
type=
"submit"
onclick=
"imgchange2(2)
;
"
class=
"t2"
>
NC
</button>
<button
type=
"submit"
onclick=
"imgchange2(3)
;
"
class=
"t2"
>
LG
</button>
<button
type=
"submit"
onclick=
"imgchange2(4)
;
"
class=
"t2"
>
KT
</button>
<button
type=
"submit"
onclick=
"imgchange2(5)
;
"
class=
"t2"
>
SSG
</button>
</div>
<div
class=
"row row2"
>
<button
type=
"submit"
onclick=
"imgchange2(6)"
class=
"t2"
>
두산
</button>
<button
type=
"submit"
onclick=
"imgchange2(7)"
class=
"t2"
>
키움
</button>
<button
type=
"submit"
onclick=
"imgchange2(8)"
class=
"t2"
>
KIA
</button>
<button
type=
"submit"
onclick=
"imgchange2(9)"
class=
"t2"
>
한화
</button>
<button
type=
"submit"
onclick=
"imgchange2(10)"
class=
"t2"
>
롯데
</button>
<button
type=
"submit"
onclick=
"imgchange2(6)
;
"
class=
"t2"
>
두산
</button>
<button
type=
"submit"
onclick=
"imgchange2(7)
;
"
class=
"t2"
>
키움
</button>
<button
type=
"submit"
onclick=
"imgchange2(8)
;
"
class=
"t2"
>
KIA
</button>
<button
type=
"submit"
onclick=
"imgchange2(9)
;
"
class=
"t2"
>
한화
</button>
<button
type=
"submit"
onclick=
"imgchange2(10)
;
"
class=
"t2"
>
롯데
</button>
</div>
</div>
<div
class=
"tb"
>
<table>
<tbody>
<tr>
<td>
1번 타자
</td><td>
-
</td>
<td>
1번 타자
</td>
<td><select
name=
"hom"
id=
"hom1"
onclick=
"hitter2list_append(1,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
2번 타자
</td><td>
-
</td>
<td>
2번 타자
</td>
<td><select
name=
"hom"
id=
"hom2"
onclick=
"hitter2list_append(2,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
3번 타자
</td><td>
-
</td>
<td>
3번 타자
</td>
<td><select
name=
"hom"
id=
"hom3"
onclick=
"hitter2list_append(3,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
4번 타자
</td><td>
-
</td>
<td>
4번 타자
</td>
<td><select
name=
"hom"
id=
"hom4"
onclick=
"hitter2list_append(4,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
5번 타자
</td><td>
-
</td>
<td>
5번 타자
</td>
<td><select
name=
"hom"
id=
"hom5"
onclick=
"hitter2list_append(5,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
6번 타자
</td><td>
-
</td>
<td>
6번 타자
</td>
<td><select
name=
"hom"
id=
"hom6"
onclick=
"hitter2list_append(6,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
7번 타자
</td><td>
-
</td>
<td>
7번 타자
</td>
<td><select
name=
"hom"
id=
"hom7"
onclick=
"hitter2list_append(7,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
8번 타자
</td><td>
-
</td>
<td>
8번 타자
</td>
<td><select
name=
"hom"
id=
"hom8"
onclick=
"hitter2list_append(8,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
9번 타자
</td><td>
-
</td>
<td>
9번 타자
</td>
<td><select
name=
"hom"
id=
"hom9"
onclick=
"hitter2list_append(9,this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
<tr>
<td>
선발 투수
</td><td>
-
</td>
<td>
선발 투수
</td>
<td><select
name=
"hom"
id=
"hom"
onclick=
"pitcher2list_append(this.value);"
>
<option
value=
""
>
선택
</option>
</select></td>
</tr>
</tbody>
</table>
...
...
simulation.js
0 → 100644
View file @
e06743c
var
wonjung
=
8
;
var
home
=
6
;
var
hitter_list1
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
];
var
hitter_list2
=
[
[
'선수명'
,
'AVG'
,
'H'
,
'2B'
,
'3B'
,
'HR'
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
[
''
,
0
,
0
,
0
,
0
,
0
],
];
var
pitcher1
=
[
''
,
0
,
0
];
var
pitcher2
=
[
''
,
0
,
0
];
function
imgchange1
(
a
){
var
img
=
document
.
getElementById
(
"wonjung"
);
if
(
a
==
1
){
wonjung
=
1
;
img
.
setAttribute
(
"src"
,
"pngs/samsung.png"
);
}
else
if
(
a
==
2
){
wonjung
=
2
;
img
.
setAttribute
(
"src"
,
"pngs/nc.png"
);
}
else
if
(
a
==
3
){
wonjung
=
3
;
img
.
setAttribute
(
"src"
,
"pngs/LG.png"
);
}
else
if
(
a
==
4
){
wonjung
=
4
;
img
.
setAttribute
(
"src"
,
"pngs/kt.png"
);
}
else
if
(
a
==
5
){
wonjung
=
5
;
img
.
setAttribute
(
"src"
,
"pngs/ssg.png"
);
}
else
if
(
a
==
6
){
wonjung
=
6
;
img
.
setAttribute
(
"src"
,
"pngs/dusan.png"
);
}
else
if
(
a
==
7
){
wonjung
=
7
;
img
.
setAttribute
(
"src"
,
"pngs/kiwoom.png"
);
}
else
if
(
a
==
8
){
wonjung
=
8
;
img
.
setAttribute
(
"src"
,
"pngs/kia.png"
);
}
else
if
(
a
==
9
){
wonjung
=
9
;
img
.
setAttribute
(
"src"
,
"pngs/hanhwa.png"
);
}
else
if
(
a
==
10
){
wonjung
=
10
;
img
.
setAttribute
(
"src"
,
"pngs/Lotte.png"
);
}
hitter1_option
(
wonjung
);
pitcher1_option
(
wonjung
);
}
function
imgchange2
(
a
){
var
img
=
document
.
getElementById
(
"home"
);
if
(
a
==
1
){
home
=
1
;
img
.
setAttribute
(
"src"
,
"pngs/samsung.png"
);
}
else
if
(
a
==
2
){
home
=
2
;
img
.
setAttribute
(
"src"
,
"pngs/nc.png"
);
}
else
if
(
a
==
3
){
home
=
3
;
img
.
setAttribute
(
"src"
,
"pngs/LG.png"
);
}
else
if
(
a
==
4
){
home
=
4
;
img
.
setAttribute
(
"src"
,
"pngs/kt.png"
);
}
else
if
(
a
==
5
){
home
=
5
;
img
.
setAttribute
(
"src"
,
"pngs/ssg.png"
);
}
else
if
(
a
==
6
){
home
=
6
;
img
.
setAttribute
(
"src"
,
"pngs/dusan.png"
);
}
else
if
(
a
==
7
){
home
=
7
;
img
.
setAttribute
(
"src"
,
"pngs/kiwoom.png"
);
}
else
if
(
a
==
8
){
home
=
8
;
img
.
setAttribute
(
"src"
,
"pngs/kia.png"
);
}
else
if
(
a
==
9
){
home
=
9
;
img
.
setAttribute
(
"src"
,
"pngs/hanhwa.png"
);
}
else
if
(
a
==
10
){
home
=
10
;
img
.
setAttribute
(
"src"
,
"pngs/Lotte.png"
);
}
hitter2_option
(
home
);
pitcher2_option
(
home
);
}
function
hitter1_option
(
wonjung
){
var
s
=
""
;
if
(
wonjung
==
1
){
for
(
var
j
=
1
;
j
<
samsung_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
samsung_hitter
[
j
][
0
]
+
">"
+
samsung_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
2
){
for
(
var
j
=
1
;
j
<
nc_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
nc_hitter
[
j
][
0
]
+
">"
+
nc_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
3
){
for
(
var
j
=
1
;
j
<
lg_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
lg_hitter
[
j
][
0
]
+
">"
+
lg_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
4
){
for
(
var
j
=
1
;
j
<
kt_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
kt_hitter
[
j
][
0
]
+
">"
+
kt_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
5
){
for
(
var
j
=
1
;
j
<
ssg_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
ssg_hitter
[
j
][
0
]
+
">"
+
ssg_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
6
){
for
(
var
j
=
1
;
j
<
dusan_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
dusan_hitter
[
j
][
0
]
+
">"
+
dusan_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
kiwoom_hitter
[
j
][
0
]
+
">"
+
kiwoom_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
8
){
for
(
var
j
=
1
;
j
<
kia_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
kia_hitter
[
j
][
0
]
+
">"
+
kia_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
hanhwa_hitter
[
j
][
0
]
+
">"
+
hanhwa_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
10
){
for
(
var
j
=
1
;
j
<
lotte_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
lotte_hitter
[
j
][
0
]
+
">"
+
lotte_hitter
[
j
][
0
]
+
"</option>"
);
}
}
document
.
getElementById
(
'won1'
).
innerHTML
=
s
;
document
.
getElementById
(
'won2'
).
innerHTML
=
s
;
document
.
getElementById
(
'won3'
).
innerHTML
=
s
;
document
.
getElementById
(
'won4'
).
innerHTML
=
s
;
document
.
getElementById
(
'won5'
).
innerHTML
=
s
;
document
.
getElementById
(
'won6'
).
innerHTML
=
s
;
document
.
getElementById
(
'won7'
).
innerHTML
=
s
;
document
.
getElementById
(
'won8'
).
innerHTML
=
s
;
document
.
getElementById
(
'won9'
).
innerHTML
=
s
;
}
function
hitter2_option
(
wonjung
){
var
s
=
""
;
if
(
wonjung
==
1
){
for
(
var
j
=
1
;
j
<
samsung_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
samsung_hitter
[
j
][
0
]
+
">"
+
samsung_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
2
){
for
(
var
j
=
1
;
j
<
nc_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
nc_hitter
[
j
][
0
]
+
">"
+
nc_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
3
){
for
(
var
j
=
1
;
j
<
lg_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
lg_hitter
[
j
][
0
]
+
">"
+
lg_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
4
){
for
(
var
j
=
1
;
j
<
kt_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
kt_hitter
[
j
][
0
]
+
">"
+
kt_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
5
){
for
(
var
j
=
1
;
j
<
ssg_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
ssg_hitter
[
j
][
0
]
+
">"
+
ssg_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
6
){
for
(
var
j
=
1
;
j
<
dusan_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
dusan_hitter
[
j
][
0
]
+
">"
+
dusan_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
kiwoom_hitter
[
j
][
0
]
+
">"
+
kiwoom_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
8
){
for
(
var
j
=
1
;
j
<
kia_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
kia_hitter
[
j
][
0
]
+
">"
+
kia_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
hanhwa_hitter
[
j
][
0
]
+
">"
+
hanhwa_hitter
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
10
){
for
(
var
j
=
1
;
j
<
lotte_hitter
.
length
;
j
++
){
s
+=
(
"<option value="
+
lotte_hitter
[
j
][
0
]
+
">"
+
lotte_hitter
[
j
][
0
]
+
"</option>"
);
}
}
document
.
getElementById
(
'hom1'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom2'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom3'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom4'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom5'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom6'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom7'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom8'
).
innerHTML
=
s
;
document
.
getElementById
(
'hom9'
).
innerHTML
=
s
;
}
function
pitcher1_option
(
wonjung
){
var
s
=
""
;
if
(
wonjung
==
1
){
for
(
var
j
=
1
;
j
<
samsung_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
samsung_pitcher
[
j
][
0
]
+
">"
+
samsung_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
2
){
for
(
var
j
=
1
;
j
<
nc_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
nc_pitcher
[
j
][
0
]
+
">"
+
nc_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
3
){
for
(
var
j
=
1
;
j
<
lg_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
lg_pitcher
[
j
][
0
]
+
">"
+
lg_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
4
){
for
(
var
j
=
1
;
j
<
kt_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
kt_pitcher
[
j
][
0
]
+
">"
+
kt_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
5
){
for
(
var
j
=
1
;
j
<
ssg_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
ssg_pitcher
[
j
][
0
]
+
">"
+
ssg_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
6
){
for
(
var
j
=
1
;
j
<
dusan_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
dusan_pitcher
[
j
][
0
]
+
">"
+
dusan_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
kiwoom_pitcher
[
j
][
0
]
+
">"
+
kiwoom_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
8
){
for
(
var
j
=
1
;
j
<
kia_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
kia_pitcher
[
j
][
0
]
+
">"
+
kia_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
hanhwa_pitcher
[
j
][
0
]
+
">"
+
hanhwa_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
10
){
for
(
var
j
=
1
;
j
<
lotte_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
lotte_pitcher
[
j
][
0
]
+
">"
+
lotte_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
document
.
getElementById
(
'won'
).
innerHTML
=
s
;
}
function
pitcher2_option
(
wonjung
){
var
s
=
""
;
if
(
wonjung
==
1
){
for
(
var
j
=
1
;
j
<
samsung_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
samsung_pitcher
[
j
][
0
]
+
">"
+
samsung_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
2
){
for
(
var
j
=
1
;
j
<
nc_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
nc_pitcher
[
j
][
0
]
+
">"
+
nc_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
3
){
for
(
var
j
=
1
;
j
<
lg_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
lg_pitcher
[
j
][
0
]
+
">"
+
lg_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
4
){
for
(
var
j
=
1
;
j
<
kt_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
kt_pitcher
[
j
][
0
]
+
">"
+
kt_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
5
){
for
(
var
j
=
1
;
j
<
ssg_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
ssg_pitcher
[
j
][
0
]
+
">"
+
ssg_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
6
){
for
(
var
j
=
1
;
j
<
dusan_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
dusan_pitcher
[
j
][
0
]
+
">"
+
dusan_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
kiwoom_pitcher
[
j
][
0
]
+
">"
+
kiwoom_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
8
){
for
(
var
j
=
1
;
j
<
kia_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
kia_pitcher
[
j
][
0
]
+
">"
+
kia_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
hanhwa_pitcher
[
j
][
0
]
+
">"
+
hanhwa_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
else
if
(
wonjung
==
10
){
for
(
var
j
=
1
;
j
<
lotte_pitcher
.
length
;
j
++
){
s
+=
(
"<option value="
+
lotte_pitcher
[
j
][
0
]
+
">"
+
lotte_pitcher
[
j
][
0
]
+
"</option>"
);
}
}
document
.
getElementById
(
'hom'
).
innerHTML
=
s
;
}
function
hitter1list_append
(
num
,
value
){
if
(
wonjung
==
1
){
for
(
var
j
=
1
;
j
<
samsung_hitter
.
length
;
j
++
){
if
(
value
==
samsung_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
samsung_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
samsung_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
2
){
for
(
var
j
=
1
;
j
<
nc_hitter
.
length
;
j
++
){
if
(
value
==
nc_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
nc_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
nc_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
3
){
for
(
var
j
=
1
;
j
<
lg_hitter
.
length
;
j
++
){
if
(
value
==
lg_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lg_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
lg_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
4
){
for
(
var
j
=
1
;
j
<
kt_hitter
.
length
;
j
++
){
if
(
value
==
kt_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kt_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
kt_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
5
){
for
(
var
j
=
1
;
j
<
ssg_hitter
.
length
;
j
++
){
if
(
value
==
ssg_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
ssg_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
ssg_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
6
){
for
(
var
j
=
1
;
j
<
dusan_hitter
.
length
;
j
++
){
if
(
value
==
dusan_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
dusan_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
dusan_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_hitter
.
length
;
j
++
){
if
(
value
==
kiwoom_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kiwoom_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
kiwoom_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
8
){
for
(
var
j
=
1
;
j
<
kia_hitter
.
length
;
j
++
){
if
(
value
==
kia_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kia_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
kia_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_hitter
.
length
;
j
++
){
if
(
value
==
hanhwa_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
hanhwa_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
hanhwa_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
10
){
for
(
var
j
=
1
;
j
<
lotte_hitter
.
length
;
j
++
){
if
(
value
==
lotte_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lotte_hitter
[
j
].
length
;
k
++
){
hitter_list1
[
num
][
k
]
=
lotte_hitter
[
j
][
k
];
}
return
;
}
}
}
}
function
hitter2list_append
(
num
,
value
){
if
(
home
==
1
){
for
(
var
j
=
1
;
j
<
samsung_hitter
.
length
;
j
++
){
if
(
value
==
samsung_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
samsung_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
samsung_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
2
){
for
(
var
j
=
1
;
j
<
nc_hitter
.
length
;
j
++
){
if
(
value
==
nc_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
nc_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
nc_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
3
){
for
(
var
j
=
1
;
j
<
lg_hitter
.
length
;
j
++
){
if
(
value
==
lg_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lg_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
lg_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
4
){
for
(
var
j
=
1
;
j
<
kt_hitter
.
length
;
j
++
){
if
(
value
==
kt_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kt_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
kt_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
5
){
for
(
var
j
=
1
;
j
<
ssg_hitter
.
length
;
j
++
){
if
(
value
==
ssg_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
ssg_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
ssg_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
6
){
for
(
var
j
=
1
;
j
<
dusan_hitter
.
length
;
j
++
){
if
(
value
==
dusan_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
dusan_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
dusan_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_hitter
.
length
;
j
++
){
if
(
value
==
kiwoom_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kiwoom_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
kiwoom_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
8
){
for
(
var
j
=
1
;
j
<
kia_hitter
.
length
;
j
++
){
if
(
value
==
kia_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kia_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
kia_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_hitter
.
length
;
j
++
){
if
(
value
==
hanhwa_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
hanhwa_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
hanhwa_hitter
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
10
){
for
(
var
j
=
1
;
j
<
lotte_hitter
.
length
;
j
++
){
if
(
value
==
lotte_hitter
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lotte_hitter
[
j
].
length
;
k
++
){
hitter_list2
[
num
][
k
]
=
lotte_hitter
[
j
][
k
];
}
return
;
}
}
}
}
function
pitcher1list_append
(
value
){
if
(
wonjung
==
1
){
for
(
var
j
=
1
;
j
<
samsung_pitcher
.
length
;
j
++
){
if
(
value
==
samsung_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
samsung_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
samsung_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
2
){
for
(
var
j
=
1
;
j
<
nc_pitcher
.
length
;
j
++
){
if
(
value
==
nc_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
nc_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
nc_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
3
){
for
(
var
j
=
1
;
j
<
lg_pitcher
.
length
;
j
++
){
if
(
value
==
lg_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lg_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
lg_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
4
){
for
(
var
j
=
1
;
j
<
kt_pitcher
.
length
;
j
++
){
if
(
value
==
kt_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kt_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
kt_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
5
){
for
(
var
j
=
1
;
j
<
ssg_pitcher
.
length
;
j
++
){
if
(
value
==
ssg_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
ssg_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
ssg_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
6
){
for
(
var
j
=
1
;
j
<
dusan_pitcher
.
length
;
j
++
){
if
(
value
==
dusan_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
dusan_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
dusan_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_pitcher
.
length
;
j
++
){
if
(
value
==
kiwoom_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kiwoom_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
kiwoom_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
8
){
for
(
var
j
=
1
;
j
<
kia_pitcher
.
length
;
j
++
){
if
(
value
==
kia_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kia_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
kia_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_pitcher
.
length
;
j
++
){
if
(
value
==
hanhwa_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
hanhwa_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
hanhwa_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
wonjung
==
10
){
for
(
var
j
=
1
;
j
<
lotte_pitcher
.
length
;
j
++
){
if
(
value
==
lotte_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lotte_pitcher
[
j
].
length
;
k
++
){
pitcher1
[
k
]
=
lotte_pitcher
[
j
][
k
];
}
return
;
}
}
}
}
function
pitcher2list_append
(
value
){
if
(
home
==
1
){
for
(
var
j
=
1
;
j
<
samsung_pitcher
.
length
;
j
++
){
if
(
value
==
samsung_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
samsung_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
samsung_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
2
){
for
(
var
j
=
1
;
j
<
nc_pitcher
.
length
;
j
++
){
if
(
value
==
nc_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
nc_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
nc_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
3
){
for
(
var
j
=
1
;
j
<
lg_pitcher
.
length
;
j
++
){
if
(
value
==
lg_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lg_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
lg_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
4
){
for
(
var
j
=
1
;
j
<
kt_pitcher
.
length
;
j
++
){
if
(
value
==
kt_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kt_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
kt_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
5
){
for
(
var
j
=
1
;
j
<
ssg_pitcher
.
length
;
j
++
){
if
(
value
==
ssg_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
ssg_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
ssg_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
6
){
for
(
var
j
=
1
;
j
<
dusan_pitcher
.
length
;
j
++
){
if
(
value
==
dusan_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
dusan_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
dusan_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
7
){
for
(
var
j
=
1
;
j
<
kiwoom_pitcher
.
length
;
j
++
){
if
(
value
==
kiwoom_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kiwoom_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
kiwoom_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
8
){
for
(
var
j
=
1
;
j
<
kia_pitcher
.
length
;
j
++
){
if
(
value
==
kia_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
kia_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
kia_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
9
){
for
(
var
j
=
1
;
j
<
hanhwa_pitcher
.
length
;
j
++
){
if
(
value
==
hanhwa_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
hanhwa_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
hanhwa_pitcher
[
j
][
k
];
}
return
;
}
}
}
else
if
(
home
==
10
){
for
(
var
j
=
1
;
j
<
lotte_pitcher
.
length
;
j
++
){
if
(
value
==
lotte_pitcher
[
j
][
0
]){
for
(
var
k
=
0
;
k
<
lotte_pitcher
[
j
].
length
;
k
++
){
pitcher2
[
k
]
=
lotte_pitcher
[
j
][
k
];
}
return
;
}
}
}
}
hitter1_option
(
wonjung
);
pitcher1_option
(
wonjung
);
hitter2_option
(
home
);
pitcher2_option
(
home
);
\ No newline at end of file
temp_algorithm.js
View file @
e06743c
function
pre_algorithm
(){
//algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2) => html에서 가지고와야 한다.
function
pre_algorithm
(
hitter_list1
,
hitter_list2
,
pitcher1
,
pitcher2
){
//algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2) => html에서 가지고와야 한다.
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
;
...
...
@@ -26,13 +26,13 @@ function pre_algorithm(){//algorithm(hitter_list1, hitter_list2, pitcher1, pitch
}
if
(
home_away
==
1
){
var
hitter
=
kia_hitter
[
hitter_num1
];
//hitter = hitter_list1[hitter_number1%9]
var
pitcher
=
dusan_pitcher
[
1
]
;
//pitcher = pitcher1
var
hitter
=
hitter_list1
[
hitter_num1
];
//hitter = hitter_list1[hitter_number1%9]
var
pitcher
=
pitcher2
;
//pitcher = pitcher1
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
ining
+
"회 초"
+
"<br\><br\>"
);
}
else
if
(
home_away
==
2
){
var
hitter
=
dusan_hitter
[
hitter_num2
];
//hitter = hitter_list2[hitter_number2%9]
var
pitcher
=
kia_pitcher
[
1
]
;
//pitcher = pitcher2
var
hitter
=
hitter_list2
[
hitter_num2
];
//hitter = hitter_list2[hitter_number2%9]
var
pitcher
=
pitcher1
;
//pitcher = pitcher2
document
.
getElementById
(
'jstest'
).
innerHTML
+=
(
ining
+
"회 말"
+
"<br\><br\>"
);
}
...
...
Please
register
or
login
to post a comment