C언어 빙고프로그램 질문이요
다옴
소스파일을 올렸습니다.
현재 저가질문할곳은 빙고를 확인하는쪽인데요.if(player[0][0]==0 && player[0][1]==0 && player[0][2]==0 && player[0][3]==0 && player[0][4]==0){
if(chk1==0){
pb+=1;chk1+=1;
}
}
if(player[1][0]==0 && player[1][1]==0 && player[1][2]==0 && player[1][3]==0 && player[1][4]==0){
if(chk2==0){
pb+=1;chk2+=1;
}
}
if(player[2][0]==0 && player[2][1]==0 && player[2][2]==0 && player[2][3]==0 && player[2][4]==0){
if(chk3==0){
pb+=1;chk3+=1;
}
}
if(player[3][0]==0 && player[3][1]==0 && player[3][2]==0 && player[3][3]==0 && player[3][4]==0){
if(chk4==0){
pb+=1;chk4+=1;
}
}
if(player[4][0]==0 && player[4][1]==0 && player[4][2]==0 && player[4][3]==0 && player[4][4]==0){
if(chk5==0){
pb+=1;chk5+=1;
}
}
if(player[0][0]==0 && player[1][0]==0 && player[2][0]==0 && player[3][0]==0 && player[4][0]==0){
if(chk6==0){
pb+=1;chk6+=1;
}
}
if(player[0][1]==0 && player[1][1]==0 && player[2][1]==0 && player[3][1]==0 && player[4][1]==0){
if(chk7==0){
pb+=1;chk7+=1;
}
}
if(player[0][2]==0 && player[1][2]==0 && player[2][2]==0 && player[3][2]==0 && player[4][2]==0){
if(chk8==0){
pb+=1;chk8+=1;
}
}
if(player[0][3]==0 && player[1][3]==0 && player[2][3]==0 && player[3][3]==0 && player[4][3]==0){
if(chk9==0){
pb+=1;chk9+=1;
}
}
if(player[0][4]==0 && player[1][4]==0 && player[2][4]==0 && player[3][4]==0 && player[4][4]==0){
if(chk10==0){
pb+=1;chk10+=1;
}
}
if(player[0][0]==0 && player[1][1]==0 && player[2][2]==0 && player[3][3]==0 && player[4][4]==0){
if(chk11==0){
pb+=1;chk11+=1;
}
}
if(player[0][4]==0 && player[1][3]==0 && player[2][2]==0 && player[3][1]==0 && player[4][0]==0){
if(chk12==0){
pb+=1;chk12+=1;
}
}
//위에는 사용자빙고 체크
//아래는 컴퓨터빙고 체크
if(computer[0][0]==0 && computer[0][1]==0 && computer[0][2]==0 && computer[0][3]==0 && computer[0][4]==0){
if(check1==0){
cb+=1;check1+=1;
}
}
if(computer[1][0]==0 && computer[1][1]==0 && computer[1][2]==0 && computer[1][3]==0 && computer[1][4]==0){
if(check2==0){
cb+=1;check2+=1;
}
}
if(computer[2][0]==0 && computer[2][1]==0 && computer[2][2]==0 && computer[2][3]==0 && computer[2][4]==0){
if(check3==0){
cb+=1;check3+=1;
}
}
if(computer[3][0]==0 && computer[3][1]==0 && computer[3][2]==0 && computer[3][3]==0 && computer[3][4]==0){
if(check4==0){
cb+=1;check4+=1;
}
}
if(computer[4][0]==0 && computer[4][1]==0 && computer[4][2]==0 && computer[4][3]==0 && computer[4][4]==0){
if(check5==0){
cb+=1;check5+=1;
}
}
if(computer[0][0]==0 && computer[1][0]==0 && computer[2][0]==0 && computer[3][0]==0 && computer[4][0]==0){
if(check6==0){
cb+=1;check6+=1;
}
}
if(computer[0][1]==0 && computer[1][1]==0 && computer[2][1]==0 && computer[3][1]==0 && computer[4][1]==0){
if(check7==0){
cb+=1;check7+=1;
}
}
if(computer[0][2]==0 && computer[1][2]==0 && computer[2][2]==0 && computer[3][2]==0 && computer[4][2]==0){
if(check8==0){
cb+=1;check8+=1;
}
}
if(computer[0][3]==0 && computer[1][3]==0 && computer[2][3]==0 && computer[3][3]==0 && computer[4][3]==0){
if(check9==0){
cb+=1;check9+=1;
}
}
if(computer[0][4]==0 && computer[1][4]==0 && computer[2][4]==0 && computer[3][4]==0 && computer[4][4]==0){
if(check10==0){
cb+=1;check10+=1;
}
}
if(computer[0][0]==0 && computer[1][1]==0 && computer[2][2]==0 && computer[3][3]==0 && computer[4][4]==0){
if(check11==0){
cb+=1;check11+=1;
}
}
if(computer[0][4]==0 && computer[1][3]==0 && computer[2][2]==0 && computer[3][1]==0 && computer[4][0]==0){
if(check12==0){
cb+=1;check12+=1;
}
}
printf(- 사용자 빙고횟수 : %d\n,pb);
printf(- 컴퓨터 빙고횟수 : %d,cb);이쪽입니다..; 저가 좀 반복문을 이용해서 해야하는데 그럴실력이 안됩니다.
어떻게 해야할지모르겠어서 질문합니다..ㅠㅠ
-
귀염포텐
우측정렬좀 해주세요.. 센터정렬이라 안보여요..
-
민구
배우는 순서는 원래 상관없지만... 반복문을 이해하기전에 바로 조건문으로 넘어가신건가?