정주희

delete

.picture1{
width: 100px;
height: 100px;
border: 1px solid black;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>일정</title>
<link rel="stylesheet" type="text/css"href="calander.css">
<script src = "kia.js"></script>
<script src = "dusan.js"></script>
<script src = "algorithm.js"></script>
<script src = "shuffle_list.js"></script>
</head>
<body>
<div class = "container1">
<input type="button" onclick = algorithm() value = "start">
</div>
<div class="container3">
<ul class = "image-container">
<div>
<img src="player_picture/KIA/KIA_hitter_jpgs/김호령.jpg">
<input type="button" value = "김호령" id = "김호령" name = "kia" onclick = shuffle(this)>
<input type="button" value = "삭제" name = "김호령" onclick = remove(this)>
</div>
<div>
<img src="player_picture/KIA/KIA_hitter_jpgs/최형우.jpg">
<input type="button" value = "최형우" id = "최형우" name = "kia" onclick = shuffle(this)>
<input type="button" value = "삭제" name = "최형우" onclick = remove(this)>
</div>
</ul>
</div>
</body>
</html>
\ No newline at end of file
function aaaa(){
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;
document.getElementById('jstest').innerHTML=" ";
for(i = 0; i < 10; i++){
var num = Math.random();
document.getElementById('jstest').innerHTML+=(num+" "+"<br\>");
//hitter_number1 = hitter_number(kia); hitter_number2 = hitter_number(dusan);
hitter = kia_hitter[1]; //선발타자, 나중에 사용자가 지정해주는 타자로 바뀌도록 수정해야 한다.
document.getElementById('jstest').innerHTML+=(hitter[0]+" ");
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.getElementById('jstest').innerHTML+=("확률" + " " + "1루타 " + one+ " "+"2루타 " +
two+" "+"3루타 "+ three+ " ","홈런 " + homerun, " ");//////////////////////////////
if(num <= one){ //그냥 간단하게 다음 베이스로 한 칸씩 이동하도록 계산, 모든 경우의 수 계산하는게 불가능
var num1 = Math.random();
if(num1 <= 0.5){
score = score + base3;
base3 = base2;
base2 = base1;
base1 = 1;
document.getElementById('jstest').innerHTML+=("1루타!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" ", "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
if(num1 > 0.5){
score = score + base3 + base2;
base3 = base1;
base2 = 0;
base1 = 1;
document.getElementById('jstest').innerHTML+=("1루타!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
}
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.getElementById('jstest').innerHTML+=("2루타!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
if(0.4 < num2 && num2 <=0.7){
score = score + base3 + base2 + base1;
base3 = 0;
base2 = 1;
base1 = 0;
document.getElementById('jstest').innerHTML+=("2루타!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
if(0.7 < num2 && num2 <= 1){
score = score + base3 + base2;
base3 = 0;
base2 = 1;
base1 = 0;
out++;
document.getElementById('jstest').innerHTML+=("2루타!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
}
else if(one + two < num && num <= one + two + three){
score = score + base3 + base2 + base1;
base3 = 1;
base2 = 0;
base1 = 0;
document.getElementById('jstest').innerHTML+=("3루타!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
else if(one + two + three < num && num <= one + two + three + homerun){
score = score + base3 + base2 + base1 + 1;
base3 = 0;
base2 = 0;
base1 = 0;
document.getElementById('jstest').innerHTML+=("홈런!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
}
if( kia_pitcher[1][2] < num && num <= kia_pitcher[1][2] + kia_pitcher[1][1]*0.01){
base3 = base2;
base2 = base1;
base1 = 1;
document.getElementById('jstest').innerHTML+=("볼넷!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
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.getElementById('jstest').innerHTML+=("아웃!");
document.getElementById('jstest').innerHTML+=("베이스 상태"+" "+ "1루 " + base1 + " "+ "2루 " + base2 + " "+
"3루 " + base3 + " ");///////////////////////////
document.getElementById('jstest').innerHTML+=("score: "+score+ " ");
}
}
}
\ 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
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],
]
var dusan_pitcher = [
['선수명', '볼넷%', '피안타율'],
['로켓', 7.7, 0.267],
['미란다', 15.3, 0.259],
['최원준', 5.7, 0.215],
['홍건희', 12.5, 0.224],
['김강률', 13.8, 0.217],
['이승진', 7.2, 0.202],
['유희관', 7.7, 0.381],
['곽빈', 15.9, 0.291],
['김명신', 4.1, 0.303],
['조제영', 17.3, 0.286],
['김민규', 8.8, 0.3],
['박종기', 3.4, 0.236],
['이영하', 12.8, 0.388],
]
var dusan_hitter_shuffle = [
['선수명', '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_shuffle = [
['선수명', '볼넷%', '피안타율']
['로켓', 7.7, 0.267],
['미란다', 15.3, 0.259],
['최원준', 5.7, 0.215],
['홍건희', 12.5, 0.224],
['김강률', 13.8, 0.217],
['이승진', 7.2, 0.202],
['유희관', 7.7, 0.381],
['곽빈', 15.9, 0.291],
['김명신', 4.1, 0.303],
['조제영', 17.3, 0.286],
['김민규', 8.8, 0.3],
['박종기', 3.4, 0.236],
['이영하', 12.8, 0.388],
]
\ No newline at end of file
File mode changed
function shuffle(x){
if(x.name === "kia"){
for(j = 0; j < kia_hitter_shuffle.length; j++){
if(kia_hitter_shuffle.length == 0){
continue;
}
else if(x.value == kia_hitter_shuffle[j][0]){
console.log(x.value == kia_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < kia_hitter.length; i++){
if(x.value == kia_hitter[i][0]){
kia_hitter_shuffle.push(kia_hitter[i]);
}
}
}
console.log(kia_hitter_shuffle);
////////////////////////////////////////////////////////////////
if(x.name === "dusan"){
for(j = 0; j < dusan_hitter_shuffle.length; j++){
if(dusan_hitter_shuffle.length == 0){
continue;
}
else if(x.value == dusan_hitter_shuffle[j][0]){
console.log(x.value == dusan_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < dusan_hitter.length; i++){
if(x.value == dusan_hitter[i][0]){
dusan_hitter_shuffle.push(dusan_hitter[i]);
}
}
}
console.log(dusan_hitter_shuffle);
//나머지 팀들 똑같이 추가
if(x.name === "hanhwa"){
for(j = 0; j < hanhwa_hitter_shuffle.length; j++){
if(hanhwa_hitter_shuffle.length == 0){
continue;
}
else if(x.value == hanhwa_hitter_shuffle[j][0]){
console.log(x.value == hanhwa_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < hanhwa_hitter.length; i++){
if(x.value == hanhwa_hitter[i][0]){
hanhwa_hitter_shuffle.push(hanhwa_hitter[i]);
}
}
}
console.log(hanhwa_hitter_shuffle);
if(x.name === "kiwoom"){
for(j = 0; j < kiwoom_hitter_shuffle.length; j++){
if(kiwoom_hitter_shuffle.length == 0){
continue;
}
else if(x.value == kiwoom_hitter_shuffle[j][0]){
console.log(x.value == kiwoom_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < kiwoom_hitter.length; i++){
if(x.value == kiwoom_hitter[i][0]){
kiwoom_hitter_shuffle.push(kiwoom_hitter[i]);
}
}
}
console.log(kiwoom_hitter_shuffle);
if(x.name === "kt"){
for(j = 0; j < kt_hitter_shuffle.length; j++){
if(kt_hitter_shuffle.length == 0){
continue;
}
else if(x.value == kt_hitter_shuffle[j][0]){
console.log(x.value == kt_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < kt_hitter.length; i++){
if(x.value == kt_hitter[i][0]){
kt_hitter_shuffle.push(kt_hitter[i]);
}
}
}
console.log(kt_hitter_shuffle);
if(x.name === "lg"){
for(j = 0; j < lg_hitter_shuffle.length; j++){
if(lg_hitter_shuffle.length == 0){
continue;
}
else if(x.value == lg_hitter_shuffle[j][0]){
console.log(x.value == lg_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < lg_hitter.length; i++){
if(x.value == lg_hitter[i][0]){
lg_hitter_shuffle.push(lg_hitter[i]);
}
}
}
console.log(lg_hitter_shuffle);
if(x.name === "lotte"){
for(j = 0; j < lotte_hitter_shuffle.length; j++){
if(lotte_hitter_shuffle.length == 0){
continue;
}
else if(x.value == lotte_hitter_shuffle[j][0]){
console.log(x.value == lotte_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < lotte_hitter.length; i++){
if(x.value == lotte_hitter[i][0]){
lotte_hitter_shuffle.push(lotte_hitter[i]);
}
}
}
console.log(lotte_hitter_shuffle);
if(x.name === "nc"){
for(j = 0; j < nc_hitter_shuffle.length; j++){
if(nc_hitter_shuffle.length == 0){
continue;
}
else if(x.value == nc_hitter_shuffle[j][0]){
console.log(x.value == nc_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < nc_hitter.length; i++){
if(x.value == nc_hitter[i][0]){
nc_hitter_shuffle.push(nc_hitter[i]);
}
}
}
console.log(nc_hitter_shuffle);
if(x.name === "samsung"){
for(j = 0; j < samsung_hitter_shuffle.length; j++){
if(samsung_hitter_shuffle.length == 0){
continue;
}
else if(x.value == samsung_hitter_shuffle[j][0]){
console.log(x.value == samsung_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < samsung_hitter.length; i++){
if(x.value == samsung_hitter[i][0]){
samsung_hitter_shuffle.push(samsung_hitter[i]);
}
}
}
console.log(samsung_hitter_shuffle);
if(x.name === "ssg"){
for(j = 0; j < ssg_hitter_shuffle.length; j++){
if(ssg_hitter_shuffle.length == 0){
continue;
}
else if(x.value == ssg_hitter_shuffle[j][0]){
console.log(x.value == ssg_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < ssg_hitter.length; i++){
if(x.value == ssg_hitter[i][0]){
ssg_hitter_shuffle.push(ssg_hitter[i]);
}
}
}
console.log(ssg_hitter_shuffle);
}
////////////////remove
function remove(x){
if(document.getElementById(x.name).name == 'kia'){
for(i = 0; i < kia_hitter_shuffle.length; i++){
if(kia_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == kia_hitter_shuffle[i][0]){
kia_hitter_shuffle.splice(i,1);
}
}
}
console.log(kia_hitter_shuffle);
//나머지 팀들 똑같이 추가
if(document.getElementById(x.name).name == 'dusan'){
for(i = 0; i < dusan_hitter_shuffle.length; i++){
if(dusan_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == dusan_hitter_shuffle[i][0]){
dusan_hitter_shuffle.splice(i,1);
}
}
}
console.log(dusan_hitter_shuffle);
if(document.getElementById(x.name).name == 'hanhwa'){
for(i = 0; i < hanhwa_hitter_shuffle.length; i++){
if(hanhwa_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == hanhwa_hitter_shuffle[i][0]){
hanhwa_hitter_shuffle.splice(i,1);
}
}
}
console.log(hanhwa_hitter_shuffle);
if(document.getElementById(x.name).name == 'kiwoom'){
for(i = 0; i < kiwoom_hitter_shuffle.length; i++){
if(kiwoom_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == kiwoom_hitter_shuffle[i][0]){
kiwoom_hitter_shuffle.splice(i,1);
}
}
}
console.log(kiwoom_hitter_shuffle);
if(document.getElementById(x.name).name == 'kt'){
for(i = 0; i < kt_hitter_shuffle.length; i++){
if(kt_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == kt_hitter_shuffle[i][0]){
kt_hitter_shuffle.splice(i,1);
}
}
}
console.log(kt_hitter_shuffle);
if(document.getElementById(x.name).name == 'lg'){
for(i = 0; i < lg_hitter_shuffle.length; i++){
if(lg_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == lg_hitter_shuffle[i][0]){
lg_hitter_shuffle.splice(i,1);
}
}
}
console.log(lg_hitter_shuffle);
if(document.getElementById(x.name).name == 'lotte'){
for(i = 0; i < lotte_hitter_shuffle.length; i++){
if(lotte_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == lotte_hitter_shuffle[i][0]){
lotte_hitter_shuffle.splice(i,1);
}
}
}
console.log(lotte_hitter_shuffle);
if(document.getElementById(x.name).name == 'nc'){
for(i = 0; i < nc_hitter_shuffle.length; i++){
if(nc_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == nc_hitter_shuffle[i][0]){
nc_hitter_shuffle.splice(i,1);
}
}
}
console.log(nc_hitter_shuffle);
if(document.getElementById(x.name).name == 'samsung'){
for(i = 0; i < samsung_hitter_shuffle.length; i++){
if(samsung_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == samsung_hitter_shuffle[i][0]){
samsung_hitter_shuffle.splice(i,1);
}
}
}
console.log(samsung_hitter_shuffle);
if(document.getElementById(x.name).name == 'ssg'){
for(i = 0; i < ssg_hitter_shuffle.length; i++){
if(ssg_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == ssg_hitter_shuffle[i][0]){
ssg_hitter_shuffle.splice(i,1);
}
}
}
console.log(ssg_hitter_shuffle);
}
\ No newline at end of file
function shuffle(x){
if(x.name === "kia"){
for(j = 0; j < kia_hitter_shuffle.length; j++){
if(kia_hitter_shuffle.length == 0){
continue;
}
else if(x.value == kia_hitter_shuffle[j][0]){
console.log(x.value == kia_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < kia_hitter.length; i++){
if(x.value == kia_hitter[i][0]){
kia_hitter_shuffle.push(kia_hitter[i]);
}
}
}
console.log(kia_hitter_shuffle);
////////////////////////////////////////////////////////////////
if(x.name === "dusan"){
for(j = 0; j < dusan_hitter_shuffle.length; j++){
if(dusan_hitter_shuffle.length == 0){
continue;
}
else if(x.value == dusan_hitter_shuffle[j][0]){
console.log(x.value == dusan_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < dusan_hitter.length; i++){
if(x.value == dusan_hitter[i][0]){
dusan_hitter_shuffle.push(dusan_hitter[i]);
}
}
}
console.log(dusan_hitter_shuffle);
//나머지 팀들 똑같이 추가
if(x.name === "hanhwa"){
for(j = 0; j < hanhwa_hitter_shuffle.length; j++){
if(hanhwa_hitter_shuffle.length == 0){
continue;
}
else if(x.value == hanhwa_hitter_shuffle[j][0]){
console.log(x.value == hanhwa_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < hanhwa_hitter.length; i++){
if(x.value == hanhwa_hitter[i][0]){
hanhwa_hitter_shuffle.push(hanhwa_hitter[i]);
}
}
}
console.log(hanhwa_hitter_shuffle);
if(x.name === "kiwoom"){
for(j = 0; j < kiwoom_hitter_shuffle.length; j++){
if(kiwoom_hitter_shuffle.length == 0){
continue;
}
else if(x.value == kiwoom_hitter_shuffle[j][0]){
console.log(x.value == kiwoom_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < kiwoom_hitter.length; i++){
if(x.value == kiwoom_hitter[i][0]){
kiwoom_hitter_shuffle.push(kiwoom_hitter[i]);
}
}
}
console.log(kiwoom_hitter_shuffle);
if(x.name === "kt"){
for(j = 0; j < kt_hitter_shuffle.length; j++){
if(kt_hitter_shuffle.length == 0){
continue;
}
else if(x.value == kt_hitter_shuffle[j][0]){
console.log(x.value == kt_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < kt_hitter.length; i++){
if(x.value == kt_hitter[i][0]){
kt_hitter_shuffle.push(kt_hitter[i]);
}
}
}
console.log(kt_hitter_shuffle);
if(x.name === "lg"){
for(j = 0; j < lg_hitter_shuffle.length; j++){
if(lg_hitter_shuffle.length == 0){
continue;
}
else if(x.value == lg_hitter_shuffle[j][0]){
console.log(x.value == lg_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < lg_hitter.length; i++){
if(x.value == lg_hitter[i][0]){
lg_hitter_shuffle.push(lg_hitter[i]);
}
}
}
console.log(lg_hitter_shuffle);
if(x.name === "lotte"){
for(j = 0; j < lotte_hitter_shuffle.length; j++){
if(lotte_hitter_shuffle.length == 0){
continue;
}
else if(x.value == lotte_hitter_shuffle[j][0]){
console.log(x.value == lotte_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < lotte_hitter.length; i++){
if(x.value == lotte_hitter[i][0]){
lotte_hitter_shuffle.push(lotte_hitter[i]);
}
}
}
console.log(lotte_hitter_shuffle);
if(x.name === "nc"){
for(j = 0; j < nc_hitter_shuffle.length; j++){
if(nc_hitter_shuffle.length == 0){
continue;
}
else if(x.value == nc_hitter_shuffle[j][0]){
console.log(x.value == nc_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < nc_hitter.length; i++){
if(x.value == nc_hitter[i][0]){
nc_hitter_shuffle.push(nc_hitter[i]);
}
}
}
console.log(nc_hitter_shuffle);
if(x.name === "samsung"){
for(j = 0; j < samsung_hitter_shuffle.length; j++){
if(samsung_hitter_shuffle.length == 0){
continue;
}
else if(x.value == samsung_hitter_shuffle[j][0]){
console.log(x.value == samsung_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < samsung_hitter.length; i++){
if(x.value == samsung_hitter[i][0]){
samsung_hitter_shuffle.push(samsung_hitter[i]);
}
}
}
console.log(samsung_hitter_shuffle);
if(x.name === "ssg"){
for(j = 0; j < ssg_hitter_shuffle.length; j++){
if(ssg_hitter_shuffle.length == 0){
continue;
}
else if(x.value == ssg_hitter_shuffle[j][0]){
console.log(x.value == ssg_hitter_shuffle[j][0])
return 0;
}
}
for(i = 0; i < ssg_hitter.length; i++){
if(x.value == ssg_hitter[i][0]){
ssg_hitter_shuffle.push(ssg_hitter[i]);
}
}
}
console.log(ssg_hitter_shuffle);
}
////////////////remove
function remove(x){
if(document.getElementById(x.name).name == 'kia'){
for(i = 0; i < kia_hitter_shuffle.length; i++){
if(kia_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == kia_hitter_shuffle[i][0]){
kia_hitter_shuffle.splice(i,1);
}
}
}
console.log(kia_hitter_shuffle);
//나머지 팀들 똑같이 추가
if(document.getElementById(x.name).name == 'dusan'){
for(i = 0; i < dusan_hitter_shuffle.length; i++){
if(dusan_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == dusan_hitter_shuffle[i][0]){
dusan_hitter_shuffle.splice(i,1);
}
}
}
console.log(dusan_hitter_shuffle);
if(document.getElementById(x.name).name == 'hanhwa'){
for(i = 0; i < hanhwa_hitter_shuffle.length; i++){
if(hanhwa_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == hanhwa_hitter_shuffle[i][0]){
hanhwa_hitter_shuffle.splice(i,1);
}
}
}
console.log(hanhwa_hitter_shuffle);
if(document.getElementById(x.name).name == 'kiwoom'){
for(i = 0; i < kiwoom_hitter_shuffle.length; i++){
if(kiwoom_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == kiwoom_hitter_shuffle[i][0]){
kiwoom_hitter_shuffle.splice(i,1);
}
}
}
console.log(kiwoom_hitter_shuffle);
if(document.getElementById(x.name).name == 'kt'){
for(i = 0; i < kt_hitter_shuffle.length; i++){
if(kt_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == kt_hitter_shuffle[i][0]){
kt_hitter_shuffle.splice(i,1);
}
}
}
console.log(kt_hitter_shuffle);
if(document.getElementById(x.name).name == 'lg'){
for(i = 0; i < lg_hitter_shuffle.length; i++){
if(lg_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == lg_hitter_shuffle[i][0]){
lg_hitter_shuffle.splice(i,1);
}
}
}
console.log(lg_hitter_shuffle);
if(document.getElementById(x.name).name == 'lotte'){
for(i = 0; i < lotte_hitter_shuffle.length; i++){
if(lotte_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == lotte_hitter_shuffle[i][0]){
lotte_hitter_shuffle.splice(i,1);
}
}
}
console.log(lotte_hitter_shuffle);
if(document.getElementById(x.name).name == 'nc'){
for(i = 0; i < nc_hitter_shuffle.length; i++){
if(nc_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == nc_hitter_shuffle[i][0]){
nc_hitter_shuffle.splice(i,1);
}
}
}
console.log(nc_hitter_shuffle);
if(document.getElementById(x.name).name == 'samsung'){
for(i = 0; i < samsung_hitter_shuffle.length; i++){
if(samsung_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == samsung_hitter_shuffle[i][0]){
samsung_hitter_shuffle.splice(i,1);
}
}
}
console.log(samsung_hitter_shuffle);
if(document.getElementById(x.name).name == 'ssg'){
for(i = 0; i < ssg_hitter_shuffle.length; i++){
if(ssg_hitter_shuffle.length == 0){
return 0;
}
else if(document.getElementById(x.name).value == ssg_hitter_shuffle[i][0]){
ssg_hitter_shuffle.splice(i,1);
}
}
}
console.log(ssg_hitter_shuffle);
}
\ No newline at end of file