Need help PLEASE!!

I got stuck with random cootie, count the number of roll taken, allow the game to play over.

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>


using namespace std;

int main(int argc, char *argv[])

{

int diceRoll;

int numBody = 0, numHead = 0;
int numAntenna = 0, numWings = 0, numTongue = 0, numLegs = 0;
char playAgain = 'y';

srand (time(0));




while(numBody < 1 || numHead < 1 || numAntenna < 2 || numWings < 2 || numTongue < 1 || numLegs < 4)
{
diceRoll = rand() % 6 + 1;


switch (diceRoll)
{
case 1:
if (numBody < 1)
numBody++;
break;
case 2:
if (numBody > 2)
numHead++;

break;
case 3:
if (numHead<1)
numAntenna++;
break;
case 4:
if (numBody<1)
numWings++;
break;
case 5:
if (numHead<1)
numTongue++;
case 6:
if (numBody<1)
numLegs++;
break;
}
if (numBody==1 && numHead==1 && numAntenna==2 && numWings==2 && numTongue==1 && numLegs==4)
{
cout << "Finish adding a Cootie";
}
}



cout << numBody << " Body " << numHead << " Head " << numAntenna << " Antenna " << numWings << " Wings "<< numTongue << " Tongue "
<< numLegs << " Legs " << endl;
while (playAgain != 'y' && playAgain != 'n');
{
if (playAgain !='y')
{
diceRoll = rand() % 6 +1;
cout << "Do you to play a again? y/n";
cin >> playAgain;
}
else
{
cout << "Your cootie was completed " << diceRoll << " dice rolls";
cout << "bye";
}
}
system("PAUSE");
return EXIT_SUCCESS;



}


Last edited on
Topic archived. No new replies allowed.