case 1: // 게임
{
cout << endl <<"게임을 시작합니다." << endl;
cout << "기회는 총 10번입니다." << endl;
int ball = 0;
int strike = 0;
vector<int>comPic = comPicNum();
int chance = 0;
while (strike!=3 && chance < 11)
{
if (chance > 10){
cout << "Loose..T.T" << endl << endl;
loose++;
break;
}
chance++;
cout << endl << "~~round " << chance << "~~" << endl;
vector<int>userPic = userPicNum();
ball = checkBall(userPic,comPic);
cout << "ball: " << ball << endl;
strike = checkStrike(userPic,comPic);
cout << "strike: " << strike << endl;
}
cout << "Win >.<!" << endl << endl;
win++;
break;
}
기회가 초과되면 패배하고 끝나야하는데
조건문을 나가면 승리가 나옴
조건식 수정 필요함
'C++' 카테고리의 다른 글
클래스 (0) | 2025.05.10 |
---|---|
[C++] 자료형(DATA) (0) | 2025.05.01 |