블랙잭/script.js: 두 판 사이의 차이

리버티게임, 모두가 만들어가는 자유로운 게임
백괴게임>Riemann
잔글편집 요약 없음
잔글편집 요약 없음
 
(사용자 3명의 중간 판 38개는 보이지 않습니다)
1번째 줄: 1번째 줄:
<div style="display:none">
var title = mw.config.get('wgPageName');
요령 => 아래 변수들의 첫번째 인자들을 내용에 맞게 자르고 붙여넣어주세요
if (title.slice( 1, 2 ) == "") {
!!!!!!!!!!!!!!!! 플러그인 정보 입력 구간 윗부분은 만지지 마시오 절대로!!!!!!!!!!!!!!!!!
    var blind = true;
 
    var defa = 20;
} else {
    var blind = false;
    var defa = 10;
}
var mult = defa;
$("#multiplier").text(mult);


{{#vardefine:name|p21}}
var coins = 100;
{{#vardefine:creat|Riemann}}
var wincount = 0;
{{#vardefine:version|0.780}}
var losecount = 0;
{{#vardefine:descript|블랙잭}}
//$("#console").text("스코어: " + coins + "점");
{{#vardefine:local|true}}
$("#console").text("스코어: " + wincount + "승 " + losecount + "패");
{{#vardefine:executable|true}}
$("#console").append("\n블랙잭에 오신 것을 환영합니다.");


{{#vardefine:code|
<nowiki>
const pcLst = [
const pcLst = [
0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAD,0xAE,
0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAD,0xAE,
19번째 줄: 23번째 줄:
0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDD,0xDE];
0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDD,0xDE];
const pointData = {a1:1,a2:2,a3:3,a4:4,a5:5,a6:6,a7:7,a8:8,a9:9,aa:10,ab:10,ad:10,ae:10,b1:1,b2:2,b3:3,b4:4,b5:5,b6:6,b7:7,b8:8,b9:9,ba:10,bb:10,bd:10,be:10,c1:1,c2:2,c3:3,c4:4,c5:5,c6:6,c7:7,c8:8,c9:9,ca:10,cb:10,cd:10,ce:10,d1:1,d2:2,d3:3,d4:4,d5:5,d6:6,d7:7,d8:8,d9:9,da:10,db:10,dd:10,de:10};
const pointData = {a1:1,a2:2,a3:3,a4:4,a5:5,a6:6,a7:7,a8:8,a9:9,aa:10,ab:10,ad:10,ae:10,b1:1,b2:2,b3:3,b4:4,b5:5,b6:6,b7:7,b8:8,b9:9,ba:10,bb:10,bd:10,be:10,c1:1,c2:2,c3:3,c4:4,c5:5,c6:6,c7:7,c8:8,c9:9,ca:10,cb:10,cd:10,ce:10,d1:1,d2:2,d3:3,d4:4,d5:5,d6:6,d7:7,d8:8,d9:9,da:10,db:10,dd:10,de:10};
var pcSet = [];
function hexToChar(x) {
function hexToChar(x) {
     return String.fromCharCode(0xD83C) +String.fromCharCode(x + 0xDC00);
     return String.fromCharCode(0xD83C) +String.fromCharCode(x + 0xDC00);
25번째 줄: 30번째 줄:
     return x.toString(16);
     return x.toString(16);
}
}
var dealerD, guestD;
$("#deal").click(function(){
$("#deal").click(function(){
     console.log("init");
     //$("#console").text("스코어: " + coins + "점");
     console.log(guestD);
     $("#console").text("스코어: " + wincount + "승 " + losecount + "패");
    console.log(score);
     $("#console").append("\n새 판을 엽니다.");
     $("#console").text("판을 엽니다.")
     $("#deal").css("display", "none");
     $("#deal").css("display", "none");
     $("#dealerDeck").text("");
     $("#dealerDeck").text("");
     $("#guestDeck").text("");
     $("#guestDeck").text("");
     pcSet = pcLst;
     pcSet = Object.create(pcLst);
     var dealerD = [];
     deal();
     var guestD = [];
    return 0;
});
$("#hit").click(function(){
    hit();
    return 0;
});
$("#stand").click(function(){
    stand();
    return 0;
});
$("#surrender").click(function(){
    surrender();
    return 0;
});
$("#plus").click(function(){
    inc();
    return 0;
});
$("#minus").click(function(){
    dec();
    return 0;
});
$("#reset").click(function(){
    reset();
    return 0;
});
function reset() {
    mult = defa;
    $("#multiplier").text(mult);
}
 
/*
function inc() {
    if (mult < 100) {
        mult += 2;
    } else {
        alert("최대 100 코인까지만 걸 수 있습니다.");
    }
    $("#multiplier").text(mult);
}
 
function dec() {
    if (mult > 2) {
        mult -= 2;
    } else {
        alert("설마 빚을 판돈으로 거시려고요?");
    }
    $("#multiplier").text(mult);
}
*/
 
function deal() {
    dealerD = [];
     guestD = [];
     dealerD.push(cardPop());
     dealerD.push(cardPop());
     guestD.push(cardPop());
     guestD.push(cardPop());
     dealerD.push(cardPop());
     dealerD.push(cardPop());
     guestD.push(cardPop());
     guestD.push(cardPop());
     $("#dealerDeck").text(hexToChar(dealerD[0]) + "\u{1F0A0}");
     if (blind == true) {
        $("#dealerDeck").text("\u{1F0A0}\u{1F0A0}");
    } else {
        $("#dealerDeck").text(hexToChar(dealerD[0]) + "\u{1F0A0}");
    }
     $("#dealerS").text("?");
     $("#dealerS").text("?");
     $("#guestDeck").text(hexToChar(guestD[0]) + hexToChar(guestD[1]));
     if (blind == true) {
        $("#guestDeck").text("\u{1F0A0}\u{1F0A0}");
    } else {
        $("#guestDeck").text(hexToChar(guestD[0]) + hexToChar(guestD[1]));
    }
     var guestScore = [];
     var guestScore = [];
     var score = pointData[hexToStr(guestD[0])] + pointData[hexToStr(guestD[1])];
     var score = pointData[hexToStr(guestD[0])] + pointData[hexToStr(guestD[1])];
52번째 줄: 118번째 줄:
         $("#hit").css("display", "inline-flex");
         $("#hit").css("display", "inline-flex");
         $("#stand").css("display", "inline-flex");
         $("#stand").css("display", "inline-flex");
         $("#hit").click(function(){
         $("#surrender").css("display", "inline-flex");
            console.log("hit");
    }
            console.log(guestD);
}
            hit(dealerD, guestD);
function hit() {
        });
    $("#hit").css("display", "none");
        $("#stand").click(function(){
    $("#stand").css("display", "none");
            stand(dealerD, guestD);
    $("#surrender").css("display", "none");
         });
    guestD.push(cardPop());
    var guestDeq = "";
    for (i = 0; i < guestD.length; i++) {
         guestDeq += hexToChar(guestD[i]);
     }
     }
     function hit(dd, gd) {
     if (blind == true) {
         $("#hit").css("display", "none");
         $("#guestDeck").text("\u{1F0A0}".repeat(guestDeq.length / 2));
        $("#stand").css("display", "none");
    } else {
        gd.push(cardPop());
        var guestDeq = "";
        for (i = 0; i < gd.length; i++) {
            guestDeq += hexToChar(gd[i]);
        }
         $("#guestDeck").text(guestDeq);
         $("#guestDeck").text(guestDeq);
        var guestScore = [];
        var score = 0;
        for (i = 0; i < gd.length; i++) {
            guestScore.push(pointData[hexToStr(gd[i])]);
            score += guestScore[i];
        }
        $("#guestS").text(score);
        if (score == 21 || (score == 11 && guestScore.includes(1))) {
            $("#console").text("21점이므로 자동으로 스탠드를 외쳤습니다.")
            stand(dd,gd);
        } else if (score > 21) {
            bust();
        } else  {
            $("#hit").css("display", "inline-flex");
            $("#stand").css("display", "inline-flex");
        }
     }
     }
     function stand(ddd, gdd) {
     var guestScore = [];
         $("#hit").css("display", "none");
    var score = 0;
        $("#stand").css("display", "none");
    for (i = 0; i < guestD.length; i++) {
        var dScore = 0;
        guestScore.push(pointData[hexToStr(guestD[i])]);
         var dealerScore = []
        score += guestScore[i];
         for (i = 0; i < ddd.length; i++) {
    }
             dealerScore.push(pointData[hexToStr(ddd[i])]);
    $("#guestS").text(score);
    if (score == 21 || (score == 11 && guestScore.includes(1))) {
        $("#console").append("\n21점이므로 자동으로 스탠드를 외쳤습니다.");
        stand(dealerD,guestD);
    } else if (score > 21) {
        bust();
    } else  {
         $("#hit").css("display", "inline-flex");
        $("#stand").css("display", "inline-flex");
    }
    return 0;
}
function stand() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    var dScore = 0;
    var dealerScore = [];
    for (i = 0; i < dealerD.length; i++) {
        dealerScore.push(pointData[hexToStr(dealerD[i])]);
        dScore += dealerScore[i];
    }
    while (dScore < 17) {
        dealerD.push(cardPop());
        $("#console").append("\n딜러가 카드를 뽑았습니다.");
         dealerScore = [];
        dScore = 0;
         for (i = 0; i < dealerD.length; i++) {
             dealerScore.push(pointData[hexToStr(dealerD[i])]);
             dScore += dealerScore[i];
             dScore += dealerScore[i];
            dealerDeq += hexToChar(dealerD[i]);
         }
         }
        while (dScore < 17) {
    }
            ddd.push(cardPop());
    var dealerDeq = "";
            $("#console").text("br/>딜러가 카드를 뽑았습니다.")
    for (i = 0; i < dealerD.length; i++) {
            dealerScore = [];
            dealerDeq += hexToChar(dealerD[i]);
            dScore = 0;
            for (i = 0; i < ddd.length; i++) {
                dealerScore.push(pointData[hexToStr(ddd[i])]);
                dScore += dealerScore[i];
                dealerDeq += hexToChar(ddd[i]);
            }
        }
        var dealerDeq = "";
        for (i = 0; i < ddd.length; i++) {
                dealerDeq += hexToChar(ddd[i]);
            }
        $("#dealerS").text(dScore);
        $("#dealerDeck").text(dealerDeq);
        guestScore = [];
        score = 0;
        for (i = 0; i < gdd.length; i++) {
            guestScore.push(pointData[hexToStr(gdd[i])]);
            score += guestScore[i];
        }
        $("#guestS").text(score);
        console.log(score);
        if (score > 21) {
            bust()
        } else if (dScore > 21) {
            win()
        } else {
            compare(ddd,gdd);
         }
         }
    $("#dealerS").text(dScore);
    $("#dealerDeck").text(dealerDeq);
    guestScore = [];
    score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    $("#guestS").text(score);
    if (score > 21) {
        bust();
    } else if (dScore > 21) {
        $("#console").append("\n딜러의 버스트.");
        win();
    } else {
        $("#console").append("\n딜러의 스탠드.");
        compare(dealerD,guestD);
     }
     }
     function compare(d, g) {
     return 0;
        var dealerScore = [];
}
        var dScore = 0;
function compare() {
        for (i = 0; i < d.length; i++) {
    var dealerScore = [];
            dealerScore.push(pointData[hexToStr(d[i])]);
    var dScore = 0;
            dScore += dealerScore[i];
    for (i = 0; i < dealerD.length; i++) {
        }
        dealerScore.push(pointData[hexToStr(dealerD[i])]);
        var guestScore = [];
        dScore += dealerScore[i];
        var score = 0;
        for (i = 0; i < g.length; i++) {
            guestScore.push(pointData[hexToStr(g[i])]);
            score += guestScore[i];
        }
        if (dScore < 12 && dealerScore.includes(1)) {
            dScore += 10
        }
        if (score < 12 && guestScore.includes(1)) {
            score += 10
        }
        $("#dealerS").text(dScore);
        $("#guestS").text(score);
        if (dScore > score) {
            lose()
        } else if (dScore == score) {
            push()
        } else {
            win()
        }
     }
     }
     function win() {
     var guestScore = [];
         $("#console").text("축하합니다! 이겼습니다.")
    var score = 0;
         $("#deal").css("display", "inline-flex");
    for (i = 0; i < guestD.length; i++) {
         guestScore.push(pointData[hexToStr(guestD[i])]);
         score += guestScore[i];
     }
     }
     function lose() {
     if (dScore < 12 && dealerScore.includes(1)) {
        $("#console").text("졌습니다...")
         dScore += 10;
         $("#deal").css("display", "inline-flex");
     }
     }
     function push() {
     if (score < 12 && guestScore.includes(1)) {
        $("#console").text("비겼습니다.")
         score += 10;
         $("#deal").css("display", "inline-flex");
     }
     }
     function bust() {
     $("#dealerS").text(dScore);
        $("#console").text("버스트! 유감입니다. 졌습니다...")
    $("#guestS").text(score);
        $("#hit").css("display", "none");
    if (dScore > score) {
         $("#stand").css("display", "none");
         lose();
         $("#deal").css("display", "inline-flex");
    } else if (dScore == score) {
         push();
    } else {
        win();
     }
     }
     function jack() {
     return 0;
        $("#console").text("블랙잭 달성! 축하합니다. 이겼습니다!")
}
        $("#deal").css("display", "inline-flex");
function win() {
    $("#console").append("\n축하합니다! 이겼습니다.");
    //$("#console").append("\n" + mult + "점을 얻었습니다.");
    //coins += mult;
    wincount += 1;
    $("#deal").css("display", "inline-flex");
    return 0;
}
function lose() {
    $("#console").append("\n졌습니다...");
    //$("#console").append("\n" + mult + "점을 잃었습니다.");
    //coins -= mult;
    losecount += 1;
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function push() {
    $("#console").append("\n비겼습니다.");
    $("#deal").css("display", "inline-flex");
    return 0;
}
function surrender() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    $("#console").append("\n이번 판을 포기하셨습니다 (패배로 처리됩니다).");
    //$("#console").append("\n" + (0.5 * mult) + "점을 잃었습니다.");
    //coins -= 0.5 * mult;
    losecount += 1;
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function bust() {
    $("#console").append("\n버스트! 유감입니다. 졌습니다...");
    //$("#console").append("\n" + mult + "점을 잃었습니다.");
    //coins -= mult;
    losecount += 1;
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function jack() {
    $("#console").append("\n블랙잭 달성! 축하합니다. 이겼습니다!");
    //$("#console").append("\n" + (1.5 * mult) + "점을 획득했습니다.");
    //coins += 1.5 * mult;
    wincount += 1;
    $("#deal").css("display", "inline-flex");
    return 0;
}
function publicAd() {
    if (coins < 0) {
        $("#notice").text("땀 흘려 번 돈이 아름답습니다.");
     }
     }
});
    return 0;
}
function cardPop() {
function cardPop() {
     var j, ret;
     var j, ret;
188번째 줄: 294번째 줄:
     return ret;
     return ret;
}
}
</nowiki>
}}
!!!!!!!!!!!!!!!! 플러그인 정보 입력 구간 끝 아래는 만지지 마시오!!!!!!!!!!!!!!!!!
{{플러그인/preset/css}}
</div>{{#switch: {{{1|화면}}}
|dump =
|화면 =
<p<includeonly></includeonly>re class="script" data-name="{{#var:name}}"
    data-create="{{#var:creat}}"
    data-version="{{#var:version}}"
    data-descript="{{#var:descript}}"
    data-local="{{#var:local}}"
    data-executable="{{#var:executable}}"
    data-state="사용자:Riemann/p21">
{{#var:code}}
</pre>
|#default =
                {{#ifeq:{{{2|틀}}}|틀|{{플러그인/알림|{{#var:name}}}}|}}
<span class="use-script" data-name="{{#var:name}}" data-creat="{{#var:creat}}" data-version="{{#var:version}}" data-executable="{{#var:executable}}"
data-descript="{{#var:descript}}" data-local="{{#var:local}}" data-state="사용자:Riemann/p21" data-link="{{fullurl: {{#rel2abs: {{{1}}} }} }}"></span>
}}

2024년 6월 17일 (월) 21:07 기준 최신판

var title = mw.config.get('wgPageName');
if (title.slice( 1, 2 ) == "라") {
    var blind = true;
    var defa = 20;
} else {
    var blind = false;
    var defa = 10;
}
var mult = defa;
$("#multiplier").text(mult);

var coins = 100;
var wincount = 0;
var losecount = 0;
//$("#console").text("스코어: " + coins + "점");
$("#console").text("스코어: " + wincount + "승 " + losecount + "패");
$("#console").append("\n블랙잭에 오신 것을 환영합니다.");

const pcLst = [
0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAD,0xAE,
0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBD,0xBE,
0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCD,0xCE,
0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDD,0xDE];
const pointData = {a1:1,a2:2,a3:3,a4:4,a5:5,a6:6,a7:7,a8:8,a9:9,aa:10,ab:10,ad:10,ae:10,b1:1,b2:2,b3:3,b4:4,b5:5,b6:6,b7:7,b8:8,b9:9,ba:10,bb:10,bd:10,be:10,c1:1,c2:2,c3:3,c4:4,c5:5,c6:6,c7:7,c8:8,c9:9,ca:10,cb:10,cd:10,ce:10,d1:1,d2:2,d3:3,d4:4,d5:5,d6:6,d7:7,d8:8,d9:9,da:10,db:10,dd:10,de:10};
var pcSet = [];
function hexToChar(x) {
    return String.fromCharCode(0xD83C) +String.fromCharCode(x + 0xDC00);
}
function hexToStr(x) {
    return x.toString(16);
}
var dealerD, guestD;
$("#deal").click(function(){
    //$("#console").text("스코어: " + coins + "점");
    $("#console").text("스코어: " + wincount + "승 " + losecount + "패");
    $("#console").append("\n새 판을 엽니다.");
    $("#deal").css("display", "none");
    $("#dealerDeck").text("");
    $("#guestDeck").text("");
    pcSet = Object.create(pcLst);
    deal();
    return 0;
});
$("#hit").click(function(){
    hit();
    return 0;
});
$("#stand").click(function(){
    stand();
    return 0;
});
$("#surrender").click(function(){
    surrender();
    return 0;
});
$("#plus").click(function(){
    inc();
    return 0;
});
$("#minus").click(function(){
    dec();
    return 0;
});
$("#reset").click(function(){
    reset();
    return 0;
});
function reset() {
    mult = defa;
    $("#multiplier").text(mult);
}

/*
function inc() {
    if (mult < 100) {
        mult += 2;
    } else {
        alert("최대 100 코인까지만 걸 수 있습니다.");
    }
    $("#multiplier").text(mult);
}

function dec() {
    if (mult > 2) {
        mult -= 2;
    } else {
        alert("설마 빚을 판돈으로 거시려고요?");
    }
    $("#multiplier").text(mult);
}
*/

function deal() {
    dealerD = [];
    guestD = [];
    dealerD.push(cardPop());
    guestD.push(cardPop());
    dealerD.push(cardPop());
    guestD.push(cardPop());
    if (blind == true) {
        $("#dealerDeck").text("\u{1F0A0}\u{1F0A0}");
    } else {
        $("#dealerDeck").text(hexToChar(dealerD[0]) + "\u{1F0A0}");
    }
    $("#dealerS").text("?");
    if (blind == true) {
        $("#guestDeck").text("\u{1F0A0}\u{1F0A0}");
    } else {
        $("#guestDeck").text(hexToChar(guestD[0]) + hexToChar(guestD[1]));
    }
    var guestScore = [];
    var score = pointData[hexToStr(guestD[0])] + pointData[hexToStr(guestD[1])];
    $("#guestS").text(score);
    if ((pointData[hexToStr(guestD[0])] == 1 && pointData[hexToStr(guestD[1])] == 10) || (pointData[hexToStr(guestD[0])] == 10 && pointData[hexToStr(guestD[1])] == 1)) {
        $("#guestS").text(21);
        jack();
    } else {
        $("#hit").css("display", "inline-flex");
        $("#stand").css("display", "inline-flex");
        $("#surrender").css("display", "inline-flex");
    }
}
function hit() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    guestD.push(cardPop());
    var guestDeq = "";
    for (i = 0; i < guestD.length; i++) {
        guestDeq += hexToChar(guestD[i]);
    }
    if (blind == true) {
        $("#guestDeck").text("\u{1F0A0}".repeat(guestDeq.length / 2));
    } else {
        $("#guestDeck").text(guestDeq);
    }
    var guestScore = [];
    var score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    $("#guestS").text(score);
    if (score == 21 || (score == 11 && guestScore.includes(1))) {
        $("#console").append("\n21점이므로 자동으로 스탠드를 외쳤습니다.");
        stand(dealerD,guestD);
    } else if (score > 21) {
        bust();
    } else  {
        $("#hit").css("display", "inline-flex");
        $("#stand").css("display", "inline-flex");
    }
    return 0;
}
function stand() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    var dScore = 0;
    var dealerScore = [];
    for (i = 0; i < dealerD.length; i++) {
        dealerScore.push(pointData[hexToStr(dealerD[i])]);
        dScore += dealerScore[i];
    }
    while (dScore < 17) {
        dealerD.push(cardPop());
        $("#console").append("\n딜러가 카드를 뽑았습니다.");
        dealerScore = [];
        dScore = 0;
        for (i = 0; i < dealerD.length; i++) {
            dealerScore.push(pointData[hexToStr(dealerD[i])]);
            dScore += dealerScore[i];
            dealerDeq += hexToChar(dealerD[i]);
        }
    }
    var dealerDeq = "";
    for (i = 0; i < dealerD.length; i++) {
            dealerDeq += hexToChar(dealerD[i]);
        }
    $("#dealerS").text(dScore);
    $("#dealerDeck").text(dealerDeq);
    guestScore = [];
    score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    $("#guestS").text(score);
    if (score > 21) {
        bust();
    } else if (dScore > 21) {
        $("#console").append("\n딜러의 버스트.");
        win();
    } else {
        $("#console").append("\n딜러의 스탠드.");
        compare(dealerD,guestD);
    }
    return 0;
}
function compare() {
    var dealerScore = [];
    var dScore = 0;
    for (i = 0; i < dealerD.length; i++) {
        dealerScore.push(pointData[hexToStr(dealerD[i])]);
        dScore += dealerScore[i];
    }
    var guestScore = [];
    var score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    if (dScore < 12 && dealerScore.includes(1)) {
        dScore += 10;
    }
    if (score < 12 && guestScore.includes(1)) {
        score += 10;
    }
    $("#dealerS").text(dScore);
    $("#guestS").text(score);
    if (dScore > score) {
        lose();
    } else if (dScore == score) {
        push();
    } else {
        win();
    }
    return 0;
}
function win() {
    $("#console").append("\n축하합니다! 이겼습니다.");
    //$("#console").append("\n" + mult + "점을 얻었습니다.");
    //coins += mult;
    wincount += 1;
    $("#deal").css("display", "inline-flex");
    return 0;
}
function lose() {
    $("#console").append("\n졌습니다...");
    //$("#console").append("\n" + mult + "점을 잃었습니다.");
    //coins -= mult;
    losecount += 1;
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function push() {
    $("#console").append("\n비겼습니다.");
    $("#deal").css("display", "inline-flex");
    return 0;
}
function surrender() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    $("#console").append("\n이번 판을 포기하셨습니다 (패배로 처리됩니다).");
    //$("#console").append("\n" + (0.5 * mult) + "점을 잃었습니다.");
    //coins -= 0.5 * mult;
    losecount += 1;
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function bust() {
    $("#console").append("\n버스트! 유감입니다. 졌습니다...");
    //$("#console").append("\n" + mult + "점을 잃었습니다.");
    //coins -= mult;
    losecount += 1;
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function jack() {
    $("#console").append("\n블랙잭 달성! 축하합니다. 이겼습니다!");
    //$("#console").append("\n" + (1.5 * mult) + "점을 획득했습니다.");
    //coins += 1.5 * mult;
    wincount += 1;
    $("#deal").css("display", "inline-flex");
    return 0;
}
function publicAd() {
    if (coins < 0) {
        $("#notice").text("땀 흘려 번 돈이 아름답습니다.");
    }
    return 0;
}
function cardPop() {
    var j, ret;
    j = Math.floor(Math.random() * pcSet.length);
    ret = pcSet[j];
    pcSet.splice(j,1);
    return ret;
}