김건우

update simulation algorithm

Showing 301 changed files with 306 additions and 2460 deletions
'적중률 99%' 야구 결과 시뮬레이션
프로젝트 참여자 : 김건우(2020105583), 오진혁(2020105636), 정주희(2020105660)
프로젝트 소개 : {
목적 : 야구 경기 시뮬레이션과 경기 일정 등을 종합적으로 제공하는 서비스
구현 계획 : [
1. node.js or js로 크롤링하여 순위, 일정 등을 불러들여 제공(미완) -> 임시 사진 대체. 링크만 걸어놓음
2. 구현 서비스, 과정을 담은 영상을 home에 연결(미완) -> 야구 경기 하이라이트로 대체.
3. 전반적인 4개의 site(main, introduction, calendar, simulation) 구축
-> main은 위 1, 2번 문제에 해당됨.
-> introduction은 readme.md 완성 시 update할 예정.
-> simulation은 구단 클릭 시 선수 list를 불러와 원하는 구단과 선수 명단을 짜고, 이를 바탕으로 시뮬레이션 하도록 프로그래밍 요망.
현재는 임시로 KIA(원정)VS두산(홈)의 구도와 9명의 짜여진 라인업, 1명의 투수로 시뮬레이션 진행하도록 설계함.
오류 발생하는 대로 수정하여 update&commit 예정.
]
}
알고리즘 소개 : {
업데이트 예정 ...
참고사항 : 기계학습, 딥러닝 사용하지 않아 99% 적중하기는 힘들다.
}
역할 분담 : {
김건우 : 전반적인 알고리즘 구축(with javascript), calendar 사진 및 기본 틀 구축, 정보 업데이트,
오진혁 : 서버 구축 담당(with node.js), main 기본 틀 구축, shuffle 알고리즘 구축, 정보 업데이트,
정주희 : 전반적인 프론트엔드(with html, css, javascript), 알고리즘 수정 및 적용
}
\ No newline at end of file
function algorithm(){
var pitcher = kia_pitcher[1]; //선발투수, 나중에 사용자가 지정해주는 투수로 바뀌도록 수정해야 한다.
var base1 = 0; base2 = 0; base3 = 0; //1이면 주자 있고 0이면 비어있는것
var out = 0; ining = 1; //아웃카운트, 이닝
var hitter_number1 = 0; hitter_number2 = 0; //이전 타석 타자 번호
var score = 0; score2 = 0;
for(i = 0; i < 10; i++){
var num = Math.random();
document.write(num, "<br><br>");//////////////////////
//hitter_number1 = hitter_number(kia); hitter_number2 = hitter_number(dusan);
hitter = kia_hitter[1]; //선발타자, 나중에 사용자가 지정해주는 타자로 바뀌도록 수정해야 한다.
document.write(hitter[0], "<br><br>")
var one = 0; var two = 0; var three = 0; var homerun = 0;
if( num <= kia_pitcher[1][2]){
one = pitcher[2] * (hitter[2] - hitter[3] - hitter[4] - hitter[5])/hitter[2];
two = pitcher[2] * hitter[3]/hitter[2];
three = pitcher[2] * hitter[4]/hitter[2];
homerun = pitcher[2] * hitter[5]/hitter[2];
document.write("확률" + "<br>" + "1루타 " + one, "<br>","2루타 " +
two, "<br>","3루타 "+ three, "<br>","홈런 " + homerun, "<br><br>");//////////////////////////////
if(num <= one){ //그냥 간단하게 다음 베이스로 한 칸씩 이동하도록 계산, 모든 경우의 수 계산하는게 불가능
var num1 = Math.random();
if(num1 <= 0.5){
score = score + base3;
base3 = base2;
base2 = base1;
base1 = 1;
document.write("1루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if(num1 > 0.5){
score = score + base3 + base2;
base3 = base1;
base2 = 0;
base1 = 1;
document.write("1루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
else if(one < num && num <= one + two){
var num2 = Math.random();
if(num2 <= 0.4){
score = score + base3 + base2;
base3 = base1;
base2 = 1;
base1 = 0;
document.write("2루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if(0.4 < num2 && num2 <=0.7){
score = score + base3 + base2 + base1;
base3 = 0;
base2 = 1;
base1 = 0;
document.write("2루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if(0.7 < num2 && num2 <= 1){
score = score + base3 + base2;
base3 = 0;
base2 = 1;
base1 = 0;
out++;
document.write("2루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
else if(one + two < num && num <= one + two + three){
score = score + base3 + base2 + base1;
base3 = 1;
base2 = 0;
base1 = 0;
document.write("3루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
else if(one + two + three < num && num <= one + two + three + homerun){
score = score + base3 + base2 + base1 + 1;
base3 = 0;
base2 = 0;
base1 = 0;
document.write("홈런!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
if( kia_pitcher[1][2] < num && num <= kia_pitcher[1][2] + kia_pitcher[1][1]*0.01){
base3 = base2;
base2 = base1;
base1 = 1;
document.write("볼넷!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if( kia_pitcher[1][2] + kia_pitcher[1][1]*0.01 < num && num <= 1){
out++;
if(out >= 3){
hitter = dusan_hitter[1];
pitcher = dusan_pitcher[1];
break;
}
document.write("아웃!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
}
\ No newline at end of file
function algorithm(){//algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2) => html에서 가지고와야 한다.
var base1 = 0; base2 = 0; base3 = 0; //1이면 주자 있고 0이면 비어있는것
var out = 0; ining = 1; home_away = 1;//아웃카운트, 이닝, home이면 1이고 away이면 2.
var hitter_number1 = 0; hitter_number2 = 0; //이전 타석 타자 번호
var score = 0; score2 = 0;
while(true){
document.write(ining, '회', "<br><br>");
if(ining >= 9 && home_away == 2 && score1 != score2){
score = []
score.push(score1); score.push(score2);
return score;
}
if(home_away == 1){
var hitter = kia_hitter[hitter_number1%9]; //hitter = hitter_list1[hitter_number1%9]
var pitcher = dusan_pitcher[1]; //pitcher = pitcher1
}
else if(home_away == 2){
var hitter = dusan_hitter[hitter_number2%9]; //hitter = hitter_list2[hitter_number2%9]
var pitcher = kia_pitcher[1]; //pitcher = pitcher2
}
var num = Math.random();
document.write(num, "<br><br>");//////////////////////
//hitter_number1 = hitter_number(kia); hitter_number2 = hitter_number(dusan);
document.write(hitter[0], "<br><br>")
var one = 0; var two = 0; var three = 0; var homerun = 0;
if( num <= kia_pitcher[1][2]){
one = pitcher[2] * (hitter[2] - hitter[3] - hitter[4] - hitter[5])/hitter[2];
two = pitcher[2] * hitter[3]/hitter[2];
three = pitcher[2] * hitter[4]/hitter[2];
homerun = pitcher[2] * hitter[5]/hitter[2];
document.write("확률" + "<br>" + "1루타 " + one, "<br>","2루타 " +
two, "<br>","3루타 "+ three, "<br>","홈런 " + homerun, "<br><br>");//////////////////////////////
if(num <= one){ //안타
var num1 = Math.random();
if(num1 <= 0.5){
switch(home_away){
case home_away == 1:
score1 = score1 + base3;
hitter_number1++;
case home_away == 2:
score2 = score2 + base3;
hitter_number2++;
}
base3 = base2;
base2 = base1;
base1 = 1;
document.write("1루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if(num1 > 0.5){
switch(home_away){
case home_away == 1:
score1 = score1 + base3 + base2;
hitter_number1++;
case home_away == 2:
score2 = score2 + base3 + base2;
hitter_number2++;
}
base3 = base1;
base2 = 0;
base1 = 1;
document.write("1루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
else if(one < num && num <= one + two){//2루타
var num2 = Math.random();
if(num2 <= 0.4){
switch(home_away){
case home_away == 1:
score1 = score1 + base3 + base2;
hitter_number1++;
case home_away == 2:
score2 = score2 + base3 + base2;
hitter_number2++;
}
base3 = base1;
base2 = 1;
base1 = 0;
document.write("2루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if(0.4 < num2 && num2 <=0.7){
switch(home_away){
case home_away == 1:
score1 = score1 + base3 + base2 + base1;
hitter_number1++;
case home_away == 2:
score2 = score2 + base3 + base2 + base1;
hitter_number2++;
}
base3 = 0;
base2 = 1;
base1 = 0;
document.write("2루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if(0.7 < num2 && num2 <= 1){
if(base1 == 1){
out++;
}
switch(home_away){
case home_away == 1:
score1 = score1 + base3 + base2;
hitter_number1++;
case home_away == 2:
score2 = score2 + base3 + base2;
hitter_number2++;
}
score = score + base3 + base2;
base3 = 0;
base2 = 1;
base1 = 0;
document.write("2루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
else if(one + two < num && num <= one + two + three){//3루타
score = score + base3 + base2 + base1;
base3 = 1;
base2 = 0;
base1 = 0;
document.write("3루타!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
else if(one + two + three < num && num <= one + two + three + homerun){//홈런
score = score + base3 + base2 + base1 + 1;
base3 = 0;
base2 = 0;
base1 = 0;
document.write("홈런!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
if( kia_pitcher[1][2] < num && num <= kia_pitcher[1][2] + kia_pitcher[1][1]*0.01){
base3 = base2;
base2 = base1;
base1 = 1;
document.write("볼넷!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
if( kia_pitcher[1][2] + kia_pitcher[1][1]*0.01 < num && num <= 1){
out++;
if(out >= 3){
hitter = dusan_hitter[1];
pitcher = dusan_pitcher[1];
switch(home_away){
case home_away == 1:
home_away++;
case home_away == 2:
home_away = 1;
ining++;
}
break;
}
document.write("아웃!")
document.write("베이스 상태"+"<br>", "1루 " + base1 + "<br>", "2루 " + base2 + "<br>",
"3루 " + base3 + "<br><br>")///////////////////////////
document.write("score: "+score+ "<br><br><br>")
}
}
}
\ No newline at end of file
body{
background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
background-repeat: no-repeat;
background-size: cover;
}
.container1{
display:flex;
justify-content: center;
align-items: baseline;
padding:50px 0px 0px 0px;
}
.logo{
font-size:40px;
color:white;
}
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
#menu{
margin:60px 250px 0px 250px;
height:90px;
width:1000px;
}
#menu ul li{
list-style:none;
color:white;
background-color:#011638;
float:left;
line-height:30px;
vertical-align:middle;
text-align:center;
display:inline;
}
#menu .me{
text-decoration:none;
color:white;
display:inline-block;
width:250px;
font-size:20px;
font-weight:bold;
font-family: "Trebuchet MS", Dotum, Arial;
}
#menu .me:hover{
color:#D499B9;
background-color: #2E294E;
}
.row{
display:flex;
justify-content: space-evenly;
padding: 0px 0px 50px 0px;
}
<!DOCTYPE html>
<html>
<head>
<title> Calendar </title>
<link rel="stylesheet" type="text/css"href="calendar.css">
</head>
<body>
<div class="container1">
<span class="logo">Welcome to Baseball Simulator</span>
</div>
<nav id="menu">
<ul>
<li>
<a class="me" href="main.html">Home</a>
</li>
<li>
<a class="me" href="introduction.html">Introduction</a>
</li>
<li>
<a class="me" href="calendar.html">Calendar</a>
</li>
<li>
<a class="me" href="simulation.html">Simulation</a>
</li>
</ul>
</nav>
<div class="container2">
<div class="row row1">
<span class="item1">
<a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=%EC%82%BC%EC%84%B1">
<img src="pngs/samsung.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item2">
<a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=NC">
<img src="pngs/nc.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item3">
<a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=LG">
<img src="pngs/LG.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item4">
<a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=KT">
<img src="pngs/kt.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item5">
<a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=SSG">
<img src="pngs/ssg.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
</div>
<div class="row row2">
<span class="item6">
<a href="http://www.statiz.co.kr/team.php?cteam=%EB%91%90%EC%82%B0%2BOB&year=2021&opt=0&sopt=1">
<img src="pngs/dusan.png" style="display:block; margin:0 auto; width:150px; height:150px;"alt="">
</a>
</span>
<span class="item7">
<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">
<img src="pngs/kiwoom.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item8">
<a href="http://www.statiz.co.kr/team.php?opt=0&sopt=1&year=2021&team=KIA">
<img src="pngs/kia.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item9">
<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">
<img src="pngs/hanhwa.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
<span class="item10">
<a href="http://www.statiz.co.kr/team.php?cteam=%EB%A1%AF%EB%8D%B0&year=2021&opt=0&sopt=1">
<img src="pngs/Lotte.png" style="display:block; margin:0 auto; width:150px; height:150px;" alt="">
</a>
</span>
</div>
</div>
</body>
</html>
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
body{
background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.container1{
display:flex;
justify-content: center;
align-items: baseline;
padding:50px 0px 0px 0px;
}
.logo{
font-size:40px;
color:white;
}
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
#menu{
margin:60px 250px 0px 250px;
height:90px;
width:1000px;
}
#menu ul li{
list-style:none;
color:white;
background-color:#011638;
float:left;
line-height:30px;
vertical-align:middle;
text-align:center;
display:inline;
}
#menu .me{
text-decoration:none;
color:white;
display:inline-block;
width:250px;
font-size:20px;
font-weight:bold;
font-family: "Trebuchet MS", Dotum, Arial;
}
#menu .me:hover{
color:#D499B9;
background-color: #2E294E;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title> Introduction </title>
<link rel="stylesheet" type="text/css"href="introduction.css">
</head>
<body>
<div class="container1">
<span class="logo">Welcome to Baseball Simulator</span>
</div>
<nav id="menu">
<ul>
<li>
<a class="me" href="main.html">Home</a>
</li>
<li>
<a class="me" href="introduction.html">Introduction</a>
</li>
<li>
<a class="me" href="calendar.html">Calendar</a>
</li>
<li>
<a class="me" href="simulation.html">Simulation</a>
</li>
</ul>
</nav>
</body>
</html>
body{
background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.container1{
display:flex;
justify-content: center;
align-items: baseline;
padding:50px 0px 0px 0px;
}
.logo{
font-size:40px;
color:white;
}
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
#menu{
margin:60px 250px 0px 250px;
height:90px;
width:1000px;
}
#menu ul li{
list-style:none;
color:white;
background-color:#011638;
float:left;
line-height:30px;
vertical-align:middle;
text-align:center;
display:inline;
}
#menu .me{
text-decoration:none;
color:white;
display:inline-block;
width:250px;
font-size:20px;
font-weight:bold;
font-family: "Trebuchet MS", Dotum, Arial;
}
#menu .me:hover{
color:#D499B9;
background-color: #2E294E;
}
.container2{
width:50%;
height:600px;
float:left;
}
.container3{
width:50%;
height:200px;
float:left;
}
.container4{
width:20%;
height:400px;
float:left;
}
.container5{
width:30%;
height:400px;
float:left;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title> Baseball Simulator </title>
<link rel="stylesheet" type="text/css"href="main.css">
</head>
<body>
<div class="container1">
<span class="logo">Welcome to Baseball Simulator</span>
</div>
<nav id="menu">
<ul>
<li>
<a class="me" href="main.html">Home</a>
</li>
<li>
<a class="me" href="introduction.html">Introduction</a>
</li>
<li>
<a class="me" href="calendar.html">Calendar</a>
</li>
<li>
<a class="me" href="simulation.html">Simulation</a>
</li>
</ul>
</nav>
<div class="container2">
<a href="https://sports.news.naver.com/kbaseball/record/index.nhn?category=kbo&year=2021"><img src="pngs/rank.jpg" style="display:block; margin:0 auto; width:600px; height:400px;"></a>
</div>
<div class="container3">
<a href="https://sports.news.naver.com/kbaseball/schedule/index.nhn"><img src="pngs/today.jpg" style="display:block; margin:0 auto; width:655px; height:150px;"></a>
</div>
<div class="container4">
<img src="pngs/1.jpg" style="display:block; margin:0 auto; width:200px; height:100px;">
</div>
<div class="container5">
<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>
</div>
</body>
</html>
{
"name": "homework",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
"requires": {
"bytes": "3.1.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"on-finished": "~2.3.0",
"qs": "6.7.0",
"raw-body": "2.4.0",
"type-is": "~1.6.17"
}
},
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"content-disposition": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
"requires": {
"safe-buffer": "5.1.2"
}
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
},
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
"requires": {
"accepts": "~1.3.7",
"array-flatten": "1.1.1",
"body-parser": "1.19.0",
"content-disposition": "0.5.3",
"content-type": "~1.0.4",
"cookie": "0.4.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "~1.1.2",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.5",
"qs": "6.7.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.1.2",
"send": "0.17.1",
"serve-static": "1.14.1",
"setprototypeof": "1.1.1",
"statuses": "~1.5.0",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
}
},
"finalhandler": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"statuses": "~1.5.0",
"unpipe": "~1.0.0"
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"http-errors": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.1",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
}
},
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"mime-db": {
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw=="
},
"mime-types": {
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"requires": {
"mime-db": "1.47.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.1"
}
},
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
},
"raw-body": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
"requires": {
"bytes": "3.1.0",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"send": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.7.2",
"mime": "1.6.0",
"ms": "2.1.1",
"on-finished": "~2.3.0",
"range-parser": "~1.2.1",
"statuses": "~1.5.0"
},
"dependencies": {
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}
}
},
"serve-static": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.17.1"
}
},
"setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
},
"statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
}
}
}
{
"name": "homework",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
}
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
var dusan_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['박건우', 0.356, 47, 9, 0, 2],
['허경민', 0.345, 49, 6, 0, 3],
['페르난데스', 0.336, 48, 5, 0, 6],
['최용제', 0.308, 8, 2, 0, 0],
['안재석', 0.304, 14, 1, 2, 0],
['김인태', 0.298, 25, 3, 0, 1],
['김재환', 0.285, 37, 4, 1, 9],
['장승현', 0.284, 23, 1, 0, 1],
['조수행', 0.278, 10, 1, 1, 0],
['양석환', 0.277, 38, 8, 0, 5],
['박계범', 0.266, 21, 5, 0, 2],
['김재호', 0.243, 18, 1, 0, 1],
['오재원', 0.22, 11, 2, 0, 0],
['강승호', 0.212, 7, 0, 0, 2],
['권민석', 0.167, 2, 1, 0, 0],
['박세혁', 0.161, 5, 0, 0, 0],
['안권수', 0.133, 2, 0, 0, 0],
['정수빈', 0.125, 4, 1, 0, 0]
]
var dusan_pitcher = [
['선수명', '볼넷%', '피안타율'],
['로켓', 7.4, 0.251],
['미란다', 12.5, 0.243],
['최원준', 5.6, 0.237],
['박정수', 10.2, 0.302],
['곽빈', 16.7, 0.256],
['유희관', 7.6, 0.409],
['조제영', 16.7, 0.367],
['이영하', 12.8, 0.388],
]
var hanhwa_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['하주석', 0.299, 40, 7, 1, 3],
['장운호', 0.291, 30, 6, 0, 0],
['노시환', 0.279, 38, 7, 0, 7],
['정은원', 0.277, 36, 7, 2, 0],
['힐리', 0.258, 32, 6, 1, 2],
['정진호', 0.254, 15, 3, 0, 0],
['최재훈', 0.247, 20, 1, 0, 2],
['김민하', 0.246, 14, 4, 0, 1],
['노수광', 0.238, 10, 1, 0, 0],
['이해창', 0.231, 9, 3, 0, 0],
['이성열', 0.207, 12, 3, 0, 1],
['박정현', 0.196, 19, 3, 0, 0],
['유장혁', 0.169, 14, 5, 0, 1],
['임종찬', 0.163, 16, 5, 0, 1],
]
var hanhwa_pitcher = [
['선수명', '볼넷%', '피안타율'],
['킹험', 6.4, 0.211],
['카펜터', 11.6, 0.201],
['김민우', 10.9, 0.217],
['강재민', 9.9, 0.143],
['김범수', 14.3, 0.265],
['장시환', 14.9, 0.311],
['정우람', 13.8, 0.244],
['윤대경', 15.3, 0.222],
['김이환', 16.7, 0.283],
['윤호솔', 10.8, 0.222],
['배동현', 12.5, 0.244],
]
var kia_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['김태진', 0.349, 22, 2, 1, 0],
['최원준', 0.342, 54, 2, 4, 0],
['이정훈', 0.293, 12, 2, 0, 1],
['김선빈', 0.292, 40, 8, 0, 0],
['터커', 0.265, 40, 9, 1, 2],
['김민식', 0.261, 18, 2, 0, 2],
['류지혁', 0.259, 21, 3, 0, 0],
['한승택', 0.259, 15, 3, 0, 0],
['이창진', 0.254, 18, 5, 0, 0],
['박찬호', 0.237, 28, 5, 2, 0],
['최형우', 0.2, 18, 0, 0, 4],
['나지완', 0.184, 9, 1, 0, 0],
['김호령', 0.163, 7, 2, 0, 1],
]
var kia_pitcher = [
['선수명', '볼넷%', '피안타율'],
['브룩스', 5.3, 0.307],
['멩덴', 10, 0.243],
['이의리', 14, 0.223],
['임기영', 7.1, 0.254],
['김현수', 14.5, 0.243],
['이민우', 7.9, 0.346],
['남재현', 27.8, 0.208],
['김유신', 16.2, 0.269],
]
var kiwoom_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['이정후', 0.367, 55, 14, 3, 1],
['서건창', 0.31, 40, 8, 0, 1],
['이지영', 0.304, 17, 2, 1, 0],
['박동원', 0.281, 25, 5, 0, 7],
['김혜성', 0.268, 41, 7, 1, 3],
['이용규', 0.258, 32, 2, 4, 0],
['김웅빈', 0.256, 32, 8, 0, 3],
['프레이타스',0.25, 25, 7, 0, 1],
['송우현', 0.248, 28, 5, 1, 1],
['전병우', 0.222, 14, 3, 0, 2],
['김수환', 0.22, 9, 2, 0, 2],
['박병호', 0.212, 22, 5, 0, 5],
['허정협', 0.179, 5, 0, 0, 0],
['신준우', 0.167, 1, 1, 0, 0],
]
var kiwoom_pitcher = [
['선수명', '볼넷%', '피안타율'],
['요키시', 6.6, 0.27],
['한현희', 8.8, 0.261],
['최원태', 7.7, 0.276],
['안우진', 10.4, 0.269],
['브리검', 13.3, 0.243],
['이승호', 18, 0.263],
['스미스', 11.6, 0.237],
['장재영', 26.5, 0.217],
['김정인', 12.5, 0.246],
]
var kt_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['강백호', 0.417, 60, 8, 1, 5],
['김병희', 0.389, 7, 2, 0, 2],
['배정대', 0.324, 44, 8, 0, 2],
['황재균', 0.324, 22, 2, 1, 1],
['심우준', 0.315, 34, 6, 1, 2],
['김민혁', 0.306, 19, 0, 2, 0],
['유한준', 0.288, 19, 5, 0, 0],
['알몬테', 0.284, 40, 5, 0, 4],
['조용호', 0.277, 33, 3, 0, 0],
['문상철', 0.258, 16, 6, 0, 2],
['장성우', 0.235, 24, 3, 0, 3],
['신본기', 0.222, 18, 4, 0, 0],
['박경수', 0.203, 15, 5, 0, 4],
['이홍구', 0.184, 7, 0, 0, 1],
]
var kt_pitcher = [
['선수명', '볼넷%', '피안타율'],
['데스파이네', 11.3, 0.213],
['고영표', 3.9, 0.243],
['배제성', 14.0, 0,224],
['소형준', 12.3, 0.269],
['김민수', 11.8, 0.299],
['쿠에바스', 12.0, 0.306],
['이정현', 12.0, 0.318],
]
var lg_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['김현수', 0.316, 42, 7, 0, 6],
['홍창기', 0.313, 46, 8, 1, 2],
['채은성', 0.271, 29, 6, 0, 5],
['문보경', 0.267, 12, 4, 0, 1],
['정주현', 0.266, 25, 6, 1, 2],
['라모스', 0.248, 34, 5, 0, 5],
['유강남', 0.241, 27, 4, 0, 3],
['오지환', 0.22, 28, 5, 0, 2],
['이형종', 0.209, 14, 5, 0, 3],
['이천웅', 0.202, 17, 5, 0, 1],
['김민성', 0.192, 23, 8, 0, 2],
]
var lg_pitcher = [
['선수명', '볼넷%', '피안타율'],
['수아레즈', 9.6, 0.208],
['정찬헌', 5.6, 0.271],
['켈리', 9.6, 0.228],
['이민호', 11.5, 0.234],
['배재준', 6.2, 0.356],
['차우찬', 9.5, 0.211],
['함덕주', 17.2, 0.224],
['김윤식', 17.2, 0.254],
['임찬규', 25.8, 0.476],
['이상영', 12.0, 0.258],
]
var lotte_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['이대호', 0.328, 44, 3, 0, 8],
['전준우', 0.316, 43, 8, 0, 2],
['안치홍', 0.299, 43, 8, 1, 3],
['정훈', 0.296, 37, 11, 0, 4],
['마차도', 0.28, 28, 6, 0, 3],
['추재현', 0.278, 10, 2, 0, 0],
['손아섭', 0.255, 40, 3, 0, 0],
['김준태', 0.25, 21, 5, 0, 3],
['오윤석', 0.25, 10, 5, 0, 1],
['한동희', 0.248, 30, 6, 0, 5],
['이병규', 0.235, 8, 0, 0, 0],
]
var lotte_pitcher = [
['선수명', '볼넷%', '피안타율'],
['스트레일리', 8.7, 0.268],
['박세웅', 8.3, 0.230],
['나균안', 9.4, 0.274],
['프랑코', 11.0, 0.234],
['김진욱', 20.0, 0.261],
['서준원', 13.9, 0.299],
['이승헌', 19.6, 0.325],
['노경은', 10.7, 0.344],
]
var nc_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['양의지', 0.361, 44, 10, 1, 9],
['알테어', 0.326, 44, 8, 0, 13],
['박석민', 0.325, 25, 4, 0, 8],
['박민우', 0.303, 27, 1, 1, 1],
['김태군', 0.278, 20, 5, 0, 2],
['나성범', 0.269, 42, 8, 1, 10],
['이명기', 0.266, 29, 6, 0, 1],
['노진혁', 0.265, 30, 3, 0, 4],
['박준영', 0.26, 19, 2, 1, 4],
['강진성', 0.239, 16, 5, 0, 1],
['권희동', 0.233, 20, 3, 0, 5],
['이원재', 0.196, 10, 2, 0, 0],
['지석훈', 0.156, 5, 1, 0, 0],
['도태훈', 0.067, 2, 0, 0, 0],
]
var nc_pitcher = [
['선수명', '볼넷%', '피안타율'],
['루친스키', 9.0, 0.235],
['파슨스', 11.9, 0.219],
['송명기', 7.2, 0.348],
['신민혁', 7.8, 0.245],
['강동연', 9.0, 0.271],
['김진호', 42.9, 0.500],
['김영규', 11.5, 0.309],
['이재학', 24.4, 0.290],
]
var samsung_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['김민수', 0.4, 12, 4, 0, 2],
['피렐라', 0.358, 57, 7, 1, 12],
['강민호', 0.35, 41, 7, 0, 5],
['박해민', 0.312, 43, 7, 0, 1],
['구자욱', 0.299, 43, 9, 3, 5],
['오재일', 0.257, 18, 4, 0, 3],
['김지찬', 0.25, 17, 3, 0, 0],
['강한울', 0.247, 21, 2, 0, 0],
['송준석', 0.24, 12, 2, 0, 2],
['이학주', 0.22, 18, 6, 0, 2],
['김헌곤', 0.208, 11, 1, 0, 2],
['이원석', 0.204, 20, 3, 0, 3],
['김상수', 0.191, 25, 2, 1, 0],
['김동엽', 0.125, 4, 0, 0, 0],
]
var samsung_pitcher = [
['선수명', '볼넷%', '피안타율'],
['뷰캐넌', 8.5, 0.228],
['원태인', 8.6, 0.246],
['라이블리', 9.3, 0.190],
['백정현', 10.5, 0.250],
['최채흥', 14.5, 0.346],
['이승민', 10.2, 0.294],
['김윤수', 19.3, 0.348],
['구준범', 25.0, 0.250],
]
var ssg_hitter = [
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['최주환', 0.365, 27, 6, 0, 4],
['최정', 0.309, 38, 6, 0, 10],
['이흥련', 0.295, 13, 0, 0, 0],
['박성한', 0.287, 25, 6, 0, 1],
['김성현', 0.286, 22, 3, 0, 1],
['이재원', 0.277, 26, 7, 0, 2],
['로맥', 0.254, 33, 4, 0, 9],
['한유섬', 0.252, 32, 7, 0, 4],
['김강민', 0.243, 17, 4, 0, 1],
['정의윤', 0.241, 14, 0, 0, 4],
['추신수', 0.228, 29, 1, 0, 8],
['최지훈', 0.195, 15, 2, 1, 1],
['오태곤', 0.193, 11, 2, 0, 2],
]
var ssg_pitcher = [
['선수명', '볼넷%', '피안타율'],
['폰트', 7.1, 0.206],
['박종훈', 7.2, 0.205],
['문승원', 8.5, 0.220],
['오원석', 13.6, 0.251],
['르위키', 3.6, 0.278],
['조영우', 9.5, 0.321],
['양선률', 30.0, 0.500],
['정수민', 17.3, 0.284],
['김정빈', 19.4, 0.304],
['이건욱', 28.1, 0.317],
]
\ No newline at end of file
const express = require('express');
const app = express();
app.listen(8080, function(){
console.log('listening on 8080');
});
app.get('/test', function(req, res){
res.send('test');
});
app.get('/', function(req, res){
res.sendFile(__dirname + '/main.html');
res.sendFile(__dirname + '/main.css');
});
\ No newline at end of file
body{
background-image:url(https://t1.daumcdn.net/cfile/blog/155A204A5026656D0E);
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.container1{
display:flex;
justify-content: center;
align-items: baseline;
padding:50px 0px 0px 0px;
}
.logo{
font-size:40px;
color:white;
}
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
#menu{
margin:60px 250px 0px 250px;
height:90px;
width:1000px;
}
#menu ul li{
list-style:none;
color:white;
background-color:#011638;
float:left;
line-height:30px;
vertical-align:middle;
text-align:center;
display:inline;
}
#menu .me{
text-decoration:none;
color:white;
display:inline-block;
width:250px;
font-size:20px;
font-weight:bold;
font-family: "Trebuchet MS", Dotum, Arial;
}
#menu .me:hover{
color:#D499B9;
background-color: #2E294E;
}
.container2{
width:25%;
height:800px;
float:left;
}
.team{
font-size:24px;
color:white;
font-family: sans-serif;
text-align:center;
}
.a{
height:50px;
}
.selection{
padding:0px 10px 15px 10px;
height:80px;
}
.t1{
width:50px;
height:30px;
color: #6AAFE6;
border: 1px solid #6AAFE6;
background: white;
font-size:15px;
border-radius:5px;
}
.row{
display:flex;
justify-content: space-evenly;
padding: 0px 5px 10px 0px;
}
.container3{
width:50%;
height:800px;
float:left;
}
.container4{
width:25%;
height:800px;
float:left;
}
.t2{
width:50px;
height:30px;
color: #6f2108;
border: 1px solid #6f2108;
background: white;
font-size:15px;
border-radius:5px;
}
.l{
width:33%;
height:200px;
float:left;
}
.vs{
width:200px;
height:200px;
}
#vss{
font-size:40px;
color:white;
text-align:center;
}
.simul{
height:150px;
display:flex;
float:left;
margin-top:50px;
margin-left:250px;
}
.but{
height:150px;
margin: 0px auto;
}
.simulbtr{
width:250px;
height:50px;
color: #c9d6de;
border: 1px solid #c9d6de;
background: black;
font-size:30px;
border-radius:5px;
}
.tb{
padding: 10px 0px 0px 90px;
}
table{
border: 1px solid #444444;
background-color:white;
border-collapse:collapse;
}
td{
border:1px solid #444444;
padding: 10px;
}
#jstest{
width:100%;
height:300px;
overflow-y: scroll;
overflow-x: auto;
background-color:white;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title> Simulation </title>
<link rel="stylesheet" type="text/css"href="simulation.css">
<script src = "player.js"></script>
<script src = "temp_algorithm.js"></script>
<script src = "simulation.js"></script>
</head>
<body>
<div class="container1">
<span class="logo">Welcome to Baseball Simulator</span>
</div>
<nav id="menu">
<ul>
<li>
<a class="me" href="main.html">Home</a>
</li>
<li>
<a class="me" href="introduction.html">Introduction</a>
</li>
<li>
<a class="me" href="calendar.html">Calendar</a>
</li>
<li>
<a class="me" href="simulation.html">Simulation</a>
</li>
</ul>
</nav>
<div class="container2">
<div class="a">
<p class="team">원정팀</p>
</div>
<div class="selection">
<div class="row row1">
<button type="submit" onclick="imgchange1(1); w(1);" class="t1">삼성</button>
<button type="submit" onclick="imgchange1(2); w(2);" class="t1">NC</button>
<button type="submit" onclick="imgchange1(3); w(3);" class="t1">LG</button>
<button type="submit" onclick="imgchange1(4); w(4);" class="t1">KT</button>
<button type="submit" onclick="imgchange1(5); w(5);" class="t1">SSG</button>
</div>
<div class="row row2">
<button type="submit" onclick="imgchange1(6); w(6);" class="t1">두산</button>
<button type="submit" onclick="imgchange1(7); w(7);" class="t1">키움</button>
<button type="submit" onclick="imgchange1(8); w(8);" class="t1">KIA</button>
<button type="submit" onclick="imgchange1(9); w(9);" class="t1">한화</button>
<button type="submit" onclick="imgchange1(10); w(10);" class="t1">롯데</button>
</div>
</div>
<div class="tb">
<table>
<tbody>
<tr>
<td>1번 타자</td>
<td><select name="won" id="won1" onclick="hitter1list_append(1,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>2번 타자</td>
<td><select name="won" id="won2" onclick="hitter1list_append(2,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>3번 타자</td>
<td><select name="won" id="won3" onclick="hitter1list_append(3,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>4번 타자</td>
<td><select name="won" id="won4" onclick="hitter1list_append(4,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>5번 타자</td>
<td><select name="won" id="won5" onclick="hitter1list_append(5,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>6번 타자</td>
<td><select name="won" id="won6" onclick="hitter1list_append(6,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>7번 타자</td>
<td><select name="won" id="won7" onclick="hitter1list_append(7,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>8번 타자</td>
<td><select name="won" id="won8" onclick="hitter1list_append(8,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>9번 타자</td>
<td><select name="won" id="won9" onclick="hitter1list_append(9,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>선발 투수</td>
<td><select name="won" id="won" onclick="pitcher1list_append(this.value);">
<option value="">선택</option>
</select></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="container3">
<div class="l">
<img src="pngs/kia.png" id="wonjung" class="vs" style="margin:0px 0px 0px 50px;">
</div>
<div class="l">
<p id="vss">VS</p>
</div>
<div class="l">
<img src="pngs/dusan.png" id="home" class="vs">
</div>
<div class="simul">
<div class="but">
<input type="button" onclick="pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2);" class="simulbtr" value="시뮬레이션">
</div>
<div class="result">
</div>
</div>
<div id="jstest"></div>
</div>
<div class="container4">
<div class="a">
<p class="team">홈팀</p>
</div>
<div class="selection">
<div class="row row1">
<button type="submit" onclick="imgchange2(1);" class="t2">삼성</button>
<button type="submit" onclick="imgchange2(2);" class="t2">NC</button>
<button type="submit" onclick="imgchange2(3);" class="t2">LG</button>
<button type="submit" onclick="imgchange2(4);" class="t2">KT</button>
<button type="submit" onclick="imgchange2(5);" class="t2">SSG</button>
</div>
<div class="row row2">
<button type="submit" onclick="imgchange2(6);" class="t2">두산</button>
<button type="submit" onclick="imgchange2(7);" class="t2">키움</button>
<button type="submit" onclick="imgchange2(8);" class="t2">KIA</button>
<button type="submit" onclick="imgchange2(9);" class="t2">한화</button>
<button type="submit" onclick="imgchange2(10);" class="t2">롯데</button>
</div>
</div>
<div class="tb">
<table>
<tbody>
<tr>
<td>1번 타자</td>
<td><select name="hom" id="hom1" onclick="hitter2list_append(1,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>2번 타자</td>
<td><select name="hom" id="hom2" onclick="hitter2list_append(2,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>3번 타자</td>
<td><select name="hom" id="hom3" onclick="hitter2list_append(3,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>4번 타자</td>
<td><select name="hom" id="hom4" onclick="hitter2list_append(4,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>5번 타자</td>
<td><select name="hom" id="hom5" onclick="hitter2list_append(5,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>6번 타자</td>
<td><select name="hom" id="hom6" onclick="hitter2list_append(6,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>7번 타자</td>
<td><select name="hom" id="hom7" onclick="hitter2list_append(7,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>8번 타자</td>
<td><select name="hom" id="hom8" onclick="hitter2list_append(8,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>9번 타자</td>
<td><select name="hom" id="hom9" onclick="hitter2list_append(9,this.value);">
<option value="">선택</option>
</select></td>
</tr>
<tr>
<td>선발 투수</td>
<td><select name="hom" id="hom" onclick="pitcher2list_append(this.value);">
<option value="">선택</option>
</select></td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
var wonjung=8;
var home=6;
var hitter_list1=[
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
];
var hitter_list2=[
['선수명', 'AVG', 'H', '2B', '3B', 'HR'],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
['', 0, 0, 0, 0, 0],
];
var pitcher1=['',0,0];
var pitcher2=['',0,0];
function imgchange1(a){
var img=document.getElementById("wonjung");
if(a==1){
wonjung=1;
img.setAttribute("src","pngs/samsung.png");
}
else if(a==2){
wonjung=2;
img.setAttribute("src","pngs/nc.png");
}
else if(a==3){
wonjung=3;
img.setAttribute("src","pngs/LG.png");
}
else if(a==4){
wonjung=4;
img.setAttribute("src","pngs/kt.png");
}
else if(a==5){
wonjung=5;
img.setAttribute("src","pngs/ssg.png");
}
else if(a==6){
wonjung=6;
img.setAttribute("src","pngs/dusan.png");
}
else if(a==7){
wonjung=7;
img.setAttribute("src","pngs/kiwoom.png");
}
else if(a==8){
wonjung=8;
img.setAttribute("src","pngs/kia.png");
}
else if(a==9){
wonjung=9;
img.setAttribute("src","pngs/hanhwa.png");
}
else if(a==10){
wonjung=10;
img.setAttribute("src","pngs/Lotte.png");
}
hitter1_option(wonjung);
pitcher1_option(wonjung);
}
function imgchange2(a){
var img=document.getElementById("home");
if(a==1){
home=1;
img.setAttribute("src","pngs/samsung.png");
}
else if(a==2){
home=2;
img.setAttribute("src","pngs/nc.png");
}
else if(a==3){
home=3;
img.setAttribute("src","pngs/LG.png");
}
else if(a==4){
home=4;
img.setAttribute("src","pngs/kt.png");
}
else if(a==5){
home=5;
img.setAttribute("src","pngs/ssg.png");
}
else if(a==6){
home=6;
img.setAttribute("src","pngs/dusan.png");
}
else if(a==7){
home=7;
img.setAttribute("src","pngs/kiwoom.png");
}
else if(a==8){
home=8;
img.setAttribute("src","pngs/kia.png");
}
else if(a==9){
home=9;
img.setAttribute("src","pngs/hanhwa.png");
}
else if(a==10){
home=10;
img.setAttribute("src","pngs/Lotte.png");
}
hitter2_option(home);
pitcher2_option(home);
}
function hitter1_option(wonjung){
var s="";
if(wonjung==1){
for(var j=1; j<samsung_hitter.length; j++){
s+=("<option value="+samsung_hitter[j][0]+">"+samsung_hitter[j][0]+"</option>");
}
}
else if(wonjung==2){
for(var j=1; j<nc_hitter.length; j++){
s+=("<option value="+nc_hitter[j][0]+">"+nc_hitter[j][0]+"</option>");
}
}
else if(wonjung==3){
for(var j=1; j<lg_hitter.length; j++){
s+=("<option value="+lg_hitter[j][0]+">"+lg_hitter[j][0]+"</option>");
}
}
else if(wonjung==4){
for(var j=1; j<kt_hitter.length; j++){
s+=("<option value="+kt_hitter[j][0]+">"+kt_hitter[j][0]+"</option>");
}
}
else if(wonjung==5){
for(var j=1; j<ssg_hitter.length; j++){
s+=("<option value="+ssg_hitter[j][0]+">"+ssg_hitter[j][0]+"</option>");
}
}
else if(wonjung==6){
for(var j=1; j<dusan_hitter.length; j++){
s+=("<option value="+dusan_hitter[j][0]+">"+dusan_hitter[j][0]+"</option>");
}
}
else if(wonjung==7){
for(var j=1; j<kiwoom_hitter.length; j++){
s+=("<option value="+kiwoom_hitter[j][0]+">"+kiwoom_hitter[j][0]+"</option>");
}
}
else if(wonjung==8){
for(var j=1; j<kia_hitter.length; j++){
s+=("<option value="+kia_hitter[j][0]+">"+kia_hitter[j][0]+"</option>");
}
}
else if(wonjung==9){
for(var j=1; j<hanhwa_hitter.length; j++){
s+=("<option value="+hanhwa_hitter[j][0]+">"+hanhwa_hitter[j][0]+"</option>");
}
}
else if(wonjung==10){
for(var j=1; j<lotte_hitter.length; j++){
s+=("<option value="+lotte_hitter[j][0]+">"+lotte_hitter[j][0]+"</option>");
}
}
document.getElementById('won1').innerHTML=s;
document.getElementById('won2').innerHTML=s;
document.getElementById('won3').innerHTML=s;
document.getElementById('won4').innerHTML=s;
document.getElementById('won5').innerHTML=s;
document.getElementById('won6').innerHTML=s;
document.getElementById('won7').innerHTML=s;
document.getElementById('won8').innerHTML=s;
document.getElementById('won9').innerHTML=s;
}
function hitter2_option(wonjung){
var s="";
if(wonjung==1){
for(var j=1; j<samsung_hitter.length; j++){
s+=("<option value="+samsung_hitter[j][0]+">"+samsung_hitter[j][0]+"</option>");
}
}
else if(wonjung==2){
for(var j=1; j<nc_hitter.length; j++){
s+=("<option value="+nc_hitter[j][0]+">"+nc_hitter[j][0]+"</option>");
}
}
else if(wonjung==3){
for(var j=1; j<lg_hitter.length; j++){
s+=("<option value="+lg_hitter[j][0]+">"+lg_hitter[j][0]+"</option>");
}
}
else if(wonjung==4){
for(var j=1; j<kt_hitter.length; j++){
s+=("<option value="+kt_hitter[j][0]+">"+kt_hitter[j][0]+"</option>");
}
}
else if(wonjung==5){
for(var j=1; j<ssg_hitter.length; j++){
s+=("<option value="+ssg_hitter[j][0]+">"+ssg_hitter[j][0]+"</option>");
}
}
else if(wonjung==6){
for(var j=1; j<dusan_hitter.length; j++){
s+=("<option value="+dusan_hitter[j][0]+">"+dusan_hitter[j][0]+"</option>");
}
}
else if(wonjung==7){
for(var j=1; j<kiwoom_hitter.length; j++){
s+=("<option value="+kiwoom_hitter[j][0]+">"+kiwoom_hitter[j][0]+"</option>");
}
}
else if(wonjung==8){
for(var j=1; j<kia_hitter.length; j++){
s+=("<option value="+kia_hitter[j][0]+">"+kia_hitter[j][0]+"</option>");
}
}
else if(wonjung==9){
for(var j=1; j<hanhwa_hitter.length; j++){
s+=("<option value="+hanhwa_hitter[j][0]+">"+hanhwa_hitter[j][0]+"</option>");
}
}
else if(wonjung==10){
for(var j=1; j<lotte_hitter.length; j++){
s+=("<option value="+lotte_hitter[j][0]+">"+lotte_hitter[j][0]+"</option>");
}
}
document.getElementById('hom1').innerHTML=s;
document.getElementById('hom2').innerHTML=s;
document.getElementById('hom3').innerHTML=s;
document.getElementById('hom4').innerHTML=s;
document.getElementById('hom5').innerHTML=s;
document.getElementById('hom6').innerHTML=s;
document.getElementById('hom7').innerHTML=s;
document.getElementById('hom8').innerHTML=s;
document.getElementById('hom9').innerHTML=s;
}
function pitcher1_option(wonjung){
var s="";
if(wonjung==1){
for(var j=1; j<samsung_pitcher.length; j++){
s+=("<option value="+samsung_pitcher[j][0]+">"+samsung_pitcher[j][0]+"</option>");
}
}
else if(wonjung==2){
for(var j=1; j<nc_pitcher.length; j++){
s+=("<option value="+nc_pitcher[j][0]+">"+nc_pitcher[j][0]+"</option>");
}
}
else if(wonjung==3){
for(var j=1; j<lg_pitcher.length; j++){
s+=("<option value="+lg_pitcher[j][0]+">"+lg_pitcher[j][0]+"</option>");
}
}
else if(wonjung==4){
for(var j=1; j<kt_pitcher.length; j++){
s+=("<option value="+kt_pitcher[j][0]+">"+kt_pitcher[j][0]+"</option>");
}
}
else if(wonjung==5){
for(var j=1; j<ssg_pitcher.length; j++){
s+=("<option value="+ssg_pitcher[j][0]+">"+ssg_pitcher[j][0]+"</option>");
}
}
else if(wonjung==6){
for(var j=1; j<dusan_pitcher.length; j++){
s+=("<option value="+dusan_pitcher[j][0]+">"+dusan_pitcher[j][0]+"</option>");
}
}
else if(wonjung==7){
for(var j=1; j<kiwoom_pitcher.length; j++){
s+=("<option value="+kiwoom_pitcher[j][0]+">"+kiwoom_pitcher[j][0]+"</option>");
}
}
else if(wonjung==8){
for(var j=1; j<kia_pitcher.length; j++){
s+=("<option value="+kia_pitcher[j][0]+">"+kia_pitcher[j][0]+"</option>");
}
}
else if(wonjung==9){
for(var j=1; j<hanhwa_pitcher.length; j++){
s+=("<option value="+hanhwa_pitcher[j][0]+">"+hanhwa_pitcher[j][0]+"</option>");
}
}
else if(wonjung==10){
for(var j=1; j<lotte_pitcher.length; j++){
s+=("<option value="+lotte_pitcher[j][0]+">"+lotte_pitcher[j][0]+"</option>");
}
}
document.getElementById('won').innerHTML=s;
}
function pitcher2_option(wonjung){
var s="";
if(wonjung==1){
for(var j=1; j<samsung_pitcher.length; j++){
s+=("<option value="+samsung_pitcher[j][0]+">"+samsung_pitcher[j][0]+"</option>");
}
}
else if(wonjung==2){
for(var j=1; j<nc_pitcher.length; j++){
s+=("<option value="+nc_pitcher[j][0]+">"+nc_pitcher[j][0]+"</option>");
}
}
else if(wonjung==3){
for(var j=1; j<lg_pitcher.length; j++){
s+=("<option value="+lg_pitcher[j][0]+">"+lg_pitcher[j][0]+"</option>");
}
}
else if(wonjung==4){
for(var j=1; j<kt_pitcher.length; j++){
s+=("<option value="+kt_pitcher[j][0]+">"+kt_pitcher[j][0]+"</option>");
}
}
else if(wonjung==5){
for(var j=1; j<ssg_pitcher.length; j++){
s+=("<option value="+ssg_pitcher[j][0]+">"+ssg_pitcher[j][0]+"</option>");
}
}
else if(wonjung==6){
for(var j=1; j<dusan_pitcher.length; j++){
s+=("<option value="+dusan_pitcher[j][0]+">"+dusan_pitcher[j][0]+"</option>");
}
}
else if(wonjung==7){
for(var j=1; j<kiwoom_pitcher.length; j++){
s+=("<option value="+kiwoom_pitcher[j][0]+">"+kiwoom_pitcher[j][0]+"</option>");
}
}
else if(wonjung==8){
for(var j=1; j<kia_pitcher.length; j++){
s+=("<option value="+kia_pitcher[j][0]+">"+kia_pitcher[j][0]+"</option>");
}
}
else if(wonjung==9){
for(var j=1; j<hanhwa_pitcher.length; j++){
s+=("<option value="+hanhwa_pitcher[j][0]+">"+hanhwa_pitcher[j][0]+"</option>");
}
}
else if(wonjung==10){
for(var j=1; j<lotte_pitcher.length; j++){
s+=("<option value="+lotte_pitcher[j][0]+">"+lotte_pitcher[j][0]+"</option>");
}
}
document.getElementById('hom').innerHTML=s;
}
function hitter1list_append(num, value){
if(wonjung==1){
for(var j=1; j<samsung_hitter.length; j++){
if(value==samsung_hitter[j][0]){
for(var k=0; k<samsung_hitter[j].length; k++){
hitter_list1[num][k]=samsung_hitter[j][k];
}
return;
}
}
}
else if(wonjung==2){
for(var j=1; j<nc_hitter.length; j++){
if(value==nc_hitter[j][0]){
for(var k=0; k<nc_hitter[j].length; k++){
hitter_list1[num][k]=nc_hitter[j][k];
}
return;
}
}
}
else if(wonjung==3){
for(var j=1; j<lg_hitter.length; j++){
if(value==lg_hitter[j][0]){
for(var k=0; k<lg_hitter[j].length; k++){
hitter_list1[num][k]=lg_hitter[j][k];
}
return;
}
}
}
else if(wonjung==4){
for(var j=1; j<kt_hitter.length; j++){
if(value==kt_hitter[j][0]){
for(var k=0; k<kt_hitter[j].length; k++){
hitter_list1[num][k]=kt_hitter[j][k];
}
return;
}
}
}
else if(wonjung==5){
for(var j=1; j<ssg_hitter.length; j++){
if(value==ssg_hitter[j][0]){
for(var k=0; k<ssg_hitter[j].length; k++){
hitter_list1[num][k]=ssg_hitter[j][k];
}
return;
}
}
}
else if(wonjung==6){
for(var j=1; j<dusan_hitter.length; j++){
if(value==dusan_hitter[j][0]){
for(var k=0; k<dusan_hitter[j].length; k++){
hitter_list1[num][k]=dusan_hitter[j][k];
}
return;
}
}
}
else if(wonjung==7){
for(var j=1; j<kiwoom_hitter.length; j++){
if(value==kiwoom_hitter[j][0]){
for(var k=0; k<kiwoom_hitter[j].length; k++){
hitter_list1[num][k]=kiwoom_hitter[j][k];
}
return;
}
}
}
else if(wonjung==8){
for(var j=1; j<kia_hitter.length; j++){
if(value==kia_hitter[j][0]){
for(var k=0; k<kia_hitter[j].length; k++){
hitter_list1[num][k]=kia_hitter[j][k];
}
return;
}
}
}
else if(wonjung==9){
for(var j=1; j<hanhwa_hitter.length; j++){
if(value==hanhwa_hitter[j][0]){
for(var k=0; k<hanhwa_hitter[j].length; k++){
hitter_list1[num][k]=hanhwa_hitter[j][k];
}
return;
}
}
}
else if(wonjung==10){
for(var j=1; j<lotte_hitter.length; j++){
if(value==lotte_hitter[j][0]){
for(var k=0; k<lotte_hitter[j].length; k++){
hitter_list1[num][k]=lotte_hitter[j][k];
}
return;
}
}
}
}
function hitter2list_append(num, value){
if(home==1){
for(var j=1; j<samsung_hitter.length; j++){
if(value==samsung_hitter[j][0]){
for(var k=0; k<samsung_hitter[j].length; k++){
hitter_list2[num][k]=samsung_hitter[j][k];
}
return;
}
}
}
else if(home==2){
for(var j=1; j<nc_hitter.length; j++){
if(value==nc_hitter[j][0]){
for(var k=0; k<nc_hitter[j].length; k++){
hitter_list2[num][k]=nc_hitter[j][k];
}
return;
}
}
}
else if(home==3){
for(var j=1; j<lg_hitter.length; j++){
if(value==lg_hitter[j][0]){
for(var k=0; k<lg_hitter[j].length; k++){
hitter_list2[num][k]=lg_hitter[j][k];
}
return;
}
}
}
else if(home==4){
for(var j=1; j<kt_hitter.length; j++){
if(value==kt_hitter[j][0]){
for(var k=0; k<kt_hitter[j].length; k++){
hitter_list2[num][k]=kt_hitter[j][k];
}
return;
}
}
}
else if(home==5){
for(var j=1; j<ssg_hitter.length; j++){
if(value==ssg_hitter[j][0]){
for(var k=0; k<ssg_hitter[j].length; k++){
hitter_list2[num][k]=ssg_hitter[j][k];
}
return;
}
}
}
else if(home==6){
for(var j=1; j<dusan_hitter.length; j++){
if(value==dusan_hitter[j][0]){
for(var k=0; k<dusan_hitter[j].length; k++){
hitter_list2[num][k]=dusan_hitter[j][k];
}
return;
}
}
}
else if(home==7){
for(var j=1; j<kiwoom_hitter.length; j++){
if(value==kiwoom_hitter[j][0]){
for(var k=0; k<kiwoom_hitter[j].length; k++){
hitter_list2[num][k]=kiwoom_hitter[j][k];
}
return;
}
}
}
else if(home==8){
for(var j=1; j<kia_hitter.length; j++){
if(value==kia_hitter[j][0]){
for(var k=0; k<kia_hitter[j].length; k++){
hitter_list2[num][k]=kia_hitter[j][k];
}
return;
}
}
}
else if(home==9){
for(var j=1; j<hanhwa_hitter.length; j++){
if(value==hanhwa_hitter[j][0]){
for(var k=0; k<hanhwa_hitter[j].length; k++){
hitter_list2[num][k]=hanhwa_hitter[j][k];
}
return;
}
}
}
else if(home==10){
for(var j=1; j<lotte_hitter.length; j++){
if(value==lotte_hitter[j][0]){
for(var k=0; k<lotte_hitter[j].length; k++){
hitter_list2[num][k]=lotte_hitter[j][k];
}
return;
}
}
}
}
function pitcher1list_append(value){
if(wonjung==1){
for(var j=1; j<samsung_pitcher.length; j++){
if(value==samsung_pitcher[j][0]){
for(var k=0; k<samsung_pitcher[j].length; k++){
pitcher1[k]=samsung_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==2){
for(var j=1; j<nc_pitcher.length; j++){
if(value==nc_pitcher[j][0]){
for(var k=0; k<nc_pitcher[j].length; k++){
pitcher1[k]=nc_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==3){
for(var j=1; j<lg_pitcher.length; j++){
if(value==lg_pitcher[j][0]){
for(var k=0; k<lg_pitcher[j].length; k++){
pitcher1[k]=lg_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==4){
for(var j=1; j<kt_pitcher.length; j++){
if(value==kt_pitcher[j][0]){
for(var k=0; k<kt_pitcher[j].length; k++){
pitcher1[k]=kt_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==5){
for(var j=1; j<ssg_pitcher.length; j++){
if(value==ssg_pitcher[j][0]){
for(var k=0; k<ssg_pitcher[j].length; k++){
pitcher1[k]=ssg_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==6){
for(var j=1; j<dusan_pitcher.length; j++){
if(value==dusan_pitcher[j][0]){
for(var k=0; k<dusan_pitcher[j].length; k++){
pitcher1[k]=dusan_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==7){
for(var j=1; j<kiwoom_pitcher.length; j++){
if(value==kiwoom_pitcher[j][0]){
for(var k=0; k<kiwoom_pitcher[j].length; k++){
pitcher1[k]=kiwoom_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==8){
for(var j=1; j<kia_pitcher.length; j++){
if(value==kia_pitcher[j][0]){
for(var k=0; k<kia_pitcher[j].length; k++){
pitcher1[k]=kia_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==9){
for(var j=1; j<hanhwa_pitcher.length; j++){
if(value==hanhwa_pitcher[j][0]){
for(var k=0; k<hanhwa_pitcher[j].length; k++){
pitcher1[k]=hanhwa_pitcher[j][k];
}
return;
}
}
}
else if(wonjung==10){
for(var j=1; j<lotte_pitcher.length; j++){
if(value==lotte_pitcher[j][0]){
for(var k=0; k<lotte_pitcher[j].length; k++){
pitcher1[k]=lotte_pitcher[j][k];
}
return;
}
}
}
}
function pitcher2list_append(value){
if(home==1){
for(var j=1; j<samsung_pitcher.length; j++){
if(value==samsung_pitcher[j][0]){
for(var k=0; k<samsung_pitcher[j].length; k++){
pitcher2[k]=samsung_pitcher[j][k];
}
return;
}
}
}
else if(home==2){
for(var j=1; j<nc_pitcher.length; j++){
if(value==nc_pitcher[j][0]){
for(var k=0; k<nc_pitcher[j].length; k++){
pitcher2[k]=nc_pitcher[j][k];
}
return;
}
}
}
else if(home==3){
for(var j=1; j<lg_pitcher.length; j++){
if(value==lg_pitcher[j][0]){
for(var k=0; k<lg_pitcher[j].length; k++){
pitcher2[k]=lg_pitcher[j][k];
}
return;
}
}
}
else if(home==4){
for(var j=1; j<kt_pitcher.length; j++){
if(value==kt_pitcher[j][0]){
for(var k=0; k<kt_pitcher[j].length; k++){
pitcher2[k]=kt_pitcher[j][k];
}
return;
}
}
}
else if(home==5){
for(var j=1; j<ssg_pitcher.length; j++){
if(value==ssg_pitcher[j][0]){
for(var k=0; k<ssg_pitcher[j].length; k++){
pitcher2[k]=ssg_pitcher[j][k];
}
return;
}
}
}
else if(home==6){
for(var j=1; j<dusan_pitcher.length; j++){
if(value==dusan_pitcher[j][0]){
for(var k=0; k<dusan_pitcher[j].length; k++){
pitcher2[k]=dusan_pitcher[j][k];
}
return;
}
}
}
else if(home==7){
for(var j=1; j<kiwoom_pitcher.length; j++){
if(value==kiwoom_pitcher[j][0]){
for(var k=0; k<kiwoom_pitcher[j].length; k++){
pitcher2[k]=kiwoom_pitcher[j][k];
}
return;
}
}
}
else if(home==8){
for(var j=1; j<kia_pitcher.length; j++){
if(value==kia_pitcher[j][0]){
for(var k=0; k<kia_pitcher[j].length; k++){
pitcher2[k]=kia_pitcher[j][k];
}
return;
}
}
}
else if(home==9){
for(var j=1; j<hanhwa_pitcher.length; j++){
if(value==hanhwa_pitcher[j][0]){
for(var k=0; k<hanhwa_pitcher[j].length; k++){
pitcher2[k]=hanhwa_pitcher[j][k];
}
return;
}
}
}
else if(home==10){
for(var j=1; j<lotte_pitcher.length; j++){
if(value==lotte_pitcher[j][0]){
for(var k=0; k<lotte_pitcher[j].length; k++){
pitcher2[k]=lotte_pitcher[j][k];
}
return;
}
}
}
}
hitter1_option(wonjung);
pitcher1_option(wonjung);
hitter2_option(home);
pitcher2_option(home);
\ No newline at end of file
function pre_algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2){//algorithm(hitter_list1, hitter_list2, pitcher1, pitcher2) => html에서 가지고와야 한다.
var base1 = 0; var base2 = 0; var base3 = 0; //1이면 주자 있고 0이면 비어있는것
var out = 0; var ining = 1; var home_away = 1;//아웃카운트, 이닝, home이면 1이고 away이면 2.
var score1 = 0; var score2 = 0;
var hitter_num1 = 1; var hitter_num2 = 1;
var hit=false;
document.getElementById('jstest').innerHTML="";
while(true){
if(ining == 9 && home_away == 2 && score1 < score2){//9회 초 후 home팀이 이기고 있을 때!
break;
}
else if(ining==10 && home_away==1 && score1>score2 && hit==false){//9회 말 후 home팀이 이기고 있을 때!
break;
}
else if(ining>9 && score1 < score2){//9회 말 후 home팀이 이기고 있을 때!
break;
}
else if(ining>=11 && home_away==1 && hit==false && score1>score2){//연장 이후 원정팀이 이기고 있을 때!
break;
}
else if(ining>=10 && home_away==2 && hit==true && score1<score2){//끝내기
break;
}
else if(ining==13 && score1==score2){//무승부
break;
}
if(home_away == 1){
var hitter = hitter_list1[hitter_num1]; //hitter = hitter_list1[hitter_number1%9]
var pitcher = pitcher2; //pitcher = pitcher1
document.getElementById('jstest').innerHTML+=(ining+ "회 초"+ "<br\><br\>");
}
else if(home_away == 2){
var hitter = hitter_list2[hitter_num2]; //hitter = hitter_list2[hitter_number2%9]
var pitcher = pitcher1; //pitcher = pitcher2
document.getElementById('jstest').innerHTML+=(ining+ "회 말"+ "<br\><br\>");
}
var num = Math.random();
//hitter_number1 = hitter_number(kia); hitter_number2 = hitter_number(dusan);
if(home_away == 1){
document.getElementById('jstest').innerHTML+=(hitter_num1+"번 타자: "+hitter[0]+ "<br\><br\>");
}
else if(home_away == 2){
document.getElementById('jstest').innerHTML+=(hitter_num2+"번 타자: "+hitter[0]+ "<br\><br\>");
}
var one = 0; var two = 0; var three = 0; var homerun = 0;
one = pitcher[2] * (hitter[2] - hitter[3] - hitter[4] - hitter[5])/hitter[2];
two = pitcher[2] * hitter[3]/hitter[2];
three = pitcher[2] * hitter[4]/hitter[2];
homerun = pitcher[2] * hitter[5]/hitter[2];
hit=true;
if(num <= one){ //안타
var num1 = Math.random();
if(num1 <= 0.5){
switch(home_away){
case 1:
score1 = score1 + base3;
break;
case 2:
score2 = score2 + base3;
break;
}
base3 = base2;
base2 = base1;
base1 = 1;
document.getElementById('jstest').innerHTML+=("1루타!");
}
else{
switch(home_away){
case 1:
score1 = score1 + base3 + base2;
break;
case 2:
score2 = score2 + base3 + base2;
break;
}
base3 = base1;
base2 = 0;
base1 = 1;
document.getElementById('jstest').innerHTML+=("1루타!");
}
}
else if((one < num) && (num <= one + two)){//2루타
var num2 = Math.random();
if(num2 <= 0.4){
switch(home_away){
case 1:
score1 = score1 + base3 + base2;
break;
case 2:
score2 = score2 + base3 + base2;
break;
}
base3 = base1;
base2 = 1;
base1 = 0;
document.getElementById('jstest').innerHTML+=("2루타!");
}
else if(0.4 < num2 && num2 <=0.7){
switch(home_away){
case 1:
score1 = score1 + base3 + base2 + base1;
break;
case 2:
score2 = score2 + base3 + base2 + base1;
break;
}
base3 = 0;
base2 = 1;
base1 = 0;
document.getElementById('jstest').innerHTML+=("2루타!");
}
else{
switch(home_away){
case 1:
score1 = score1 + base3 + base2;
break;
case 2:
score2 = score2 + base3 + base2;
break;
}
base3 = 0;
base2 = 1;
base1 = 0;
document.getElementById('jstest').innerHTML+=("2루타!");
}
}
else if((one + two < num) && (num <= one + two + three)){//3루타
switch(home_away){
case 1:
score1 = score1 + base3 + base2 + base1;
break;
case 2:
score2 = score2 + base3 + base2 + base1;
break;
}
base3 = 1;
base2 = 0;
base1 = 0;
document.getElementById('jstest').innerHTML+=("3루타!");
}
else if(one + two + three < num && num <= one + two + three + homerun){//홈런
switch(home_away){
case 1:
score1 = score1 + base3 + base2 + base1 + 1;
break;
case 2:
score2 = score2 + base3 + base2 + base1 + 1;
break;
}
base3 = 0;
base2 = 0;
base1 = 0;
document.getElementById('jstest').innerHTML+=("홈런!");
}
else if( pitcher[2] < num && (num <= pitcher[2] +pitcher[1]*0.01)){//볼넷
if(base1==1 && base2==1 && base3==1){//만루 밀어내기 득점 -> 스코어 ++
if(home_away==1){
score1++;
}
else{
score2++;
}
}
else{//스코어 추가되지 않는 경우
if((base2==1 && base1==0 )||(base3==1 && base1==0)||(base2==1&&base3==1&&base1==0)){//2루만 채워져있거나 3루만 채워져있거나 2,3루만 채워져있거나
base1=1;
}
else if(base1==1 && base3==1 && base2==0){//1루 3루 채워져있고 2루 비워져있거나
base2=base1;
base1=1;
}
else{
base3 = base2;
base2 = base1;
base1 = 1;
}
}
document.getElementById('jstest').innerHTML+=("볼넷!");
}
else{//아웃
out++;
document.getElementById('jstest').innerHTML+=("아웃!");
}
document.getElementById('jstest').innerHTML+=("베이스 상태"+"<br\>"+ "1루 " + base1 + "<br\>"+"2루 " + base2 + "<br\>"+
"3루 " + base3 + "<br\><br\>");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score1 +"vs"+score2+ "<br\>");
document.getElementById('jstest').innerHTML+=("아웃카운트: "+out+"<br\><br\>");
if(out >= 3){
switch(home_away){
case 1:
home_away = 2;
hit=false;
break;
case 2:
home_away = 1;
ining++;
hit=false;
break;
}
out=0;
base1=0; base2=0; base3=0;
}
else{
if(home_away == 1){
hitter_num1++;
if(hitter_num1>=10){
hitter_num1=1;
}
}
else if(home_away == 2){
hitter_num2++;
if(hitter_num2>=10){
hitter_num2=1;
}
}
}
}
document.getElementById('jstest').innerHTML+=("<br\><br\>"+"최종스코어 : "+score1+"vs"+score2);
}
\ No newline at end of file