i would have one function to display the beetle like this
Code:
void drawbeetle(int no_of_parts)
{
// cout the parts
}
but it seems that your teacher wants you to learn about strings.
if that is the case you will need to have it so that your diceroll function adds the text into the string, this can be made easier by using a string array as shown
Code:
int diceroll = rand % max parts;
switch (diceroll)
{
case 1:
your_string[incrementor] = "part1";
break;
case 2:
// ...... and so on
}
then you need to make your drawbeetle
Code:
void drawbeetle(your_string[], int string_max)
{
for(int a = 0; a < string_max; a++)
cout << your_string[a] << endl;
}
also, do you output part 1, part 2, or leg, head, or something like
| |
/ \
| * * |
\ /
and so on