정주희

complete(except introduction)

1 +var dusan_hitter = [
2 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
3 + ['박건우', 0.356, 47, 9, 0, 2],
4 + ['허경민', 0.345, 49, 6, 0, 3],
5 + ['페르난데스', 0.336, 48, 5, 0, 6],
6 + ['최용제', 0.308, 8, 2, 0, 0],
7 + ['안재석', 0.304, 14, 1, 2, 0],
8 + ['김인태', 0.298, 25, 3, 0, 1],
9 + ['김재환', 0.285, 37, 4, 1, 9],
10 + ['장승현', 0.284, 23, 1, 0, 1],
11 + ['조수행', 0.278, 10, 1, 1, 0],
12 + ['양석환', 0.277, 38, 8, 0, 5],
13 + ['박계범', 0.266, 21, 5, 0, 2],
14 + ['김재호', 0.243, 18, 1, 0, 1],
15 + ['오재원', 0.22, 11, 2, 0, 0],
16 + ['강승호', 0.212, 7, 0, 0, 2],
17 + ['권민석', 0.167, 2, 1, 0, 0],
18 + ['박세혁', 0.161, 5, 0, 0, 0],
19 + ['안권수', 0.133, 2, 0, 0, 0],
20 + ['정수빈', 0.125, 4, 1, 0, 0]
21 +]
22 +
23 +var dusan_pitcher = [
24 + ['선수명', '볼넷%', '피안타율'],
25 + ['로켓', 7.4, 0.251],
26 + ['미란다', 12.5, 0.243],
27 + ['최원준', 5.6, 0.237],
28 + ['박정수', 10.2, 0.302],
29 + ['곽빈', 16.7, 0.256],
30 + ['유희관', 7.6, 0.409],
31 + ['조제영', 16.7, 0.367],
32 + ['이영하', 12.8, 0.388],
33 +]
34 +
35 +var hanhwa_hitter = [
36 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
37 + ['하주석', 0.299, 40, 7, 1, 3],
38 + ['장운호', 0.291, 30, 6, 0, 0],
39 + ['노시환', 0.279, 38, 7, 0, 7],
40 + ['정은원', 0.277, 36, 7, 2, 0],
41 + ['힐리', 0.258, 32, 6, 1, 2],
42 + ['정진호', 0.254, 15, 3, 0, 0],
43 + ['최재훈', 0.247, 20, 1, 0, 2],
44 + ['김민하', 0.246, 14, 4, 0, 1],
45 + ['노수광', 0.238, 10, 1, 0, 0],
46 + ['이해창', 0.231, 9, 3, 0, 0],
47 + ['이성열', 0.207, 12, 3, 0, 1],
48 + ['박정현', 0.196, 19, 3, 0, 0],
49 + ['유장혁', 0.169, 14, 5, 0, 1],
50 + ['임종찬', 0.163, 16, 5, 0, 1],
51 +]
52 +
53 +var hanhwa_pitcher = [
54 + ['선수명', '볼넷%', '피안타율'],
55 + ['킹험', 6.4, 0.211],
56 + ['카펜터', 11.6, 0.201],
57 + ['김민우', 10.9, 0.217],
58 + ['강재민', 9.9, 0.143],
59 + ['김범수', 14.3, 0.265],
60 + ['장시환', 14.9, 0.311],
61 + ['정우람', 13.8, 0.244],
62 + ['윤대경', 15.3, 0.222],
63 + ['김이환', 16.7, 0.283],
64 + ['윤호솔', 10.8, 0.222],
65 + ['배동현', 12.5, 0.244],
66 +]
67 +
68 +var kia_hitter = [
69 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
70 + ['김태진', 0.349, 22, 2, 1, 0],
71 + ['최원준', 0.342, 54, 2, 4, 0],
72 + ['이정훈', 0.293, 12, 2, 0, 1],
73 + ['김선빈', 0.292, 40, 8, 0, 0],
74 + ['터커', 0.265, 40, 9, 1, 2],
75 + ['김민식', 0.261, 18, 2, 0, 2],
76 + ['류지혁', 0.259, 21, 3, 0, 0],
77 + ['한승택', 0.259, 15, 3, 0, 0],
78 + ['이창진', 0.254, 18, 5, 0, 0],
79 + ['박찬호', 0.237, 28, 5, 2, 0],
80 + ['최형우', 0.2, 18, 0, 0, 4],
81 + ['나지완', 0.184, 9, 1, 0, 0],
82 + ['김호령', 0.163, 7, 2, 0, 1],
83 +]
84 +
85 +var kia_pitcher = [
86 + ['선수명', '볼넷%', '피안타율'],
87 + ['브룩스', 5.3, 0.307],
88 + ['멩덴', 10, 0.243],
89 + ['이의리', 14, 0.223],
90 + ['임기영', 7.1, 0.254],
91 + ['김현수', 14.5, 0.243],
92 + ['이민우', 7.9, 0.346],
93 + ['남재현', 27.8, 0.208],
94 + ['김유신', 16.2, 0.269],
95 +]
96 +
97 +var kiwoom_hitter = [
98 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
99 + ['이정후', 0.367, 55, 14, 3, 1],
100 + ['서건창', 0.31, 40, 8, 0, 1],
101 + ['이지영', 0.304, 17, 2, 1, 0],
102 + ['박동원', 0.281, 25, 5, 0, 7],
103 + ['김혜성', 0.268, 41, 7, 1, 3],
104 + ['이용규', 0.258, 32, 2, 4, 0],
105 + ['김웅빈', 0.256, 32, 8, 0, 3],
106 + ['프레이타스',0.25, 25, 7, 0, 1],
107 + ['송우현', 0.248, 28, 5, 1, 1],
108 + ['전병우', 0.222, 14, 3, 0, 2],
109 + ['김수환', 0.22, 9, 2, 0, 2],
110 + ['박병호', 0.212, 22, 5, 0, 5],
111 + ['허정협', 0.179, 5, 0, 0, 0],
112 + ['신준우', 0.167, 1, 1, 0, 0],
113 +]
114 +
115 +var kiwoom_pitcher = [
116 + ['선수명', '볼넷%', '피안타율'],
117 + ['요키시', 6.6, 0.27],
118 + ['한현희', 8.8, 0.261],
119 + ['최원태', 7.7, 0.276],
120 + ['안우진', 10.4, 0.269],
121 + ['브리검', 13.3, 0.243],
122 + ['이승호', 18, 0.263],
123 + ['스미스', 11.6, 0.237],
124 + ['장재영', 26.5, 0.217],
125 + ['김정인', 12.5, 0.246],
126 +]
127 +
128 +var kt_hitter = [
129 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
130 + ['강백호', 0.417, 60, 8, 1, 5],
131 + ['김병희', 0.389, 7, 2, 0, 2],
132 + ['배정대', 0.324, 44, 8, 0, 2],
133 + ['황재균', 0.324, 22, 2, 1, 1],
134 + ['심우준', 0.315, 34, 6, 1, 2],
135 + ['김민혁', 0.306, 19, 0, 2, 0],
136 + ['유한준', 0.288, 19, 5, 0, 0],
137 + ['알몬테', 0.284, 40, 5, 0, 4],
138 + ['조용호', 0.277, 33, 3, 0, 0],
139 + ['문상철', 0.258, 16, 6, 0, 2],
140 + ['장성우', 0.235, 24, 3, 0, 3],
141 + ['신본기', 0.222, 18, 4, 0, 0],
142 + ['박경수', 0.203, 15, 5, 0, 4],
143 + ['이홍구', 0.184, 7, 0, 0, 1],
144 +]
145 +
146 +var kt_pitcher = [
147 + ['선수명', '볼넷%', '피안타율'],
148 + ['데스파이네', 11.3, 0.213],
149 + ['고영표', 3.9, 0.243],
150 + ['배제성', 14.0, 0,224],
151 + ['소형준', 12.3, 0.269],
152 + ['김민수', 11.8, 0.299],
153 + ['쿠에바스', 12.0, 0.306],
154 + ['이정현', 12.0, 0.318],
155 +]
156 +
157 +var lg_hitter = [
158 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
159 + ['김현수', 0.316, 42, 7, 0, 6],
160 + ['홍창기', 0.313, 46, 8, 1, 2],
161 + ['채은성', 0.271, 29, 6, 0, 5],
162 + ['문보경', 0.267, 12, 4, 0, 1],
163 + ['정주현', 0.266, 25, 6, 1, 2],
164 + ['라모스', 0.248, 34, 5, 0, 5],
165 + ['유강남', 0.241, 27, 4, 0, 3],
166 + ['오지환', 0.22, 28, 5, 0, 2],
167 + ['이형종', 0.209, 14, 5, 0, 3],
168 + ['이천웅', 0.202, 17, 5, 0, 1],
169 + ['김민성', 0.192, 23, 8, 0, 2],
170 +]
171 +
172 +var lg_pitcher = [
173 + ['선수명', '볼넷%', '피안타율'],
174 + ['수아레즈', 9.6, 0.208],
175 + ['정찬헌', 5.6, 0.271],
176 + ['켈리', 9.6, 0.228],
177 + ['이민호', 11.5, 0.234],
178 + ['배재준', 6.2, 0.356],
179 + ['차우찬', 9.5, 0.211],
180 + ['함덕주', 17.2, 0.224],
181 + ['김윤식', 17.2, 0.254],
182 + ['임찬규', 25.8, 0.476],
183 + ['이상영', 12.0, 0.258],
184 +]
185 +
186 +var lotte_hitter = [
187 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
188 + ['이대호', 0.328, 44, 3, 0, 8],
189 + ['전준우', 0.316, 43, 8, 0, 2],
190 + ['안치홍', 0.299, 43, 8, 1, 3],
191 + ['정훈', 0.296, 37, 11, 0, 4],
192 + ['마차도', 0.28, 28, 6, 0, 3],
193 + ['추재현', 0.278, 10, 2, 0, 0],
194 + ['손아섭', 0.255, 40, 3, 0, 0],
195 + ['김준태', 0.25, 21, 5, 0, 3],
196 + ['오윤석', 0.25, 10, 5, 0, 1],
197 + ['한동희', 0.248, 30, 6, 0, 5],
198 + ['이병규', 0.235, 8, 0, 0, 0],
199 +]
200 +
201 +var lotte_pitcher = [
202 + ['선수명', '볼넷%', '피안타율'],
203 + ['스트레일리', 8.7, 0.268],
204 + ['박세웅', 8.3, 0.230],
205 + ['나균안', 9.4, 0.274],
206 + ['프랑코', 11.0, 0.234],
207 + ['김진욱', 20.0, 0.261],
208 + ['서준원', 13.9, 0.299],
209 + ['이승헌', 19.6, 0.325],
210 + ['노경은', 10.7, 0.344],
211 +]
212 +
213 +var nc_hitter = [
214 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
215 + ['양의지', 0.361, 44, 10, 1, 9],
216 + ['알테어', 0.326, 44, 8, 0, 13],
217 + ['박석민', 0.325, 25, 4, 0, 8],
218 + ['박민우', 0.303, 27, 1, 1, 1],
219 + ['김태군', 0.278, 20, 5, 0, 2],
220 + ['나성범', 0.269, 42, 8, 1, 10],
221 + ['이명기', 0.266, 29, 6, 0, 1],
222 + ['노진혁', 0.265, 30, 3, 0, 4],
223 + ['박준영', 0.26, 19, 2, 1, 4],
224 + ['강진성', 0.239, 16, 5, 0, 1],
225 + ['권희동', 0.233, 20, 3, 0, 5],
226 + ['이원재', 0.196, 10, 2, 0, 0],
227 + ['지석훈', 0.156, 5, 1, 0, 0],
228 + ['도태훈', 0.067, 2, 0, 0, 0],
229 +]
230 +
231 +var nc_pitcher = [
232 + ['선수명', '볼넷%', '피안타율'],
233 + ['루친스키', 9.0, 0.235],
234 + ['파슨스', 11.9, 0.219],
235 + ['송명기', 7.2, 0.348],
236 + ['신민혁', 7.8, 0.245],
237 + ['강동연', 9.0, 0.271],
238 + ['김진호', 42.9, 0.500],
239 + ['김영규', 11.5, 0.309],
240 + ['이재학', 24.4, 0.290],
241 +]
242 +
243 +var samsung_hitter = [
244 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
245 + ['김민수', 0.4, 12, 4, 0, 2],
246 + ['피렐라', 0.358, 57, 7, 1, 12],
247 + ['강민호', 0.35, 41, 7, 0, 5],
248 + ['박해민', 0.312, 43, 7, 0, 1],
249 + ['구자욱', 0.299, 43, 9, 3, 5],
250 + ['오재일', 0.257, 18, 4, 0, 3],
251 + ['김지찬', 0.25, 17, 3, 0, 0],
252 + ['강한울', 0.247, 21, 2, 0, 0],
253 + ['송준석', 0.24, 12, 2, 0, 2],
254 + ['이학주', 0.22, 18, 6, 0, 2],
255 + ['김헌곤', 0.208, 11, 1, 0, 2],
256 + ['이원석', 0.204, 20, 3, 0, 3],
257 + ['김상수', 0.191, 25, 2, 1, 0],
258 + ['김동엽', 0.125, 4, 0, 0, 0],
259 +]
260 +
261 +var samsung_pitcher = [
262 + ['선수명', '볼넷%', '피안타율'],
263 + ['뷰캐넌', 8.5, 0.228],
264 + ['원태인', 8.6, 0.246],
265 + ['라이블리', 9.3, 0.190],
266 + ['백정현', 10.5, 0.250],
267 + ['최채흥', 14.5, 0.346],
268 + ['이승민', 10.2, 0.294],
269 + ['김윤수', 19.3, 0.348],
270 + ['구준범', 25.0, 0.250],
271 +]
272 +
273 +var ssg_hitter = [
274 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
275 + ['최주환', 0.365, 27, 6, 0, 4],
276 + ['최정', 0.309, 38, 6, 0, 10],
277 + ['이흥련', 0.295, 13, 0, 0, 0],
278 + ['박성한', 0.287, 25, 6, 0, 1],
279 + ['김성현', 0.286, 22, 3, 0, 1],
280 + ['이재원', 0.277, 26, 7, 0, 2],
281 + ['로맥', 0.254, 33, 4, 0, 9],
282 + ['한유섬', 0.252, 32, 7, 0, 4],
283 + ['김강민', 0.243, 17, 4, 0, 1],
284 + ['정의윤', 0.241, 14, 0, 0, 4],
285 + ['추신수', 0.228, 29, 1, 0, 8],
286 + ['최지훈', 0.195, 15, 2, 1, 1],
287 + ['오태곤', 0.193, 11, 2, 0, 2],
288 +]
289 +
290 +var ssg_pitcher = [
291 + ['선수명', '볼넷%', '피안타율'],
292 + ['폰트', 7.1, 0.206],
293 + ['박종훈', 7.2, 0.205],
294 + ['문승원', 8.5, 0.220],
295 + ['오원석', 13.6, 0.251],
296 + ['르위키', 3.6, 0.278],
297 + ['조영우', 9.5, 0.321],
298 + ['양선률', 30.0, 0.500],
299 + ['정수민', 17.3, 0.284],
300 + ['김정빈', 19.4, 0.304],
301 + ['이건욱', 28.1, 0.317],
302 +]
...\ No newline at end of file ...\ No newline at end of file
...@@ -138,7 +138,7 @@ body{ ...@@ -138,7 +138,7 @@ body{
138 border-radius:5px; 138 border-radius:5px;
139 } 139 }
140 .tb{ 140 .tb{
141 - padding: 10px 0px 0px 135px; 141 + padding: 10px 0px 0px 90px;
142 } 142 }
143 table{ 143 table{
144 border: 1px solid #444444; 144 border: 1px solid #444444;
......
...@@ -3,103 +3,9 @@ ...@@ -3,103 +3,9 @@
3 <head> 3 <head>
4 <title> Simulation </title> 4 <title> Simulation </title>
5 <link rel="stylesheet" type="text/css"href="simulation.css"> 5 <link rel="stylesheet" type="text/css"href="simulation.css">
6 - <script src = "kia.js"></script> 6 + <script src = "player.js"></script>
7 - <script src = "dusan.js"></script>
8 - <script src = "algorithm.js"></script>
9 - <script src = "shuffle_list.js"></script>
10 - <script src = "aaaa.js"></script>
11 <script src = "temp_algorithm.js"></script> 7 <script src = "temp_algorithm.js"></script>
12 - <script> 8 + <script src = "simulation.js"></script>
13 - var wonjung=8;
14 - var home=6;
15 - function imgchange1(a){
16 - var img=document.getElementById("wonjung");
17 - if(a==1){
18 - wonjung=1;
19 - img.setAttribute("src","pngs/samsung.png");
20 - }
21 - else if(a==2){
22 - wonjung=2;
23 - img.setAttribute("src","pngs/nc.png");
24 - }
25 - else if(a==3){
26 - wonjung=3;
27 - img.setAttribute("src","pngs/LG.png");
28 - }
29 - else if(a==4){
30 - wonjung=4;
31 - img.setAttribute("src","pngs/kt.png");
32 - }
33 - else if(a==5){
34 - wonjung=5;
35 - img.setAttribute("src","pngs/ssg.png");
36 - }
37 - else if(a==6){
38 - wonjung=6;
39 - img.setAttribute("src","pngs/dusan.png");
40 - }
41 - else if(a==7){
42 - wonjung=7;
43 - img.setAttribute("src","pngs/kiwoom.png");
44 - }
45 - else if(a==8){
46 - wonjung=8;
47 - img.setAttribute("src","pngs/kia.png");
48 - }
49 - else if(a==9){
50 - wonjung=9;
51 - img.setAttribute("src","pngs/hanhwa.png");
52 - }
53 - else if(a==10){
54 - wonjung=10;
55 - img.setAttribute("src","pngs/Lotte.png");
56 - }
57 - }
58 - function imgchange2(a){
59 - var img=document.getElementById("home");
60 - if(a==1){
61 - home=1;
62 - img.setAttribute("src","pngs/samsung.png");
63 - }
64 - else if(a==2){
65 - home=2;
66 - img.setAttribute("src","pngs/nc.png");
67 - }
68 - else if(a==3){
69 - home=3;
70 - img.setAttribute("src","pngs/LG.png");
71 - }
72 - else if(a==4){
73 - home=4;
74 - img.setAttribute("src","pngs/kt.png");
75 - }
76 - else if(a==5){
77 - home=5;
78 - img.setAttribute("src","pngs/ssg.png");
79 - }
80 - else if(a==6){
81 - home=6;
82 - img.setAttribute("src","pngs/dusan.png");
83 - }
84 - else if(a==7){
85 - home=7;
86 - img.setAttribute("src","pngs/kiwoom.png");
87 - }
88 - else if(a==8){
89 - home=8;
90 - img.setAttribute("src","pngs/kia.png");
91 - }
92 - else if(a==9){
93 - home=9;
94 - img.setAttribute("src","pngs/hanhwa.png");
95 - }
96 - else if(a==10){
97 - home=10;
98 - img.setAttribute("src","pngs/Lotte.png");
99 - }
100 - }
101 -
102 - </script>
103 </head> 9 </head>
104 <body> 10 <body>
105 <div class="container1"> 11 <div class="container1">
...@@ -127,52 +33,82 @@ ...@@ -127,52 +33,82 @@
127 </div> 33 </div>
128 <div class="selection"> 34 <div class="selection">
129 <div class="row row1"> 35 <div class="row row1">
130 - <button type="submit" onclick="imgchange1(1)" class="t1">삼성</button> 36 + <button type="submit" onclick="imgchange1(1); w(1);" class="t1">삼성</button>
131 - <button type="submit" onclick="imgchange1(2)" class="t1">NC</button> 37 + <button type="submit" onclick="imgchange1(2); w(2);" class="t1">NC</button>
132 - <button type="submit" onclick="imgchange1(3)" class="t1">LG</button> 38 + <button type="submit" onclick="imgchange1(3); w(3);" class="t1">LG</button>
133 - <button type="submit" onclick="imgchange1(4)" class="t1">KT</button> 39 + <button type="submit" onclick="imgchange1(4); w(4);" class="t1">KT</button>
134 - <button type="submit" onclick="imgchange1(5)" class="t1">SSG</button> 40 + <button type="submit" onclick="imgchange1(5); w(5);" class="t1">SSG</button>
135 </div> 41 </div>
136 <div class="row row2"> 42 <div class="row row2">
137 - <button type="submit" onclick="imgchange1(6)" class="t1">두산</button> 43 + <button type="submit" onclick="imgchange1(6); w(6);" class="t1">두산</button>
138 - <button type="submit" onclick="imgchange1(7)" class="t1">키움</button> 44 + <button type="submit" onclick="imgchange1(7); w(7);" class="t1">키움</button>
139 - <button type="submit" onclick="imgchange1(8)" class="t1">KIA</button> 45 + <button type="submit" onclick="imgchange1(8); w(8);" class="t1">KIA</button>
140 - <button type="submit" onclick="imgchange1(9)" class="t1">한화</button> 46 + <button type="submit" onclick="imgchange1(9); w(9);" class="t1">한화</button>
141 - <button type="submit" onclick="imgchange1(10)" class="t1">롯데</button> 47 + <button type="submit" onclick="imgchange1(10); w(10);" class="t1">롯데</button>
142 </div> 48 </div>
143 </div> 49 </div>
144 <div class="tb"> 50 <div class="tb">
145 <table> 51 <table>
146 <tbody> 52 <tbody>
147 <tr> 53 <tr>
148 - <td>1번 타자</td><td>-</td> 54 + <td>1번 타자</td>
55 + <td><select name="won" id="won1" onclick="hitter1list_append(1,this.value);">
56 + <option value="">선택</option>
57 + </select></td>
149 </tr> 58 </tr>
150 <tr> 59 <tr>
151 - <td>2번 타자</td><td>-</td> 60 + <td>2번 타자</td>
61 + <td><select name="won" id="won2" onclick="hitter1list_append(2,this.value);">
62 + <option value="">선택</option>
63 + </select></td>
152 </tr> 64 </tr>
153 <tr> 65 <tr>
154 - <td>3번 타자</td><td>-</td> 66 + <td>3번 타자</td>
67 + <td><select name="won" id="won3" onclick="hitter1list_append(3,this.value);">
68 + <option value="">선택</option>
69 + </select></td>
155 </tr> 70 </tr>
156 <tr> 71 <tr>
157 - <td>4번 타자</td><td>-</td> 72 + <td>4번 타자</td>
73 + <td><select name="won" id="won4" onclick="hitter1list_append(4,this.value);">
74 + <option value="">선택</option>
75 + </select></td>
158 </tr> 76 </tr>
159 <tr> 77 <tr>
160 - <td>5번 타자</td><td>-</td> 78 + <td>5번 타자</td>
79 + <td><select name="won" id="won5" onclick="hitter1list_append(5,this.value);">
80 + <option value="">선택</option>
81 + </select></td>
161 </tr> 82 </tr>
162 <tr> 83 <tr>
163 - <td>6번 타자</td><td>-</td> 84 + <td>6번 타자</td>
85 + <td><select name="won" id="won6" onclick="hitter1list_append(6,this.value);">
86 + <option value="">선택</option>
87 + </select></td>
164 </tr> 88 </tr>
165 <tr> 89 <tr>
166 - <td>7번 타자</td><td>-</td> 90 + <td>7번 타자</td>
91 + <td><select name="won" id="won7" onclick="hitter1list_append(7,this.value);">
92 + <option value="">선택</option>
93 + </select></td>
167 </tr> 94 </tr>
168 <tr> 95 <tr>
169 - <td>8번 타자</td><td>-</td> 96 + <td>8번 타자</td>
97 + <td><select name="won" id="won8" onclick="hitter1list_append(8,this.value);">
98 + <option value="">선택</option>
99 + </select></td>
170 </tr> 100 </tr>
171 <tr> 101 <tr>
172 - <td>9번 타자</td><td>-</td> 102 + <td>9번 타자</td>
103 + <td><select name="won" id="won9" onclick="hitter1list_append(9,this.value);">
104 + <option value="">선택</option>
105 + </select></td>
173 </tr> 106 </tr>
174 <tr> 107 <tr>
175 - <td>선발 투수</td><td>-</td> 108 + <td>선발 투수</td>
109 + <td><select name="won" id="won" onclick="pitcher1list_append(this.value);">
110 + <option value="">선택</option>
111 + </select></td>
176 </tr> 112 </tr>
177 </tbody> 113 </tbody>
178 </table> 114 </table>
...@@ -190,7 +126,7 @@ ...@@ -190,7 +126,7 @@
190 </div> 126 </div>
191 <div class="simul"> 127 <div class="simul">
192 <div class="but"> 128 <div class="but">
193 - <input type="button" onclick=pre_algorithm() class="simulbtr" value="시뮬레이션"> 129 + <input type="button" onclick="pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2);" class="simulbtr" value="시뮬레이션">
194 </div> 130 </div>
195 <div class="result"> 131 <div class="result">
196 132
...@@ -204,52 +140,82 @@ ...@@ -204,52 +140,82 @@
204 </div> 140 </div>
205 <div class="selection"> 141 <div class="selection">
206 <div class="row row1"> 142 <div class="row row1">
207 - <button type="submit" onclick="imgchange2(1)" class="t2">삼성</button> 143 + <button type="submit" onclick="imgchange2(1);" class="t2">삼성</button>
208 - <button type="submit" onclick="imgchange2(2)" class="t2">NC</button> 144 + <button type="submit" onclick="imgchange2(2);" class="t2">NC</button>
209 - <button type="submit" onclick="imgchange2(3)" class="t2">LG</button> 145 + <button type="submit" onclick="imgchange2(3);" class="t2">LG</button>
210 - <button type="submit" onclick="imgchange2(4)" class="t2">KT</button> 146 + <button type="submit" onclick="imgchange2(4);" class="t2">KT</button>
211 - <button type="submit" onclick="imgchange2(5)" class="t2">SSG</button> 147 + <button type="submit" onclick="imgchange2(5);" class="t2">SSG</button>
212 </div> 148 </div>
213 <div class="row row2"> 149 <div class="row row2">
214 - <button type="submit" onclick="imgchange2(6)" class="t2">두산</button> 150 + <button type="submit" onclick="imgchange2(6);" class="t2">두산</button>
215 - <button type="submit" onclick="imgchange2(7)" class="t2">키움</button> 151 + <button type="submit" onclick="imgchange2(7);" class="t2">키움</button>
216 - <button type="submit" onclick="imgchange2(8)" class="t2">KIA</button> 152 + <button type="submit" onclick="imgchange2(8);" class="t2">KIA</button>
217 - <button type="submit" onclick="imgchange2(9)" class="t2">한화</button> 153 + <button type="submit" onclick="imgchange2(9);" class="t2">한화</button>
218 - <button type="submit" onclick="imgchange2(10)" class="t2">롯데</button> 154 + <button type="submit" onclick="imgchange2(10);" class="t2">롯데</button>
219 </div> 155 </div>
220 </div> 156 </div>
221 <div class="tb"> 157 <div class="tb">
222 <table> 158 <table>
223 <tbody> 159 <tbody>
224 <tr> 160 <tr>
225 - <td>1번 타자</td><td>-</td> 161 + <td>1번 타자</td>
162 + <td><select name="hom" id="hom1" onclick="hitter2list_append(1,this.value);">
163 + <option value="">선택</option>
164 + </select></td>
226 </tr> 165 </tr>
227 <tr> 166 <tr>
228 - <td>2번 타자</td><td>-</td> 167 + <td>2번 타자</td>
168 + <td><select name="hom" id="hom2" onclick="hitter2list_append(2,this.value);">
169 + <option value="">선택</option>
170 + </select></td>
229 </tr> 171 </tr>
230 <tr> 172 <tr>
231 - <td>3번 타자</td><td>-</td> 173 + <td>3번 타자</td>
174 + <td><select name="hom" id="hom3" onclick="hitter2list_append(3,this.value);">
175 + <option value="">선택</option>
176 + </select></td>
232 </tr> 177 </tr>
233 <tr> 178 <tr>
234 - <td>4번 타자</td><td>-</td> 179 + <td>4번 타자</td>
180 + <td><select name="hom" id="hom4" onclick="hitter2list_append(4,this.value);">
181 + <option value="">선택</option>
182 + </select></td>
235 </tr> 183 </tr>
236 <tr> 184 <tr>
237 - <td>5번 타자</td><td>-</td> 185 + <td>5번 타자</td>
186 + <td><select name="hom" id="hom5" onclick="hitter2list_append(5,this.value);">
187 + <option value="">선택</option>
188 + </select></td>
238 </tr> 189 </tr>
239 <tr> 190 <tr>
240 - <td>6번 타자</td><td>-</td> 191 + <td>6번 타자</td>
192 + <td><select name="hom" id="hom6" onclick="hitter2list_append(6,this.value);">
193 + <option value="">선택</option>
194 + </select></td>
241 </tr> 195 </tr>
242 <tr> 196 <tr>
243 - <td>7번 타자</td><td>-</td> 197 + <td>7번 타자</td>
198 + <td><select name="hom" id="hom7" onclick="hitter2list_append(7,this.value);">
199 + <option value="">선택</option>
200 + </select></td>
244 </tr> 201 </tr>
245 <tr> 202 <tr>
246 - <td>8번 타자</td><td>-</td> 203 + <td>8번 타자</td>
204 + <td><select name="hom" id="hom8" onclick="hitter2list_append(8,this.value);">
205 + <option value="">선택</option>
206 + </select></td>
247 </tr> 207 </tr>
248 <tr> 208 <tr>
249 - <td>9번 타자</td><td>-</td> 209 + <td>9번 타자</td>
210 + <td><select name="hom" id="hom9" onclick="hitter2list_append(9,this.value);">
211 + <option value="">선택</option>
212 + </select></td>
250 </tr> 213 </tr>
251 <tr> 214 <tr>
252 - <td>선발 투수</td><td>-</td> 215 + <td>선발 투수</td>
216 + <td><select name="hom" id="hom" onclick="pitcher2list_append(this.value);">
217 + <option value="">선택</option>
218 + </select></td>
253 </tr> 219 </tr>
254 </tbody> 220 </tbody>
255 </table> 221 </table>
......
1 +var wonjung=8;
2 +var home=6;
3 +var hitter_list1=[
4 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
5 + ['', 0, 0, 0, 0, 0],
6 + ['', 0, 0, 0, 0, 0],
7 + ['', 0, 0, 0, 0, 0],
8 + ['', 0, 0, 0, 0, 0],
9 + ['', 0, 0, 0, 0, 0],
10 + ['', 0, 0, 0, 0, 0],
11 + ['', 0, 0, 0, 0, 0],
12 + ['', 0, 0, 0, 0, 0],
13 + ['', 0, 0, 0, 0, 0],
14 +];
15 +var hitter_list2=[
16 + ['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
17 + ['', 0, 0, 0, 0, 0],
18 + ['', 0, 0, 0, 0, 0],
19 + ['', 0, 0, 0, 0, 0],
20 + ['', 0, 0, 0, 0, 0],
21 + ['', 0, 0, 0, 0, 0],
22 + ['', 0, 0, 0, 0, 0],
23 + ['', 0, 0, 0, 0, 0],
24 + ['', 0, 0, 0, 0, 0],
25 + ['', 0, 0, 0, 0, 0],
26 +];
27 +var pitcher1=['',0,0];
28 +var pitcher2=['',0,0];
29 +
30 +function imgchange1(a){
31 + var img=document.getElementById("wonjung");
32 + if(a==1){
33 + wonjung=1;
34 + img.setAttribute("src","pngs/samsung.png");
35 + }
36 + else if(a==2){
37 + wonjung=2;
38 + img.setAttribute("src","pngs/nc.png");
39 + }
40 + else if(a==3){
41 + wonjung=3;
42 + img.setAttribute("src","pngs/LG.png");
43 + }
44 + else if(a==4){
45 + wonjung=4;
46 + img.setAttribute("src","pngs/kt.png");
47 + }
48 + else if(a==5){
49 + wonjung=5;
50 + img.setAttribute("src","pngs/ssg.png");
51 + }
52 + else if(a==6){
53 + wonjung=6;
54 + img.setAttribute("src","pngs/dusan.png");
55 + }
56 + else if(a==7){
57 + wonjung=7;
58 + img.setAttribute("src","pngs/kiwoom.png");
59 + }
60 + else if(a==8){
61 + wonjung=8;
62 + img.setAttribute("src","pngs/kia.png");
63 + }
64 + else if(a==9){
65 + wonjung=9;
66 + img.setAttribute("src","pngs/hanhwa.png");
67 + }
68 + else if(a==10){
69 + wonjung=10;
70 + img.setAttribute("src","pngs/Lotte.png");
71 + }
72 + hitter1_option(wonjung);
73 + pitcher1_option(wonjung);
74 +}
75 +
76 +function imgchange2(a){
77 + var img=document.getElementById("home");
78 + if(a==1){
79 + home=1;
80 + img.setAttribute("src","pngs/samsung.png");
81 + }
82 + else if(a==2){
83 + home=2;
84 + img.setAttribute("src","pngs/nc.png");
85 + }
86 + else if(a==3){
87 + home=3;
88 + img.setAttribute("src","pngs/LG.png");
89 + }
90 + else if(a==4){
91 + home=4;
92 + img.setAttribute("src","pngs/kt.png");
93 + }
94 + else if(a==5){
95 + home=5;
96 + img.setAttribute("src","pngs/ssg.png");
97 + }
98 + else if(a==6){
99 + home=6;
100 + img.setAttribute("src","pngs/dusan.png");
101 + }
102 + else if(a==7){
103 + home=7;
104 + img.setAttribute("src","pngs/kiwoom.png");
105 + }
106 + else if(a==8){
107 + home=8;
108 + img.setAttribute("src","pngs/kia.png");
109 + }
110 + else if(a==9){
111 + home=9;
112 + img.setAttribute("src","pngs/hanhwa.png");
113 + }
114 + else if(a==10){
115 + home=10;
116 + img.setAttribute("src","pngs/Lotte.png");
117 + }
118 + hitter2_option(home);
119 + pitcher2_option(home);
120 +}
121 +
122 +function hitter1_option(wonjung){
123 + var s="";
124 + if(wonjung==1){
125 + for(var j=1; j<samsung_hitter.length; j++){
126 + s+=("<option value="+samsung_hitter[j][0]+">"+samsung_hitter[j][0]+"</option>");
127 + }
128 + }
129 + else if(wonjung==2){
130 + for(var j=1; j<nc_hitter.length; j++){
131 + s+=("<option value="+nc_hitter[j][0]+">"+nc_hitter[j][0]+"</option>");
132 + }
133 + }
134 + else if(wonjung==3){
135 + for(var j=1; j<lg_hitter.length; j++){
136 + s+=("<option value="+lg_hitter[j][0]+">"+lg_hitter[j][0]+"</option>");
137 + }
138 + }
139 + else if(wonjung==4){
140 + for(var j=1; j<kt_hitter.length; j++){
141 + s+=("<option value="+kt_hitter[j][0]+">"+kt_hitter[j][0]+"</option>");
142 + }
143 + }
144 + else if(wonjung==5){
145 + for(var j=1; j<ssg_hitter.length; j++){
146 + s+=("<option value="+ssg_hitter[j][0]+">"+ssg_hitter[j][0]+"</option>");
147 + }
148 + }
149 + else if(wonjung==6){
150 + for(var j=1; j<dusan_hitter.length; j++){
151 + s+=("<option value="+dusan_hitter[j][0]+">"+dusan_hitter[j][0]+"</option>");
152 + }
153 + }
154 + else if(wonjung==7){
155 + for(var j=1; j<kiwoom_hitter.length; j++){
156 + s+=("<option value="+kiwoom_hitter[j][0]+">"+kiwoom_hitter[j][0]+"</option>");
157 + }
158 + }
159 + else if(wonjung==8){
160 + for(var j=1; j<kia_hitter.length; j++){
161 + s+=("<option value="+kia_hitter[j][0]+">"+kia_hitter[j][0]+"</option>");
162 + }
163 + }
164 + else if(wonjung==9){
165 + for(var j=1; j<hanhwa_hitter.length; j++){
166 + s+=("<option value="+hanhwa_hitter[j][0]+">"+hanhwa_hitter[j][0]+"</option>");
167 + }
168 + }
169 + else if(wonjung==10){
170 + for(var j=1; j<lotte_hitter.length; j++){
171 + s+=("<option value="+lotte_hitter[j][0]+">"+lotte_hitter[j][0]+"</option>");
172 + }
173 + }
174 + document.getElementById('won1').innerHTML=s;
175 + document.getElementById('won2').innerHTML=s;
176 + document.getElementById('won3').innerHTML=s;
177 + document.getElementById('won4').innerHTML=s;
178 + document.getElementById('won5').innerHTML=s;
179 + document.getElementById('won6').innerHTML=s;
180 + document.getElementById('won7').innerHTML=s;
181 + document.getElementById('won8').innerHTML=s;
182 + document.getElementById('won9').innerHTML=s;
183 +}
184 +
185 +function hitter2_option(wonjung){
186 + var s="";
187 + if(wonjung==1){
188 + for(var j=1; j<samsung_hitter.length; j++){
189 + s+=("<option value="+samsung_hitter[j][0]+">"+samsung_hitter[j][0]+"</option>");
190 + }
191 + }
192 + else if(wonjung==2){
193 + for(var j=1; j<nc_hitter.length; j++){
194 + s+=("<option value="+nc_hitter[j][0]+">"+nc_hitter[j][0]+"</option>");
195 + }
196 + }
197 + else if(wonjung==3){
198 + for(var j=1; j<lg_hitter.length; j++){
199 + s+=("<option value="+lg_hitter[j][0]+">"+lg_hitter[j][0]+"</option>");
200 + }
201 + }
202 + else if(wonjung==4){
203 + for(var j=1; j<kt_hitter.length; j++){
204 + s+=("<option value="+kt_hitter[j][0]+">"+kt_hitter[j][0]+"</option>");
205 + }
206 + }
207 + else if(wonjung==5){
208 + for(var j=1; j<ssg_hitter.length; j++){
209 + s+=("<option value="+ssg_hitter[j][0]+">"+ssg_hitter[j][0]+"</option>");
210 + }
211 + }
212 + else if(wonjung==6){
213 + for(var j=1; j<dusan_hitter.length; j++){
214 + s+=("<option value="+dusan_hitter[j][0]+">"+dusan_hitter[j][0]+"</option>");
215 + }
216 + }
217 + else if(wonjung==7){
218 + for(var j=1; j<kiwoom_hitter.length; j++){
219 + s+=("<option value="+kiwoom_hitter[j][0]+">"+kiwoom_hitter[j][0]+"</option>");
220 + }
221 + }
222 + else if(wonjung==8){
223 + for(var j=1; j<kia_hitter.length; j++){
224 + s+=("<option value="+kia_hitter[j][0]+">"+kia_hitter[j][0]+"</option>");
225 + }
226 + }
227 + else if(wonjung==9){
228 + for(var j=1; j<hanhwa_hitter.length; j++){
229 + s+=("<option value="+hanhwa_hitter[j][0]+">"+hanhwa_hitter[j][0]+"</option>");
230 + }
231 + }
232 + else if(wonjung==10){
233 + for(var j=1; j<lotte_hitter.length; j++){
234 + s+=("<option value="+lotte_hitter[j][0]+">"+lotte_hitter[j][0]+"</option>");
235 + }
236 + }
237 + document.getElementById('hom1').innerHTML=s;
238 + document.getElementById('hom2').innerHTML=s;
239 + document.getElementById('hom3').innerHTML=s;
240 + document.getElementById('hom4').innerHTML=s;
241 + document.getElementById('hom5').innerHTML=s;
242 + document.getElementById('hom6').innerHTML=s;
243 + document.getElementById('hom7').innerHTML=s;
244 + document.getElementById('hom8').innerHTML=s;
245 + document.getElementById('hom9').innerHTML=s;
246 +}
247 +
248 +function pitcher1_option(wonjung){
249 + var s="";
250 + if(wonjung==1){
251 + for(var j=1; j<samsung_pitcher.length; j++){
252 + s+=("<option value="+samsung_pitcher[j][0]+">"+samsung_pitcher[j][0]+"</option>");
253 + }
254 + }
255 + else if(wonjung==2){
256 + for(var j=1; j<nc_pitcher.length; j++){
257 + s+=("<option value="+nc_pitcher[j][0]+">"+nc_pitcher[j][0]+"</option>");
258 + }
259 + }
260 + else if(wonjung==3){
261 + for(var j=1; j<lg_pitcher.length; j++){
262 + s+=("<option value="+lg_pitcher[j][0]+">"+lg_pitcher[j][0]+"</option>");
263 + }
264 + }
265 + else if(wonjung==4){
266 + for(var j=1; j<kt_pitcher.length; j++){
267 + s+=("<option value="+kt_pitcher[j][0]+">"+kt_pitcher[j][0]+"</option>");
268 + }
269 + }
270 + else if(wonjung==5){
271 + for(var j=1; j<ssg_pitcher.length; j++){
272 + s+=("<option value="+ssg_pitcher[j][0]+">"+ssg_pitcher[j][0]+"</option>");
273 + }
274 + }
275 + else if(wonjung==6){
276 + for(var j=1; j<dusan_pitcher.length; j++){
277 + s+=("<option value="+dusan_pitcher[j][0]+">"+dusan_pitcher[j][0]+"</option>");
278 + }
279 + }
280 + else if(wonjung==7){
281 + for(var j=1; j<kiwoom_pitcher.length; j++){
282 + s+=("<option value="+kiwoom_pitcher[j][0]+">"+kiwoom_pitcher[j][0]+"</option>");
283 + }
284 + }
285 + else if(wonjung==8){
286 + for(var j=1; j<kia_pitcher.length; j++){
287 + s+=("<option value="+kia_pitcher[j][0]+">"+kia_pitcher[j][0]+"</option>");
288 + }
289 + }
290 + else if(wonjung==9){
291 + for(var j=1; j<hanhwa_pitcher.length; j++){
292 + s+=("<option value="+hanhwa_pitcher[j][0]+">"+hanhwa_pitcher[j][0]+"</option>");
293 + }
294 + }
295 + else if(wonjung==10){
296 + for(var j=1; j<lotte_pitcher.length; j++){
297 + s+=("<option value="+lotte_pitcher[j][0]+">"+lotte_pitcher[j][0]+"</option>");
298 + }
299 + }
300 + document.getElementById('won').innerHTML=s;
301 +}
302 +
303 +function pitcher2_option(wonjung){
304 + var s="";
305 + if(wonjung==1){
306 + for(var j=1; j<samsung_pitcher.length; j++){
307 + s+=("<option value="+samsung_pitcher[j][0]+">"+samsung_pitcher[j][0]+"</option>");
308 + }
309 + }
310 + else if(wonjung==2){
311 + for(var j=1; j<nc_pitcher.length; j++){
312 + s+=("<option value="+nc_pitcher[j][0]+">"+nc_pitcher[j][0]+"</option>");
313 + }
314 + }
315 + else if(wonjung==3){
316 + for(var j=1; j<lg_pitcher.length; j++){
317 + s+=("<option value="+lg_pitcher[j][0]+">"+lg_pitcher[j][0]+"</option>");
318 + }
319 + }
320 + else if(wonjung==4){
321 + for(var j=1; j<kt_pitcher.length; j++){
322 + s+=("<option value="+kt_pitcher[j][0]+">"+kt_pitcher[j][0]+"</option>");
323 + }
324 + }
325 + else if(wonjung==5){
326 + for(var j=1; j<ssg_pitcher.length; j++){
327 + s+=("<option value="+ssg_pitcher[j][0]+">"+ssg_pitcher[j][0]+"</option>");
328 + }
329 + }
330 + else if(wonjung==6){
331 + for(var j=1; j<dusan_pitcher.length; j++){
332 + s+=("<option value="+dusan_pitcher[j][0]+">"+dusan_pitcher[j][0]+"</option>");
333 + }
334 + }
335 + else if(wonjung==7){
336 + for(var j=1; j<kiwoom_pitcher.length; j++){
337 + s+=("<option value="+kiwoom_pitcher[j][0]+">"+kiwoom_pitcher[j][0]+"</option>");
338 + }
339 + }
340 + else if(wonjung==8){
341 + for(var j=1; j<kia_pitcher.length; j++){
342 + s+=("<option value="+kia_pitcher[j][0]+">"+kia_pitcher[j][0]+"</option>");
343 + }
344 + }
345 + else if(wonjung==9){
346 + for(var j=1; j<hanhwa_pitcher.length; j++){
347 + s+=("<option value="+hanhwa_pitcher[j][0]+">"+hanhwa_pitcher[j][0]+"</option>");
348 + }
349 + }
350 + else if(wonjung==10){
351 + for(var j=1; j<lotte_pitcher.length; j++){
352 + s+=("<option value="+lotte_pitcher[j][0]+">"+lotte_pitcher[j][0]+"</option>");
353 + }
354 + }
355 + document.getElementById('hom').innerHTML=s;
356 +}
357 +
358 +function hitter1list_append(num, value){
359 + if(wonjung==1){
360 + for(var j=1; j<samsung_hitter.length; j++){
361 + if(value==samsung_hitter[j][0]){
362 + for(var k=0; k<samsung_hitter[j].length; k++){
363 + hitter_list1[num][k]=samsung_hitter[j][k];
364 + }
365 + return;
366 + }
367 + }
368 + }
369 + else if(wonjung==2){
370 + for(var j=1; j<nc_hitter.length; j++){
371 + if(value==nc_hitter[j][0]){
372 + for(var k=0; k<nc_hitter[j].length; k++){
373 + hitter_list1[num][k]=nc_hitter[j][k];
374 + }
375 + return;
376 + }
377 + }
378 + }
379 + else if(wonjung==3){
380 + for(var j=1; j<lg_hitter.length; j++){
381 + if(value==lg_hitter[j][0]){
382 + for(var k=0; k<lg_hitter[j].length; k++){
383 + hitter_list1[num][k]=lg_hitter[j][k];
384 + }
385 + return;
386 + }
387 + }
388 + }
389 + else if(wonjung==4){
390 + for(var j=1; j<kt_hitter.length; j++){
391 + if(value==kt_hitter[j][0]){
392 + for(var k=0; k<kt_hitter[j].length; k++){
393 + hitter_list1[num][k]=kt_hitter[j][k];
394 + }
395 + return;
396 + }
397 + }
398 + }
399 + else if(wonjung==5){
400 + for(var j=1; j<ssg_hitter.length; j++){
401 + if(value==ssg_hitter[j][0]){
402 + for(var k=0; k<ssg_hitter[j].length; k++){
403 + hitter_list1[num][k]=ssg_hitter[j][k];
404 + }
405 + return;
406 + }
407 + }
408 + }
409 + else if(wonjung==6){
410 + for(var j=1; j<dusan_hitter.length; j++){
411 + if(value==dusan_hitter[j][0]){
412 + for(var k=0; k<dusan_hitter[j].length; k++){
413 + hitter_list1[num][k]=dusan_hitter[j][k];
414 + }
415 + return;
416 + }
417 + }
418 + }
419 + else if(wonjung==7){
420 + for(var j=1; j<kiwoom_hitter.length; j++){
421 + if(value==kiwoom_hitter[j][0]){
422 + for(var k=0; k<kiwoom_hitter[j].length; k++){
423 + hitter_list1[num][k]=kiwoom_hitter[j][k];
424 + }
425 + return;
426 + }
427 + }
428 + }
429 + else if(wonjung==8){
430 + for(var j=1; j<kia_hitter.length; j++){
431 + if(value==kia_hitter[j][0]){
432 + for(var k=0; k<kia_hitter[j].length; k++){
433 + hitter_list1[num][k]=kia_hitter[j][k];
434 + }
435 + return;
436 + }
437 + }
438 + }
439 + else if(wonjung==9){
440 + for(var j=1; j<hanhwa_hitter.length; j++){
441 + if(value==hanhwa_hitter[j][0]){
442 + for(var k=0; k<hanhwa_hitter[j].length; k++){
443 + hitter_list1[num][k]=hanhwa_hitter[j][k];
444 + }
445 + return;
446 + }
447 + }
448 + }
449 + else if(wonjung==10){
450 + for(var j=1; j<lotte_hitter.length; j++){
451 + if(value==lotte_hitter[j][0]){
452 + for(var k=0; k<lotte_hitter[j].length; k++){
453 + hitter_list1[num][k]=lotte_hitter[j][k];
454 + }
455 + return;
456 + }
457 + }
458 + }
459 +}
460 +
461 +function hitter2list_append(num, value){
462 + if(home==1){
463 + for(var j=1; j<samsung_hitter.length; j++){
464 + if(value==samsung_hitter[j][0]){
465 + for(var k=0; k<samsung_hitter[j].length; k++){
466 + hitter_list2[num][k]=samsung_hitter[j][k];
467 + }
468 + return;
469 + }
470 + }
471 + }
472 + else if(home==2){
473 + for(var j=1; j<nc_hitter.length; j++){
474 + if(value==nc_hitter[j][0]){
475 + for(var k=0; k<nc_hitter[j].length; k++){
476 + hitter_list2[num][k]=nc_hitter[j][k];
477 + }
478 + return;
479 + }
480 + }
481 + }
482 + else if(home==3){
483 + for(var j=1; j<lg_hitter.length; j++){
484 + if(value==lg_hitter[j][0]){
485 + for(var k=0; k<lg_hitter[j].length; k++){
486 + hitter_list2[num][k]=lg_hitter[j][k];
487 + }
488 + return;
489 + }
490 + }
491 + }
492 + else if(home==4){
493 + for(var j=1; j<kt_hitter.length; j++){
494 + if(value==kt_hitter[j][0]){
495 + for(var k=0; k<kt_hitter[j].length; k++){
496 + hitter_list2[num][k]=kt_hitter[j][k];
497 + }
498 + return;
499 + }
500 + }
501 + }
502 + else if(home==5){
503 + for(var j=1; j<ssg_hitter.length; j++){
504 + if(value==ssg_hitter[j][0]){
505 + for(var k=0; k<ssg_hitter[j].length; k++){
506 + hitter_list2[num][k]=ssg_hitter[j][k];
507 + }
508 + return;
509 + }
510 + }
511 + }
512 + else if(home==6){
513 + for(var j=1; j<dusan_hitter.length; j++){
514 + if(value==dusan_hitter[j][0]){
515 + for(var k=0; k<dusan_hitter[j].length; k++){
516 + hitter_list2[num][k]=dusan_hitter[j][k];
517 + }
518 + return;
519 + }
520 + }
521 + }
522 + else if(home==7){
523 + for(var j=1; j<kiwoom_hitter.length; j++){
524 + if(value==kiwoom_hitter[j][0]){
525 + for(var k=0; k<kiwoom_hitter[j].length; k++){
526 + hitter_list2[num][k]=kiwoom_hitter[j][k];
527 + }
528 + return;
529 + }
530 + }
531 + }
532 + else if(home==8){
533 + for(var j=1; j<kia_hitter.length; j++){
534 + if(value==kia_hitter[j][0]){
535 + for(var k=0; k<kia_hitter[j].length; k++){
536 + hitter_list2[num][k]=kia_hitter[j][k];
537 + }
538 + return;
539 + }
540 + }
541 + }
542 + else if(home==9){
543 + for(var j=1; j<hanhwa_hitter.length; j++){
544 + if(value==hanhwa_hitter[j][0]){
545 + for(var k=0; k<hanhwa_hitter[j].length; k++){
546 + hitter_list2[num][k]=hanhwa_hitter[j][k];
547 + }
548 + return;
549 + }
550 + }
551 + }
552 + else if(home==10){
553 + for(var j=1; j<lotte_hitter.length; j++){
554 + if(value==lotte_hitter[j][0]){
555 + for(var k=0; k<lotte_hitter[j].length; k++){
556 + hitter_list2[num][k]=lotte_hitter[j][k];
557 + }
558 + return;
559 + }
560 + }
561 + }
562 +}
563 +
564 +function pitcher1list_append(value){
565 + if(wonjung==1){
566 + for(var j=1; j<samsung_pitcher.length; j++){
567 + if(value==samsung_pitcher[j][0]){
568 + for(var k=0; k<samsung_pitcher[j].length; k++){
569 + pitcher1[k]=samsung_pitcher[j][k];
570 + }
571 + return;
572 + }
573 + }
574 + }
575 + else if(wonjung==2){
576 + for(var j=1; j<nc_pitcher.length; j++){
577 + if(value==nc_pitcher[j][0]){
578 + for(var k=0; k<nc_pitcher[j].length; k++){
579 + pitcher1[k]=nc_pitcher[j][k];
580 + }
581 + return;
582 + }
583 + }
584 + }
585 + else if(wonjung==3){
586 + for(var j=1; j<lg_pitcher.length; j++){
587 + if(value==lg_pitcher[j][0]){
588 + for(var k=0; k<lg_pitcher[j].length; k++){
589 + pitcher1[k]=lg_pitcher[j][k];
590 + }
591 + return;
592 + }
593 + }
594 + }
595 + else if(wonjung==4){
596 + for(var j=1; j<kt_pitcher.length; j++){
597 + if(value==kt_pitcher[j][0]){
598 + for(var k=0; k<kt_pitcher[j].length; k++){
599 + pitcher1[k]=kt_pitcher[j][k];
600 + }
601 + return;
602 + }
603 + }
604 + }
605 + else if(wonjung==5){
606 + for(var j=1; j<ssg_pitcher.length; j++){
607 + if(value==ssg_pitcher[j][0]){
608 + for(var k=0; k<ssg_pitcher[j].length; k++){
609 + pitcher1[k]=ssg_pitcher[j][k];
610 + }
611 + return;
612 + }
613 + }
614 + }
615 + else if(wonjung==6){
616 + for(var j=1; j<dusan_pitcher.length; j++){
617 + if(value==dusan_pitcher[j][0]){
618 + for(var k=0; k<dusan_pitcher[j].length; k++){
619 + pitcher1[k]=dusan_pitcher[j][k];
620 + }
621 + return;
622 + }
623 + }
624 + }
625 + else if(wonjung==7){
626 + for(var j=1; j<kiwoom_pitcher.length; j++){
627 + if(value==kiwoom_pitcher[j][0]){
628 + for(var k=0; k<kiwoom_pitcher[j].length; k++){
629 + pitcher1[k]=kiwoom_pitcher[j][k];
630 + }
631 + return;
632 + }
633 + }
634 + }
635 + else if(wonjung==8){
636 + for(var j=1; j<kia_pitcher.length; j++){
637 + if(value==kia_pitcher[j][0]){
638 + for(var k=0; k<kia_pitcher[j].length; k++){
639 + pitcher1[k]=kia_pitcher[j][k];
640 + }
641 + return;
642 + }
643 + }
644 + }
645 + else if(wonjung==9){
646 + for(var j=1; j<hanhwa_pitcher.length; j++){
647 + if(value==hanhwa_pitcher[j][0]){
648 + for(var k=0; k<hanhwa_pitcher[j].length; k++){
649 + pitcher1[k]=hanhwa_pitcher[j][k];
650 + }
651 + return;
652 + }
653 + }
654 + }
655 + else if(wonjung==10){
656 + for(var j=1; j<lotte_pitcher.length; j++){
657 + if(value==lotte_pitcher[j][0]){
658 + for(var k=0; k<lotte_pitcher[j].length; k++){
659 + pitcher1[k]=lotte_pitcher[j][k];
660 + }
661 + return;
662 + }
663 + }
664 + }
665 +}
666 +
667 +function pitcher2list_append(value){
668 + if(home==1){
669 + for(var j=1; j<samsung_pitcher.length; j++){
670 + if(value==samsung_pitcher[j][0]){
671 + for(var k=0; k<samsung_pitcher[j].length; k++){
672 + pitcher2[k]=samsung_pitcher[j][k];
673 + }
674 + return;
675 + }
676 + }
677 + }
678 + else if(home==2){
679 + for(var j=1; j<nc_pitcher.length; j++){
680 + if(value==nc_pitcher[j][0]){
681 + for(var k=0; k<nc_pitcher[j].length; k++){
682 + pitcher2[k]=nc_pitcher[j][k];
683 + }
684 + return;
685 + }
686 + }
687 + }
688 + else if(home==3){
689 + for(var j=1; j<lg_pitcher.length; j++){
690 + if(value==lg_pitcher[j][0]){
691 + for(var k=0; k<lg_pitcher[j].length; k++){
692 + pitcher2[k]=lg_pitcher[j][k];
693 + }
694 + return;
695 + }
696 + }
697 + }
698 + else if(home==4){
699 + for(var j=1; j<kt_pitcher.length; j++){
700 + if(value==kt_pitcher[j][0]){
701 + for(var k=0; k<kt_pitcher[j].length; k++){
702 + pitcher2[k]=kt_pitcher[j][k];
703 + }
704 + return;
705 + }
706 + }
707 + }
708 + else if(home==5){
709 + for(var j=1; j<ssg_pitcher.length; j++){
710 + if(value==ssg_pitcher[j][0]){
711 + for(var k=0; k<ssg_pitcher[j].length; k++){
712 + pitcher2[k]=ssg_pitcher[j][k];
713 + }
714 + return;
715 + }
716 + }
717 + }
718 + else if(home==6){
719 + for(var j=1; j<dusan_pitcher.length; j++){
720 + if(value==dusan_pitcher[j][0]){
721 + for(var k=0; k<dusan_pitcher[j].length; k++){
722 + pitcher2[k]=dusan_pitcher[j][k];
723 + }
724 + return;
725 + }
726 + }
727 + }
728 + else if(home==7){
729 + for(var j=1; j<kiwoom_pitcher.length; j++){
730 + if(value==kiwoom_pitcher[j][0]){
731 + for(var k=0; k<kiwoom_pitcher[j].length; k++){
732 + pitcher2[k]=kiwoom_pitcher[j][k];
733 + }
734 + return;
735 + }
736 + }
737 + }
738 + else if(home==8){
739 + for(var j=1; j<kia_pitcher.length; j++){
740 + if(value==kia_pitcher[j][0]){
741 + for(var k=0; k<kia_pitcher[j].length; k++){
742 + pitcher2[k]=kia_pitcher[j][k];
743 + }
744 + return;
745 + }
746 + }
747 + }
748 + else if(home==9){
749 + for(var j=1; j<hanhwa_pitcher.length; j++){
750 + if(value==hanhwa_pitcher[j][0]){
751 + for(var k=0; k<hanhwa_pitcher[j].length; k++){
752 + pitcher2[k]=hanhwa_pitcher[j][k];
753 + }
754 + return;
755 + }
756 + }
757 + }
758 + else if(home==10){
759 + for(var j=1; j<lotte_pitcher.length; j++){
760 + if(value==lotte_pitcher[j][0]){
761 + for(var k=0; k<lotte_pitcher[j].length; k++){
762 + pitcher2[k]=lotte_pitcher[j][k];
763 + }
764 + return;
765 + }
766 + }
767 + }
768 +}
769 +hitter1_option(wonjung);
770 +pitcher1_option(wonjung);
771 +hitter2_option(home);
772 +pitcher2_option(home);
...\ No newline at end of file ...\ No newline at end of file
1 -function pre_algorithm(){//algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2) => html에서 가지고와야 한다. 1 +function pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2){//algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2) => html에서 가지고와야 한다.
2 var base1 = 0; var base2 = 0; var base3 = 0; //1이면 주자 있고 0이면 비어있는것 2 var base1 = 0; var base2 = 0; var base3 = 0; //1이면 주자 있고 0이면 비어있는것
3 var out = 0; var ining = 1; var home_away = 1;//아웃카운트, 이닝, home이면 1이고 away이면 2. 3 var out = 0; var ining = 1; var home_away = 1;//아웃카운트, 이닝, home이면 1이고 away이면 2.
4 var score1 = 0; var score2 = 0; 4 var score1 = 0; var score2 = 0;
...@@ -26,13 +26,13 @@ function pre_algorithm(){//algorithm(hitter_list1, hitter_list2, pitcher1, pitch ...@@ -26,13 +26,13 @@ function pre_algorithm(){//algorithm(hitter_list1, hitter_list2, pitcher1, pitch
26 } 26 }
27 27
28 if(home_away == 1){ 28 if(home_away == 1){
29 - var hitter = kia_hitter[hitter_num1]; //hitter = hitter_list1[hitter_number1%9] 29 + var hitter = hitter_list1[hitter_num1]; //hitter = hitter_list1[hitter_number1%9]
30 - var pitcher = dusan_pitcher[1]; //pitcher = pitcher1 30 + var pitcher = pitcher2; //pitcher = pitcher1
31 document.getElementById('jstest').innerHTML+=(ining+ "회 초"+ "<br\><br\>"); 31 document.getElementById('jstest').innerHTML+=(ining+ "회 초"+ "<br\><br\>");
32 } 32 }
33 else if(home_away == 2){ 33 else if(home_away == 2){
34 - var hitter = dusan_hitter[hitter_num2]; //hitter = hitter_list2[hitter_number2%9] 34 + var hitter = hitter_list2[hitter_num2]; //hitter = hitter_list2[hitter_number2%9]
35 - var pitcher = kia_pitcher[1]; //pitcher = pitcher2 35 + var pitcher = pitcher1; //pitcher = pitcher2
36 document.getElementById('jstest').innerHTML+=(ining+ "회 말"+ "<br\><br\>"); 36 document.getElementById('jstest').innerHTML+=(ining+ "회 말"+ "<br\><br\>");
37 } 37 }
38 38
......