정주희

Rearrange Files

1 +const express = require('express');
2 +const fs = require('fs');
3 +const path = require('path');
4 +const HTTPS = require('https');
5 +
6 +const app = express();
7 +const domain = "2020105636.oss-2021.tk"
8 +const sslport = 23023;
9 +
10 +app.use(express.static(__dirname));
11 +
12 +app.get('/', function(req, res){
13 + res.sendFile(__dirname + '/main.html');
14 +});
15 +
16 +app.get('/main.html', function(req, res){
17 + res.sendFile(__dirname + '/main.html');
18 +});
19 +
20 +app.get('/introduction.html', function(req, res){
21 + res.sendFile(__dirname + '/introduction.html');
22 +});
23 +
24 +app.get('/calendar.html', function(req, res){
25 + res.sendFile(__dirname + '/calendar.html');
26 +});
27 +
28 +
29 +app.get('/simulation.html', function(req, res){
30 + res.sendFile(__dirname + '/simulation.html');
31 +});
32 +
33 +try {
34 + const option = {
35 + ca: fs.readFileSync('/etc/letsencrypt/live/' + domain +'/fullchain.pem'),
36 + key: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/privkey.pem'), 'utf8').toString(),
37 + cert: fs.readFileSync(path.resolve(process.cwd(), '/etc/letsencrypt/live/' + domain +'/cert.pem'), 'utf8').toString(),
38 + };
39 +
40 + HTTPS.createServer(option, app).listen(sslport, () => {
41 + console.log(`[HTTPS] Server is started on port ${sslport}`);
42 + });
43 +} catch (error) {
44 + console.log('[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.');
45 + console.log(error);
46 +}
...\ No newline at end of file ...\ No newline at end of file
1 +body{
2 + background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
3 + background-repeat: no-repeat;
4 + background-size: cover;
5 +}
6 +.container1{
7 + display:flex;
8 + justify-content: center;
9 + align-items: baseline;
10 + padding:50px 0px 0px 0px;
11 +}
12 +.logo{
13 + font-size:40px;
14 + color:white;
15 +}
16 +*{
17 + margin: 0;
18 + padding: 0;
19 + box-sizing: border-box;
20 + font-family: sans-serif;
21 +}
22 +
23 +#menu{
24 + margin:60px 250px 0px 250px;
25 + height:90px;
26 + width:1000px;
27 +}
28 +#menu ul li{
29 + list-style:none;
30 + color:white;
31 + background-color:#011638;
32 + float:left;
33 + line-height:30px;
34 + vertical-align:middle;
35 + text-align:center;
36 + display:inline;
37 +}
38 +#menu .me{
39 + text-decoration:none;
40 + color:white;
41 + display:inline-block;
42 + width:250px;
43 + font-size:20px;
44 + font-weight:bold;
45 + font-family: "Trebuchet MS", Dotum, Arial;
46 +}
47 +#menu .me:hover{
48 + color:#D499B9;
49 + background-color: #2E294E;
50 +}
51 +
52 +.row{
53 + display:flex;
54 + justify-content: space-evenly;
55 + padding: 0px 0px 50px 0px;
56 +}
1 +<!DOCTYPE html>
2 +<html>
3 +<head>
4 + <title> Calendar </title>
5 + <link rel="stylesheet" type="text/css"href="calendar.css">
6 +</head>
7 +<body>
8 + <div class="container1">
9 + <span class="logo">Welcome to Baseball Simulator</span>
10 + </div>
11 + <nav id="menu">
12 + <ul>
13 + <li>
14 + <a class="me" href="main.html">Home</a>
15 + </li>
16 + <li>
17 + <a class="me" href="introduction.html">Introduction</a>
18 + </li>
19 + <li>
20 + <a class="me" href="calendar.html">Calendar</a>
21 + </li>
22 + <li>
23 + <a class="me" href="simulation.html">Simulation</a>
24 + </li>
25 + </ul>
26 + </nav>
27 + <div class="container2">
28 + <div class="row row1">
29 + <span class="item1">
30 + <a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=%EC%82%BC%EC%84%B1">
31 + <img src="pngs/samsung.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
32 + </a>
33 + </span>
34 + <span class="item2">
35 + <a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=NC">
36 + <img src="pngs/nc.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
37 + </a>
38 + </span>
39 + <span class="item3">
40 + <a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=LG">
41 + <img src="pngs/LG.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
42 + </a>
43 + </span>
44 + <span class="item4">
45 + <a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=KT">
46 + <img src="pngs/kt.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
47 + </a>
48 + </span>
49 + <span class="item5">
50 + <a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=SSG">
51 + <img src="pngs/ssg.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
52 + </a>
53 + </span>
54 + </div>
55 + <div class="row row2">
56 + <span class="item6">
57 + <a href="http://www.statiz.co.kr/team.php?cteam=%EB%91%90%EC%82%B0%2BOB&year=2021&opt=0&sopt=1">
58 + <img src="pngs/dusan.png" style="display:block; margin:0 auto; width:150px; height:150px;"alt="">
59 + </a>
60 + </span>
61 + <span class="item7">
62 + <a href="http://www.statiz.co.kr/team.php?cteam=%ED%9E%88%EC%96%B4%EB%A1%9C%EC%A6%88&year=2021&opt=0&sopt=1">
63 + <img src="pngs/kiwoom.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
64 + </a>
65 + </span>
66 + <span class="item8">
67 + <a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=KIA">
68 + <img src="pngs/kia.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
69 + </a>
70 + </span>
71 + <span class="item9">
72 + <a href="http://www.statiz.co.kr/team.php?cteam=%ED%95%9C%ED%99%94%2B%EB%B9%99%EA%B7%B8%EB%A0%88&year=2021&opt=0&sopt=1">
73 + <img src="pngs/hanhwa.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
74 + </a>
75 + </span>
76 + <span class="item10">
77 + <a href="http://www.statiz.co.kr/team.php?cteam=%EB%A1%AF%EB%8D%B0&year=2021&opt=0&sopt=1">
78 + <img src="pngs/Lotte.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
79 + </a>
80 + </span>
81 + </div>
82 + </div>
83 +</body>
84 +</html>
1 +body{
2 + background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
3 + background-repeat: no-repeat;
4 + -webkit-background-size: cover;
5 + -moz-background-size: cover;
6 + -o-background-size: cover;
7 + background-size: cover;
8 +}
9 +.container1{
10 + display:flex;
11 + justify-content: center;
12 + align-items: baseline;
13 + padding:50px 0px 0px 0px;
14 +}
15 +.logo{
16 + font-size:40px;
17 + color:white;
18 +}
19 +*{
20 + margin: 0;
21 + padding: 0;
22 + box-sizing: border-box;
23 + font-family: sans-serif;
24 +}
25 +
26 +#menu{
27 + margin:60px 250px 0px 250px;
28 + height:90px;
29 + width:1000px;
30 +}
31 +#menu ul li{
32 + list-style:none;
33 + color:white;
34 + background-color:#011638;
35 + float:left;
36 + line-height:30px;
37 + vertical-align:middle;
38 + text-align:center;
39 + display:inline;
40 +}
41 +#menu .me{
42 + text-decoration:none;
43 + color:white;
44 + display:inline-block;
45 + width:250px;
46 + font-size:20px;
47 + font-weight:bold;
48 + font-family: "Trebuchet MS", Dotum, Arial;
49 +}
50 +#menu .me:hover{
51 + color:#D499B9;
52 + background-color: #2E294E;
53 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<!DOCTYPE html>
2 +<html>
3 +<head>
4 + <title> Introduction </title>
5 + <link rel="stylesheet" type="text/css"href="introduction.css">
6 +</head>
7 +<body>
8 + <div class="container1">
9 + <span class="logo">Welcome to Baseball Simulator</span>
10 + </div>
11 + <nav id="menu">
12 + <ul>
13 + <li>
14 + <a class="me" href="main.html">Home</a>
15 + </li>
16 + <li>
17 + <a class="me" href="introduction.html">Introduction</a>
18 + </li>
19 + <li>
20 + <a class="me" href="calendar.html">Calendar</a>
21 + </li>
22 + <li>
23 + <a class="me" href="simulation.html">Simulation</a>
24 + </li>
25 + </ul>
26 + </nav>
27 +
28 +</body>
29 +</html>
1 +body{
2 + background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
3 + background-repeat: no-repeat;
4 + -webkit-background-size: cover;
5 + -moz-background-size: cover;
6 + -o-background-size: cover;
7 + background-size: cover;
8 +}
9 +.container1{
10 + display:flex;
11 + justify-content: center;
12 + align-items: baseline;
13 + padding:50px 0px 0px 0px;
14 +}
15 +.logo{
16 + font-size:40px;
17 + color:white;
18 +}
19 +*{
20 + margin: 0;
21 + padding: 0;
22 + box-sizing: border-box;
23 + font-family: sans-serif;
24 +}
25 +
26 +#menu{
27 + margin:60px 250px 0px 250px;
28 + height:90px;
29 + width:1000px;
30 +}
31 +#menu ul li{
32 + list-style:none;
33 + color:white;
34 + background-color:#011638;
35 + float:left;
36 + line-height:30px;
37 + vertical-align:middle;
38 + text-align:center;
39 + display:inline;
40 +}
41 +#menu .me{
42 + text-decoration:none;
43 + color:white;
44 + display:inline-block;
45 + width:250px;
46 + font-size:20px;
47 + font-weight:bold;
48 + font-family: "Trebuchet MS", Dotum, Arial;
49 +}
50 +#menu .me:hover{
51 + color:#D499B9;
52 + background-color: #2E294E;
53 +}
54 +.container2{
55 + width:50%;
56 + height:600px;
57 + float:left;
58 +}
59 +.container3{
60 + width:50%;
61 + height:200px;
62 + float:left;
63 +}
64 +.container4{
65 + width:20%;
66 + height:400px;
67 + float:left;
68 +}
69 +.container5{
70 + width:30%;
71 + height:400px;
72 + float:left;
73 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<!DOCTYPE html>
2 +<html>
3 +<head>
4 + <title> Baseball Simulator </title>
5 + <link rel="stylesheet" type="text/css"href="main.css">
6 +</head>
7 +<body>
8 + <div class="container1">
9 + <span class="logo">Welcome to Baseball Simulator</span>
10 + </div>
11 + <nav id="menu">
12 + <ul>
13 + <li>
14 + <a class="me" href="main.html">Home</a>
15 + </li>
16 + <li>
17 + <a class="me" href="introduction.html">Introduction</a>
18 + </li>
19 + <li>
20 + <a class="me" href="calendar.html">Calendar</a>
21 + </li>
22 + <li>
23 + <a class="me" href="simulation.html">Simulation</a>
24 + </li>
25 + </ul>
26 + </nav>
27 + <div class="container2">
28 + <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>
29 + </div>
30 + <div class="container3">
31 + <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>
32 + </div>
33 + <div class="container4">
34 + <img src="pngs/1.jpg" style="display:block; margin:0 auto; width:200px; height:100px;">
35 + </div>
36 + <div class="container5">
37 + <iframe width="400" height="200" src="https://www.youtube.com/embed/dL_79KkHmQE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
38 + </div>
39 +</body>
40 +</html>
1 +{
2 + "name": "homework",
3 + "version": "1.0.0",
4 + "lockfileVersion": 1,
5 + "requires": true,
6 + "dependencies": {
7 + "accepts": {
8 + "version": "1.3.7",
9 + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
10 + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
11 + "requires": {
12 + "mime-types": "~2.1.24",
13 + "negotiator": "0.6.2"
14 + }
15 + },
16 + "array-flatten": {
17 + "version": "1.1.1",
18 + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
19 + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
20 + },
21 + "body-parser": {
22 + "version": "1.19.0",
23 + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
24 + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
25 + "requires": {
26 + "bytes": "3.1.0",
27 + "content-type": "~1.0.4",
28 + "debug": "2.6.9",
29 + "depd": "~1.1.2",
30 + "http-errors": "1.7.2",
31 + "iconv-lite": "0.4.24",
32 + "on-finished": "~2.3.0",
33 + "qs": "6.7.0",
34 + "raw-body": "2.4.0",
35 + "type-is": "~1.6.17"
36 + }
37 + },
38 + "bytes": {
39 + "version": "3.1.0",
40 + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
41 + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
42 + },
43 + "content-disposition": {
44 + "version": "0.5.3",
45 + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
46 + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
47 + "requires": {
48 + "safe-buffer": "5.1.2"
49 + }
50 + },
51 + "content-type": {
52 + "version": "1.0.4",
53 + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
54 + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
55 + },
56 + "cookie": {
57 + "version": "0.4.0",
58 + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
59 + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
60 + },
61 + "cookie-signature": {
62 + "version": "1.0.6",
63 + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
64 + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
65 + },
66 + "debug": {
67 + "version": "2.6.9",
68 + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
69 + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
70 + "requires": {
71 + "ms": "2.0.0"
72 + }
73 + },
74 + "depd": {
75 + "version": "1.1.2",
76 + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
77 + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
78 + },
79 + "destroy": {
80 + "version": "1.0.4",
81 + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
82 + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
83 + },
84 + "ee-first": {
85 + "version": "1.1.1",
86 + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
87 + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
88 + },
89 + "encodeurl": {
90 + "version": "1.0.2",
91 + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
92 + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
93 + },
94 + "escape-html": {
95 + "version": "1.0.3",
96 + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
97 + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
98 + },
99 + "etag": {
100 + "version": "1.8.1",
101 + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
102 + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
103 + },
104 + "express": {
105 + "version": "4.17.1",
106 + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
107 + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
108 + "requires": {
109 + "accepts": "~1.3.7",
110 + "array-flatten": "1.1.1",
111 + "body-parser": "1.19.0",
112 + "content-disposition": "0.5.3",
113 + "content-type": "~1.0.4",
114 + "cookie": "0.4.0",
115 + "cookie-signature": "1.0.6",
116 + "debug": "2.6.9",
117 + "depd": "~1.1.2",
118 + "encodeurl": "~1.0.2",
119 + "escape-html": "~1.0.3",
120 + "etag": "~1.8.1",
121 + "finalhandler": "~1.1.2",
122 + "fresh": "0.5.2",
123 + "merge-descriptors": "1.0.1",
124 + "methods": "~1.1.2",
125 + "on-finished": "~2.3.0",
126 + "parseurl": "~1.3.3",
127 + "path-to-regexp": "0.1.7",
128 + "proxy-addr": "~2.0.5",
129 + "qs": "6.7.0",
130 + "range-parser": "~1.2.1",
131 + "safe-buffer": "5.1.2",
132 + "send": "0.17.1",
133 + "serve-static": "1.14.1",
134 + "setprototypeof": "1.1.1",
135 + "statuses": "~1.5.0",
136 + "type-is": "~1.6.18",
137 + "utils-merge": "1.0.1",
138 + "vary": "~1.1.2"
139 + }
140 + },
141 + "finalhandler": {
142 + "version": "1.1.2",
143 + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
144 + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
145 + "requires": {
146 + "debug": "2.6.9",
147 + "encodeurl": "~1.0.2",
148 + "escape-html": "~1.0.3",
149 + "on-finished": "~2.3.0",
150 + "parseurl": "~1.3.3",
151 + "statuses": "~1.5.0",
152 + "unpipe": "~1.0.0"
153 + }
154 + },
155 + "forwarded": {
156 + "version": "0.1.2",
157 + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
158 + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
159 + },
160 + "fresh": {
161 + "version": "0.5.2",
162 + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
163 + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
164 + },
165 + "http-errors": {
166 + "version": "1.7.2",
167 + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
168 + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
169 + "requires": {
170 + "depd": "~1.1.2",
171 + "inherits": "2.0.3",
172 + "setprototypeof": "1.1.1",
173 + "statuses": ">= 1.5.0 < 2",
174 + "toidentifier": "1.0.0"
175 + }
176 + },
177 + "iconv-lite": {
178 + "version": "0.4.24",
179 + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
180 + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
181 + "requires": {
182 + "safer-buffer": ">= 2.1.2 < 3"
183 + }
184 + },
185 + "inherits": {
186 + "version": "2.0.3",
187 + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
188 + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
189 + },
190 + "ipaddr.js": {
191 + "version": "1.9.1",
192 + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
193 + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
194 + },
195 + "media-typer": {
196 + "version": "0.3.0",
197 + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
198 + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
199 + },
200 + "merge-descriptors": {
201 + "version": "1.0.1",
202 + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
203 + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
204 + },
205 + "methods": {
206 + "version": "1.1.2",
207 + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
208 + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
209 + },
210 + "mime": {
211 + "version": "1.6.0",
212 + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
213 + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
214 + },
215 + "mime-db": {
216 + "version": "1.47.0",
217 + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
218 + "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw=="
219 + },
220 + "mime-types": {
221 + "version": "2.1.30",
222 + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
223 + "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
224 + "requires": {
225 + "mime-db": "1.47.0"
226 + }
227 + },
228 + "ms": {
229 + "version": "2.0.0",
230 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
231 + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
232 + },
233 + "negotiator": {
234 + "version": "0.6.2",
235 + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
236 + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
237 + },
238 + "on-finished": {
239 + "version": "2.3.0",
240 + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
241 + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
242 + "requires": {
243 + "ee-first": "1.1.1"
244 + }
245 + },
246 + "parseurl": {
247 + "version": "1.3.3",
248 + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
249 + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
250 + },
251 + "path-to-regexp": {
252 + "version": "0.1.7",
253 + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
254 + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
255 + },
256 + "proxy-addr": {
257 + "version": "2.0.6",
258 + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
259 + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
260 + "requires": {
261 + "forwarded": "~0.1.2",
262 + "ipaddr.js": "1.9.1"
263 + }
264 + },
265 + "qs": {
266 + "version": "6.7.0",
267 + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
268 + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
269 + },
270 + "range-parser": {
271 + "version": "1.2.1",
272 + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
273 + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
274 + },
275 + "raw-body": {
276 + "version": "2.4.0",
277 + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
278 + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
279 + "requires": {
280 + "bytes": "3.1.0",
281 + "http-errors": "1.7.2",
282 + "iconv-lite": "0.4.24",
283 + "unpipe": "1.0.0"
284 + }
285 + },
286 + "safe-buffer": {
287 + "version": "5.1.2",
288 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
289 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
290 + },
291 + "safer-buffer": {
292 + "version": "2.1.2",
293 + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
294 + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
295 + },
296 + "send": {
297 + "version": "0.17.1",
298 + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
299 + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
300 + "requires": {
301 + "debug": "2.6.9",
302 + "depd": "~1.1.2",
303 + "destroy": "~1.0.4",
304 + "encodeurl": "~1.0.2",
305 + "escape-html": "~1.0.3",
306 + "etag": "~1.8.1",
307 + "fresh": "0.5.2",
308 + "http-errors": "~1.7.2",
309 + "mime": "1.6.0",
310 + "ms": "2.1.1",
311 + "on-finished": "~2.3.0",
312 + "range-parser": "~1.2.1",
313 + "statuses": "~1.5.0"
314 + },
315 + "dependencies": {
316 + "ms": {
317 + "version": "2.1.1",
318 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
319 + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
320 + }
321 + }
322 + },
323 + "serve-static": {
324 + "version": "1.14.1",
325 + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
326 + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
327 + "requires": {
328 + "encodeurl": "~1.0.2",
329 + "escape-html": "~1.0.3",
330 + "parseurl": "~1.3.3",
331 + "send": "0.17.1"
332 + }
333 + },
334 + "setprototypeof": {
335 + "version": "1.1.1",
336 + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
337 + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
338 + },
339 + "statuses": {
340 + "version": "1.5.0",
341 + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
342 + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
343 + },
344 + "toidentifier": {
345 + "version": "1.0.0",
346 + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
347 + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
348 + },
349 + "type-is": {
350 + "version": "1.6.18",
351 + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
352 + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
353 + "requires": {
354 + "media-typer": "0.3.0",
355 + "mime-types": "~2.1.24"
356 + }
357 + },
358 + "unpipe": {
359 + "version": "1.0.0",
360 + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
361 + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
362 + },
363 + "utils-merge": {
364 + "version": "1.0.1",
365 + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
366 + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
367 + },
368 + "vary": {
369 + "version": "1.1.2",
370 + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
371 + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
372 + }
373 + }
374 +}
1 +{
2 + "name": "homework",
3 + "version": "1.0.0",
4 + "description": "",
5 + "main": "server.js",
6 + "scripts": {
7 + "test": "echo \"Error: no test specified\" && exit 1"
8 + },
9 + "author": "",
10 + "license": "ISC",
11 + "dependencies": {
12 + "express": "^4.17.1"
13 + }
14 +}
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
1 +const express = require('express');
2 +const app = express();
3 +app.use(express.static(__dirname));
4 +
5 +app.listen(8080, function(){
6 + console.log('listening on 8080');
7 +});
8 +
9 +app.get('/', function(req, res){
10 + res.sendFile(__dirname + '/main.html');
11 +});
12 +
13 +app.get('/main.html', function(req, res){
14 + res.sendFile(__dirname + '/main.html');
15 +});
16 +
17 +app.get('/introduction.html', function(req, res){
18 + res.sendFile(__dirname + '/introduction.html');
19 +});
20 +
21 +app.get('/calendar.html', function(req, res){
22 + res.sendFile(__dirname + '/calendar.html');
23 +});
24 +
25 +
26 +app.get('/simulation.html', function(req, res){
27 + res.sendFile(__dirname + '/simulation.html');
28 +});
29 +
1 +body{
2 + background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
3 + background-repeat: no-repeat;
4 + -webkit-background-size: cover;
5 + -moz-background-size: cover;
6 + -o-background-size: cover;
7 + background-size: cover;
8 +}
9 +.container1{
10 + display:flex;
11 + justify-content: center;
12 + align-items: baseline;
13 + padding:50px 0px 0px 0px;
14 +}
15 +.logo{
16 + font-size:40px;
17 + color:white;
18 +}
19 +*{
20 + margin: 0;
21 + padding: 0;
22 + box-sizing: border-box;
23 + font-family: sans-serif;
24 +}
25 +
26 +#menu{
27 + margin:60px 250px 0px 250px;
28 + height:90px;
29 + width:1000px;
30 +}
31 +#menu ul li{
32 + list-style:none;
33 + color:white;
34 + background-color:#011638;
35 + float:left;
36 + line-height:30px;
37 + vertical-align:middle;
38 + text-align:center;
39 + display:inline;
40 +}
41 +#menu .me{
42 + text-decoration:none;
43 + color:white;
44 + display:inline-block;
45 + width:250px;
46 + font-size:20px;
47 + font-weight:bold;
48 + font-family: "Trebuchet MS", Dotum, Arial;
49 +}
50 +#menu .me:hover{
51 + color:#D499B9;
52 + background-color: #2E294E;
53 +}
54 +.container2{
55 + width:25%;
56 + height:800px;
57 + float:left;
58 +}
59 +.team{
60 + font-size:24px;
61 + color:white;
62 + font-family: sans-serif;
63 + text-align:center;
64 +}
65 +.a{
66 + height:50px;
67 +}
68 +.selection{
69 + padding:0px 10px 15px 10px;
70 + height:80px;
71 +}
72 +.t1{
73 + width:50px;
74 + height:30px;
75 + color: #6AAFE6;
76 + border: 1px solid #6AAFE6;
77 + background: white;
78 + font-size:15px;
79 + border-radius:5px;
80 +}
81 +.row{
82 + display:flex;
83 + justify-content: space-evenly;
84 + padding: 0px 5px 10px 0px;
85 +}
86 +.container3{
87 + width:50%;
88 + height:800px;
89 + float:left;
90 +}
91 +.container4{
92 + width:25%;
93 + height:800px;
94 + float:left;
95 +}
96 +.t2{
97 + width:50px;
98 + height:30px;
99 + color: #6f2108;
100 + border: 1px solid #6f2108;
101 + background: white;
102 + font-size:15px;
103 + border-radius:5px;
104 +}
105 +.l{
106 + width:33%;
107 + height:200px;
108 + float:left;
109 +}
110 +
111 +.vs{
112 + width:200px;
113 + height:200px;
114 +}
115 +#vss{
116 + font-size:40px;
117 + color:white;
118 + text-align:center;
119 +}
120 +.simul{
121 + height:150px;
122 + display:flex;
123 + float:left;
124 + margin-top:50px;
125 + margin-left:250px;
126 +}
127 +.but{
128 + height:150px;
129 + margin: 0px auto;
130 +}
131 +.simulbtr{
132 + width:250px;
133 + height:50px;
134 + color: #c9d6de;
135 + border: 1px solid #c9d6de;
136 + background: black;
137 + font-size:30px;
138 + border-radius:5px;
139 +}
140 +.tb{
141 + padding: 10px 0px 0px 90px;
142 +}
143 +table{
144 + border: 1px solid #444444;
145 + background-color:white;
146 + border-collapse:collapse;
147 +}
148 +td{
149 + border:1px solid #444444;
150 + padding: 10px;
151 +}
152 +#jstest{
153 + width:100%;
154 + height:300px;
155 + overflow-y: scroll;
156 + overflow-x: auto;
157 + background-color:white;
158 +}
...\ No newline at end of file ...\ No newline at end of file
1 +<!DOCTYPE html>
2 +<html>
3 +<head>
4 + <title> Simulation </title>
5 + <link rel="stylesheet" type="text/css"href="simulation.css">
6 + <script src = "player.js"></script>
7 + <script src = "temp_algorithm.js"></script>
8 + <script src = "simulation.js"></script>
9 +</head>
10 +<body>
11 + <div class="container1">
12 + <span class="logo">Welcome to Baseball Simulator</span>
13 + </div>
14 + <nav id="menu">
15 + <ul>
16 + <li>
17 + <a class="me" href="main.html">Home</a>
18 + </li>
19 + <li>
20 + <a class="me" href="introduction.html">Introduction</a>
21 + </li>
22 + <li>
23 + <a class="me" href="calendar.html">Calendar</a>
24 + </li>
25 + <li>
26 + <a class="me" href="simulation.html">Simulation</a>
27 + </li>
28 + </ul>
29 + </nav>
30 + <div class="container2">
31 + <div class="a">
32 + <p class="team">원정팀</p>
33 + </div>
34 + <div class="selection">
35 + <div class="row row1">
36 + <button type="submit" onclick="imgchange1(1); w(1);" class="t1">삼성</button>
37 + <button type="submit" onclick="imgchange1(2); w(2);" class="t1">NC</button>
38 + <button type="submit" onclick="imgchange1(3); w(3);" class="t1">LG</button>
39 + <button type="submit" onclick="imgchange1(4); w(4);" class="t1">KT</button>
40 + <button type="submit" onclick="imgchange1(5); w(5);" class="t1">SSG</button>
41 + </div>
42 + <div class="row row2">
43 + <button type="submit" onclick="imgchange1(6); w(6);" class="t1">두산</button>
44 + <button type="submit" onclick="imgchange1(7); w(7);" class="t1">키움</button>
45 + <button type="submit" onclick="imgchange1(8); w(8);" class="t1">KIA</button>
46 + <button type="submit" onclick="imgchange1(9); w(9);" class="t1">한화</button>
47 + <button type="submit" onclick="imgchange1(10); w(10);" class="t1">롯데</button>
48 + </div>
49 + </div>
50 + <div class="tb">
51 + <table>
52 + <tbody>
53 + <tr>
54 + <td>1번 타자</td>
55 + <td><select name="won" id="won1" onclick="hitter1list_append(1,this.value);">
56 + <option value="">선택</option>
57 + </select></td>
58 + </tr>
59 + <tr>
60 + <td>2번 타자</td>
61 + <td><select name="won" id="won2" onclick="hitter1list_append(2,this.value);">
62 + <option value="">선택</option>
63 + </select></td>
64 + </tr>
65 + <tr>
66 + <td>3번 타자</td>
67 + <td><select name="won" id="won3" onclick="hitter1list_append(3,this.value);">
68 + <option value="">선택</option>
69 + </select></td>
70 + </tr>
71 + <tr>
72 + <td>4번 타자</td>
73 + <td><select name="won" id="won4" onclick="hitter1list_append(4,this.value);">
74 + <option value="">선택</option>
75 + </select></td>
76 + </tr>
77 + <tr>
78 + <td>5번 타자</td>
79 + <td><select name="won" id="won5" onclick="hitter1list_append(5,this.value);">
80 + <option value="">선택</option>
81 + </select></td>
82 + </tr>
83 + <tr>
84 + <td>6번 타자</td>
85 + <td><select name="won" id="won6" onclick="hitter1list_append(6,this.value);">
86 + <option value="">선택</option>
87 + </select></td>
88 + </tr>
89 + <tr>
90 + <td>7번 타자</td>
91 + <td><select name="won" id="won7" onclick="hitter1list_append(7,this.value);">
92 + <option value="">선택</option>
93 + </select></td>
94 + </tr>
95 + <tr>
96 + <td>8번 타자</td>
97 + <td><select name="won" id="won8" onclick="hitter1list_append(8,this.value);">
98 + <option value="">선택</option>
99 + </select></td>
100 + </tr>
101 + <tr>
102 + <td>9번 타자</td>
103 + <td><select name="won" id="won9" onclick="hitter1list_append(9,this.value);">
104 + <option value="">선택</option>
105 + </select></td>
106 + </tr>
107 + <tr>
108 + <td>선발 투수</td>
109 + <td><select name="won" id="won" onclick="pitcher1list_append(this.value);">
110 + <option value="">선택</option>
111 + </select></td>
112 + </tr>
113 + </tbody>
114 + </table>
115 + </div>
116 + </div>
117 + <div class="container3">
118 + <div class="l">
119 + <img src="pngs/kia.png" id="wonjung" class="vs" style="margin:0px 0px 0px 50px;">
120 + </div>
121 + <div class="l">
122 + <p id="vss">VS</p>
123 + </div>
124 + <div class="l">
125 + <img src="pngs/dusan.png" id="home" class="vs">
126 + </div>
127 + <div class="simul">
128 + <div class="but">
129 + <input type="button" onclick="pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2);" class="simulbtr" value="시뮬레이션">
130 + </div>
131 + <div class="result">
132 +
133 + </div>
134 + </div>
135 + <div id="jstest"></div>
136 + </div>
137 + <div class="container4">
138 + <div class="a">
139 + <p class="team">홈팀</p>
140 + </div>
141 + <div class="selection">
142 + <div class="row row1">
143 + <button type="submit" onclick="imgchange2(1);" class="t2">삼성</button>
144 + <button type="submit" onclick="imgchange2(2);" class="t2">NC</button>
145 + <button type="submit" onclick="imgchange2(3);" class="t2">LG</button>
146 + <button type="submit" onclick="imgchange2(4);" class="t2">KT</button>
147 + <button type="submit" onclick="imgchange2(5);" class="t2">SSG</button>
148 + </div>
149 + <div class="row row2">
150 + <button type="submit" onclick="imgchange2(6);" class="t2">두산</button>
151 + <button type="submit" onclick="imgchange2(7);" class="t2">키움</button>
152 + <button type="submit" onclick="imgchange2(8);" class="t2">KIA</button>
153 + <button type="submit" onclick="imgchange2(9);" class="t2">한화</button>
154 + <button type="submit" onclick="imgchange2(10);" class="t2">롯데</button>
155 + </div>
156 + </div>
157 + <div class="tb">
158 + <table>
159 + <tbody>
160 + <tr>
161 + <td>1번 타자</td>
162 + <td><select name="hom" id="hom1" onclick="hitter2list_append(1,this.value);">
163 + <option value="">선택</option>
164 + </select></td>
165 + </tr>
166 + <tr>
167 + <td>2번 타자</td>
168 + <td><select name="hom" id="hom2" onclick="hitter2list_append(2,this.value);">
169 + <option value="">선택</option>
170 + </select></td>
171 + </tr>
172 + <tr>
173 + <td>3번 타자</td>
174 + <td><select name="hom" id="hom3" onclick="hitter2list_append(3,this.value);">
175 + <option value="">선택</option>
176 + </select></td>
177 + </tr>
178 + <tr>
179 + <td>4번 타자</td>
180 + <td><select name="hom" id="hom4" onclick="hitter2list_append(4,this.value);">
181 + <option value="">선택</option>
182 + </select></td>
183 + </tr>
184 + <tr>
185 + <td>5번 타자</td>
186 + <td><select name="hom" id="hom5" onclick="hitter2list_append(5,this.value);">
187 + <option value="">선택</option>
188 + </select></td>
189 + </tr>
190 + <tr>
191 + <td>6번 타자</td>
192 + <td><select name="hom" id="hom6" onclick="hitter2list_append(6,this.value);">
193 + <option value="">선택</option>
194 + </select></td>
195 + </tr>
196 + <tr>
197 + <td>7번 타자</td>
198 + <td><select name="hom" id="hom7" onclick="hitter2list_append(7,this.value);">
199 + <option value="">선택</option>
200 + </select></td>
201 + </tr>
202 + <tr>
203 + <td>8번 타자</td>
204 + <td><select name="hom" id="hom8" onclick="hitter2list_append(8,this.value);">
205 + <option value="">선택</option>
206 + </select></td>
207 + </tr>
208 + <tr>
209 + <td>9번 타자</td>
210 + <td><select name="hom" id="hom9" onclick="hitter2list_append(9,this.value);">
211 + <option value="">선택</option>
212 + </select></td>
213 + </tr>
214 + <tr>
215 + <td>선발 투수</td>
216 + <td><select name="hom" id="hom" onclick="pitcher2list_append(this.value);">
217 + <option value="">선택</option>
218 + </select></td>
219 + </tr>
220 + </tbody>
221 + </table>
222 + </div>
223 + </div>
224 +</body>
225 +</html>
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(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이면 비어있는것
3 + var out = 0; var ining = 1; var home_away = 1;//아웃카운트, 이닝, home이면 1이고 away이면 2.
4 + var score1 = 0; var score2 = 0;
5 + var hitter_num1 = 1; var hitter_num2 = 1;
6 + var hit=false;
7 + document.getElementById('jstest').innerHTML="";
8 + while(true){
9 + if(ining == 9 && home_away == 2 && score1 < score2){//9회 초 후 home팀이 이기고 있을 때!
10 + break;
11 + }
12 + else if(ining==10 && home_away==1 && score1>score2 && hit==false){//9회 말 후 home팀이 이기고 있을 때!
13 + break;
14 + }
15 + else if(ining>9 && score1 < score2){//9회 말 후 home팀이 이기고 있을 때!
16 + break;
17 + }
18 + else if(ining>=11 && home_away==1 && hit==false && score1>score2){//연장 이후 원정팀이 이기고 있을 때!
19 + break;
20 + }
21 + else if(ining>=10 && home_away==2 && hit==true && score1<score2){//끝내기
22 + break;
23 + }
24 + else if(ining==13 && score1==score2){//무승부
25 + break;
26 + }
27 +
28 + if(home_away == 1){
29 + var hitter = hitter_list1[hitter_num1]; //hitter = hitter_list1[hitter_number1%9]
30 + var pitcher = pitcher2; //pitcher = pitcher1
31 + document.getElementById('jstest').innerHTML+=(ining+ "회 초"+ "<br\><br\>");
32 + }
33 + else if(home_away == 2){
34 + var hitter = hitter_list2[hitter_num2]; //hitter = hitter_list2[hitter_number2%9]
35 + var pitcher = pitcher1; //pitcher = pitcher2
36 + document.getElementById('jstest').innerHTML+=(ining+ "회 말"+ "<br\><br\>");
37 + }
38 +
39 + var num = Math.random();
40 + //hitter_number1 = hitter_number(kia); hitter_number2 = hitter_number(dusan);
41 + if(home_away == 1){
42 + document.getElementById('jstest').innerHTML+=(hitter_num1+"번 타자: "+hitter[0]+ "<br\><br\>");
43 + }
44 + else if(home_away == 2){
45 + document.getElementById('jstest').innerHTML+=(hitter_num2+"번 타자: "+hitter[0]+ "<br\><br\>");
46 + }
47 + var one = 0; var two = 0; var three = 0; var homerun = 0;
48 + one = pitcher[2] * (hitter[2] - hitter[3] - hitter[4] - hitter[5])/hitter[2];
49 + two = pitcher[2] * hitter[3]/hitter[2];
50 + three = pitcher[2] * hitter[4]/hitter[2];
51 + homerun = pitcher[2] * hitter[5]/hitter[2];
52 + hit=true;
53 + if(num <= one){ //안타
54 + var num1 = Math.random();
55 + if(num1 <= 0.5){
56 + switch(home_away){
57 + case 1:
58 + score1 = score1 + base3;
59 + break;
60 + case 2:
61 + score2 = score2 + base3;
62 + break;
63 + }
64 + base3 = base2;
65 + base2 = base1;
66 + base1 = 1;
67 + document.getElementById('jstest').innerHTML+=("1루타!");
68 +
69 + }
70 + else{
71 + switch(home_away){
72 + case 1:
73 + score1 = score1 + base3 + base2;
74 + break;
75 + case 2:
76 + score2 = score2 + base3 + base2;
77 + break;
78 + }
79 + base3 = base1;
80 + base2 = 0;
81 + base1 = 1;
82 + document.getElementById('jstest').innerHTML+=("1루타!");
83 +
84 + }
85 +
86 + }
87 + else if((one < num) && (num <= one + two)){//2루타
88 + var num2 = Math.random();
89 + if(num2 <= 0.4){
90 + switch(home_away){
91 + case 1:
92 + score1 = score1 + base3 + base2;
93 + break;
94 + case 2:
95 + score2 = score2 + base3 + base2;
96 + break;
97 + }
98 + base3 = base1;
99 + base2 = 1;
100 + base1 = 0;
101 + document.getElementById('jstest').innerHTML+=("2루타!");
102 +
103 + }
104 + else if(0.4 < num2 && num2 <=0.7){
105 + switch(home_away){
106 + case 1:
107 + score1 = score1 + base3 + base2 + base1;
108 + break;
109 + case 2:
110 + score2 = score2 + base3 + base2 + base1;
111 + break;
112 + }
113 + base3 = 0;
114 + base2 = 1;
115 + base1 = 0;
116 + document.getElementById('jstest').innerHTML+=("2루타!");
117 +
118 + }
119 + else{
120 + switch(home_away){
121 + case 1:
122 + score1 = score1 + base3 + base2;
123 + break;
124 + case 2:
125 + score2 = score2 + base3 + base2;
126 + break;
127 + }
128 + base3 = 0;
129 + base2 = 1;
130 + base1 = 0;
131 +
132 + document.getElementById('jstest').innerHTML+=("2루타!");
133 +
134 + }
135 +
136 + }
137 + else if((one + two < num) && (num <= one + two + three)){//3루타
138 + switch(home_away){
139 + case 1:
140 + score1 = score1 + base3 + base2 + base1;
141 + break;
142 + case 2:
143 + score2 = score2 + base3 + base2 + base1;
144 + break;
145 + }
146 + base3 = 1;
147 + base2 = 0;
148 + base1 = 0;
149 + document.getElementById('jstest').innerHTML+=("3루타!");
150 +
151 + }
152 + else if(one + two + three < num && num <= one + two + three + homerun){//홈런
153 + switch(home_away){
154 + case 1:
155 + score1 = score1 + base3 + base2 + base1 + 1;
156 + break;
157 + case 2:
158 + score2 = score2 + base3 + base2 + base1 + 1;
159 + break;
160 + }
161 + base3 = 0;
162 + base2 = 0;
163 + base1 = 0;
164 + document.getElementById('jstest').innerHTML+=("홈런!");
165 +
166 + }
167 +
168 +
169 + else if( pitcher[2] < num && (num <= pitcher[2] +pitcher[1]*0.01)){//볼넷
170 + if(base1==1 && base2==1 && base3==1){//만루 밀어내기 득점 -> 스코어 ++
171 + if(home_away==1){
172 + score1++;
173 + }
174 + else{
175 + score2++;
176 + }
177 + }
178 + else{//스코어 추가되지 않는 경우
179 + if((base2==1 && base1==0 )||(base3==1 && base1==0)||(base2==1&&base3==1&&base1==0)){//2루만 채워져있거나 3루만 채워져있거나 2,3루만 채워져있거나
180 + base1=1;
181 + }
182 + else if(base1==1 && base3==1 && base2==0){//1루 3루 채워져있고 2루 비워져있거나
183 + base2=base1;
184 + base1=1;
185 + }
186 + else{
187 + base3 = base2;
188 + base2 = base1;
189 + base1 = 1;
190 + }
191 + }
192 + document.getElementById('jstest').innerHTML+=("볼넷!");
193 + }
194 +
195 + else{//아웃
196 + out++;
197 + document.getElementById('jstest').innerHTML+=("아웃!");
198 +
199 + }
200 +
201 + document.getElementById('jstest').innerHTML+=("베이스 상태"+"<br\>"+ "1루 " + base1 + "<br\>"+"2루 " + base2 + "<br\>"+
202 + "3루 " + base3 + "<br\><br\>");///////////////////////////
203 + document.getElementById('jstest').innerHTML+=("score: "+score1 +"vs"+score2+ "<br\>");
204 + document.getElementById('jstest').innerHTML+=("아웃카운트: "+out+"<br\><br\>");
205 + if(out >= 3){
206 + switch(home_away){
207 + case 1:
208 + home_away = 2;
209 + hit=false;
210 + break;
211 + case 2:
212 + home_away = 1;
213 + ining++;
214 + hit=false;
215 + break;
216 + }
217 + out=0;
218 + base1=0; base2=0; base3=0;
219 + }
220 + else{
221 + if(home_away == 1){
222 + hitter_num1++;
223 + if(hitter_num1>=10){
224 + hitter_num1=1;
225 + }
226 + }
227 + else if(home_away == 2){
228 + hitter_num2++;
229 + if(hitter_num2>=10){
230 + hitter_num2=1;
231 + }
232 + }
233 + }
234 +
235 + }
236 + document.getElementById('jstest').innerHTML+=("<br\><br\>"+"최종스코어 : "+score1+"vs"+score2);
237 +}
...\ No newline at end of file ...\ No newline at end of file