Originally Posted by
skatenjoi922
Cool thanks! i'm pretty lousy with arrays! ha i have my final for intro to computer science tomorrow and arrays are on it, i guess i should read up on it some before i take my final. Can i just set int values for a certain monster and have that int in an array?
Hmm... maybe
Code:
int monsters[5], attacks[5];
monsters[0] = 100; attacks[0] = 5;
monsters[1] = 80; attacks[1] = 6;
/* ... */
or equivalently
Code:
int monsters[5] = {100, 80, /*...*/};
int attacks[5] = {5, 6, /*...*/};
Then
Code:
printf("All the monsters attack you!\n");
for(i = 0; i < 5; i ++) {
player = battle(player, attacks[i]);
}
printf("You attack a monster in return.\n");
monster[2] = battle(monster[2], player_attack);
where the user gets to pick which monster they attack, instead of just 2 all the time.