Code: Show/Hide switch (choice)
{ case 1: cout<<"Your attack has caused opponent : "; int attack, damage; time_t seconds; time(&seconds); srand((unsigned int) seconds); attack = rand() % (HIGH - LOW + 1) + LOW; cout<<attack<<" damage!"; damage = rand() % (HIGH - LOW + 1) + LOW; cout<<"\n\n\nYour Opponent attacked you with "<<damage<<" damage!\n\n"; system("pause"); int chp, mhp; //curent hp, minus hlp mhp = damage - attack; chp = hp - mhp; switch (chp) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 9: case 10: cout<<"yo"; break; } break; default: cout<<"\n\n Well there is only one function to press and its 1 and you fucked it all up so do i all over again\a\a"; break; } |
hellslaker wrote: |
is it possible to make a switch state ment say a>b ? |
Code: Show/Hide if (a>b)
{ printf("a (%d) > b (%d)\n", a, b); } else switch (a) { case 1: printf("a <= b (%d), and a is 1\n", b); break; default: printf("a (%d) <= b (%d), and a is not 1\n", a, b); break; } |