struct charic hunt(struct charic c, struct mon t)
{
first:
system(\"cls\");
int n;
if(c.lev>3)
{ t.countlev=c.lev-3+random(6);
}
else if(c.lev<4)
t.countlev=c.lev+random(3);
t.countHP=t.countlev*30;
t.countatk=t.countlev;
t.countdff=t.countlev;
printf(\"lev%d %s이 등장하였습니다\\n 싸우시려면 1 돌아가려면2를 입력해주세요\\n\", t.countlev, t.name[20]);
scanf(\"%d\", &n);
if(n==1)
{
while(c.Hp>=0 || t.countHP>=0)
{
printf(\"주인공 HP %d %s HP %d\\n\", c.Hp, t.countHP);
t.countHP=t.countHP-c.atk*2;
c.Hp=c.Hp-t.countatk*2;
if(c.Hp<=0 || t.countHP<=0)
break;
}
}
else if(n==2)
goto act_end;
else
goto first;
if(c.Hp>t.countHP)
{
int gain = t.countlev*100;
c.exp = c.exp+t.countlev*5;
c.cash = c.cash+t.countlev*100;
printf(\"승리\\n 경험치가 %d만큼 올랐습니다. %d골드를 획득하였습니다.\", t.countlev*5, gain);
system(\"pause\");
struct charic hunt={c.Expf, c.exp, c.lev, c.Mp, c.Hp, c.atk, c.dff, c.cash, c.elem};
}
if(c.Hp<t.countHP)
{printf(\"패배\\n\");
c.Hp=0;
system(\"pause\");
act_end:
struct charic hunt={c.Expf, c.exp, c.lev, c.Mp, c.Hp, c.atk, c.dff, c.cash, c.elem};
}
return hunt;
}
{
first:
system(\"cls\");
int n;
if(c.lev>3)
{ t.countlev=c.lev-3+random(6);
}
else if(c.lev<4)
t.countlev=c.lev+random(3);
t.countHP=t.countlev*30;
t.countatk=t.countlev;
t.countdff=t.countlev;
printf(\"lev%d %s이 등장하였습니다\\n 싸우시려면 1 돌아가려면2를 입력해주세요\\n\", t.countlev, t.name[20]);
scanf(\"%d\", &n);
if(n==1)
{
while(c.Hp>=0 || t.countHP>=0)
{
printf(\"주인공 HP %d %s HP %d\\n\", c.Hp, t.countHP);
t.countHP=t.countHP-c.atk*2;
c.Hp=c.Hp-t.countatk*2;
if(c.Hp<=0 || t.countHP<=0)
break;
}
}
else if(n==2)
goto act_end;
else
goto first;
if(c.Hp>t.countHP)
{
int gain = t.countlev*100;
c.exp = c.exp+t.countlev*5;
c.cash = c.cash+t.countlev*100;
printf(\"승리\\n 경험치가 %d만큼 올랐습니다. %d골드를 획득하였습니다.\", t.countlev*5, gain);
system(\"pause\");
struct charic hunt={c.Expf, c.exp, c.lev, c.Mp, c.Hp, c.atk, c.dff, c.cash, c.elem};
}
if(c.Hp<t.countHP)
{printf(\"패배\\n\");
c.Hp=0;
system(\"pause\");
act_end:
struct charic hunt={c.Expf, c.exp, c.lev, c.Mp, c.Hp, c.atk, c.dff, c.cash, c.elem};
}
return hunt;
}
아 goto만 봐도 머리아파
질문하는 꼬라지가 ㅉㅉ
다람쥐v는 죄송합니다 ,.. 횽들아 좀 도와주세요 하루종일 이건만 잡고있어요 ㅠㅠㅠㅠ
디버깅은 돌려봤음?
아니요 안돌려봤는데요...
돌려보니 세그먼트 실패라는데요??ㅠㅠㅠㅠ
디버깅함해보라는..네이버에 디버깅검색하면 하는법나옴
일단 말한신대로 해볼게요 감사합니다